-
Notifications
You must be signed in to change notification settings - Fork 13k
Closed
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone
Milestone
Description
TypeScript Version: 3.6.3
Code
This works:
/** @enum {number} */
const MyEnum = {
a: 1,
b: 2
};
/** @type {MyEnum} */
const v = MyEnum.b;
This doesn't work (MyEnum
imported from separate file):
// my-enum.js
/** @enum {number} */
const MyEnum = {
a: 1,
b: 2
};
export default MyEnum;
// main.js
import MyEnum from './my-enum.js';
/** @type {MyEnum} */ // ERROR: 'MyEnum' refers to a value, but is being used as a type here. ts(2749)
const v = MyEnum.b;
Expected behavior:
No type errors.
It did work fine in v2.8.3
nickpelone, ahocevar, ExE-Boss, arszp10, Mouvedia and 2 more
Metadata
Metadata
Assignees
Labels
BugA bug in TypeScriptA bug in TypeScriptDomain: JSDocRelates to JSDoc parsing and type generationRelates to JSDoc parsing and type generationFix AvailableA PR has been opened for this issueA PR has been opened for this issueRescheduledThis issue was previously scheduled to an earlier milestoneThis issue was previously scheduled to an earlier milestone