-
Notifications
You must be signed in to change notification settings - Fork 13k
Open
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this
Milestone
Description
π Search Terms
"enum", "namespace", "declaration", "d.ts", "const"
π Version & Regression Information
- This changed between versions 3.1.0-dev.20180906 and 3.1.0-dev.20180907
β― Playground Link
π» Code
enum Foo {
bar
}
namespace Foo {
export const baz = Foo.bar;
}
π Actual behavior
Typescript generates invalid d.ts for the enum value assigned to the constant (in all versions starting 3.1.0-dev.20180907)
declare enum Foo {
bar = 0
}
declare namespace Foo {
const baz = bar; // <-- unknown `bar` identifier, `baz` type is `any`
}
In versions before 3.1.0-dev.20180906 the constant is declared as const baz: Foo;
π Expected behavior
Typescript generates a valid declaration of the constant
declare enum Foo {
bar = 0
}
declare namespace Foo {
const baz = Foo.bar;
}
or
declare enum Foo {
bar = 0
}
declare namespace Foo {
const baz: Foo;
}
Additional information about the issue
No response
RyanCavanaughCopilot
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptFix AvailableA PR has been opened for this issueA PR has been opened for this issueHelp WantedYou can do thisYou can do this