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
Describe the bug
Version: 21.0.1
When a Class enum property has a default value of an enum member, isEnum() returns false as it sees the type from the enum value itself.
isEnum()
To Reproduce
import {Project} from "ts-morph"; const project = new Project(); project.createSourceFile("test.ts", ` export enum TestEnum { A = 1, } export class TestClass { p = TestEnum.A } `) project.getSourceFiles().forEach(src => { src.getClasses().forEach(cls => { cls.getProperties().forEach(prop => { console.log({ prop: prop.getName(), type: prop.getType().getText(cls), isEnum: prop.getType().isEnum(), apparentType: prop.getType().getApparentType().getText(cls), }) }) }) })
Expected behavior
would expect property.getType().isEnum() to return true
property.getType().isEnum()
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Describe the bug
Version: 21.0.1
When a Class enum property has a default value of an enum member,
isEnum()
returns false as it sees the type from the enum value itself.To Reproduce
Expected behavior
would expect
property.getType().isEnum()
to return trueThe text was updated successfully, but these errors were encountered: