We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
TypeScript Version: Version 3.1.0-dev.20180914
Code
Let's have 3 TypeScript files:
bbb.ts:
export interface INode<T> { data: T; } export function create<T>(): () => INode<T> { return (undefined as any) as () => INode<T>; }
lib.ts:
export type G<T extends string> = { [P in T]: string }; export enum E { A = "a" } export type T = G<E>;
index.ts:
import { T } from "./lib"; import { create } from "./bbb"; export const fun = create<T>();
Expected behavior:
when compiled with tsc index -d it generates valid index.d.ts:
tsc index -d
export declare const fun: () => import("./bbb").INode<import("./lib").G<import("./lib").E>>;
or another valid would be:
export declare const fun: () => import("./bbb").INode<import("./lib").T>;
Actual behavior:
when compiled with tsc index -d it generates invalid index.d.ts:
export declare const fun: () => import("./bbb").INode<import("./lib").G<E>>;
The text was updated successfully, but these errors were encountered:
Possible duplicate of #26969?
Sorry, something went wrong.
Could be duplicate, why type T is expanded is another question. Sorry that I didn't found your reported bug.
T
weswigham
No branches or pull requests
TypeScript Version: Version 3.1.0-dev.20180914
Code
Let's have 3 TypeScript files:
bbb.ts:
lib.ts:
index.ts:
Expected behavior:
when compiled with
tsc index -d
it generates valid index.d.ts:or another valid would be:
Actual behavior:
when compiled with
tsc index -d
it generates invalid index.d.ts:The text was updated successfully, but these errors were encountered: