-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
“cannot be named” when generating declarations for re-exported classes #8612
Labels
Duplicate
An existing issue was already created
Comments
Here is a similar example without a re-export which works fine: // file Things.ts
export class ThingA { }
export class ThingB { }
// file Test.ts
import * as things from "./Things";
export class Test {
public method = (input: things.ThingA) => { };
}
// compile
tsc Test.ts --declaration --outDir compiled This is the generated import * as things from "./Things";
export declare class Test {
method: (input: things.ThingA) => void;
} |
this is the same root cause as #5938. the compiler follows the |
closing in favor of #5938 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
TypeScript Version:
1.8.10 / nightly (1.9.0-dev.20160515)
Code
Expected behavior:
No errors
Actual behavior:
It seems declaration file can't be generated due to the
things.ThingA
reference, but in a similar case without re-exporting it works fine (I will give an example of this in the next post).If I change the import statement in Test.ts to this:
(instead of
import * as things
) and further useThingA
directly, there are no errors, but this defeats the purpose of re-exporting.The text was updated successfully, but these errors were encountered: