Ensure instantiation expressions have symbols, preventing crash in signature relations (#56064)

This commit is contained in:
Jake Bailey
2023-11-07 15:59:19 -08:00
committed by GitHub
parent 649e614496
commit 4dd1e2f844
13 changed files with 283 additions and 15 deletions

View File

@@ -0,0 +1,12 @@
// @strict: true
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>;

View File

@@ -0,0 +1,17 @@
// @strict: true
declare class Class<T> {
x: T;
}
declare function fn<T>(): T;
type ClassAlias<T> = typeof Class<T>;
type FnAlias<T> = typeof fn<T>;
type Wat<T> = ClassAlias<T> & FnAlias<T>;
declare const wat: Wat<number>;
wat as Wat<string>;