Files
tsgo/testdata/baselines/reference/submodule/compiler/aliasInstantiationExpressionGenericIntersectionNoCrash1.errors.txt

23 lines
1.7 KiB
Plaintext

aliasInstantiationExpressionGenericIntersectionNoCrash1.ts(10,1): error TS2352: Conversion of type '{ new (): ErrImpl<number>; prototype: ErrImpl<any>; } & (() => number)' to type '{ new (): ErrImpl<string>; prototype: ErrImpl<any>; } & (() => string)' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
Type '{ new (): ErrImpl<number>; prototype: ErrImpl<any>; } & (() => number)' is not comparable to type '{ new (): ErrImpl<string>; prototype: ErrImpl<any>; }'.
Type 'ErrImpl<number>' is not comparable to type 'ErrImpl<string>'.
Type 'number' is not comparable to type 'string'.
==== aliasInstantiationExpressionGenericIntersectionNoCrash1.ts (1 errors) ====
class ErrImpl<E> {
e!: E;
}
declare const Err: typeof ErrImpl & (<T>() => T);
type ErrAlias<U> = typeof Err<U>;
declare const e: ErrAlias<number>;
e as ErrAlias<string>;
~~~~~~~~~~~~~~~~~~~~~
!!! error TS2352: Conversion of type '{ new (): ErrImpl<number>; prototype: ErrImpl<any>; } & (() => number)' to type '{ new (): ErrImpl<string>; prototype: ErrImpl<any>; } & (() => string)' may be a mistake because neither type sufficiently overlaps with the other. If this was intentional, convert the expression to 'unknown' first.
!!! error TS2352: Type '{ new (): ErrImpl<number>; prototype: ErrImpl<any>; } & (() => number)' is not comparable to type '{ new (): ErrImpl<string>; prototype: ErrImpl<any>; }'.
!!! error TS2352: Type 'ErrImpl<number>' is not comparable to type 'ErrImpl<string>'.
!!! error TS2352: Type 'number' is not comparable to type 'string'.