autorest.typescript
autorest.typescript copied to clipboard
isUnexpected not working if one model is a subset of another model
See pr https://github.com/Azure/autorest.typescript/pull/2501/files Generated code: https://github.com/kazrael2119/autorest.typescript/blob/deviceregistry-modular/packages/typespec-test/test/DeviceRegistry.Management/generated/typespec-ts/src/rest/isUnexpected.ts#L82
In following OperationStatusGetDefaultResponse is a subset of OperationStatusGet200Response so the helper fail to type narrowing.
export function isUnexpected(
response: OperationStatusGet200Response | OperationStatusGetDefaultResponse,
): response is OperationStatusGetDefaultResponse;
Finally causing the modular code failed to compile.