import js.lib.Promise as AliasPromise;
typedef TypedefPromise<T> = js.lib.Promise<T>;
class Main {
static function main() {}
public static function f1<A>(p: js.lib.Promise<A>): Void {} // good
public static function f2<A>(p: AliasPromise<A>): Void {} // bad
public static function f3<A>(p: TypedefPromise<A>): Void {} // bad
}
generated:
export type TypedefPromise<T> = Promise<T>
export declare class Main {
protected static main(): void
static f1<A>(p: Promise<A>): void
static f2<A>(p: Promise<T>): void
static f3<A>(p: Promise<T>): void
}
and tsc will complain unknown type T and f2 and f3
generated:
and tsc will complain unknown type
T
andf2
andf3