Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect type parameter in dts when imported as alias #52

Open
kevinresol opened this issue Jun 22, 2021 · 0 comments
Open

Incorrect type parameter in dts when imported as alias #52

kevinresol opened this issue Jun 22, 2021 · 0 comments

Comments

@kevinresol
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant