concerto
concerto copied to clipboard
Inconsistent ast types in introspect
Bug Report 🐛
Types of ast fields are sometimes string, sometimes any. Instead maybe they should conform to the generated types.
Expected Behavior
If I use ast
property of a ClassDeclaration
, it should have the type IDeclaration
instead of string
.
Current Behavior
If I use ast
property of a ClassDeclaration
, it has the type string
instead of IDeclaration
.
Possible Solution
Steps to Reproduce
- Create a
ModelFile
that has declarations - Obtain one of the declarations with for instance
modelFile.getAllDeclarations().at(0)
- Now access the ast property of that declaration and check type with
typeof
declaration (no pun intended) -
typeof myDeclaration
isobject
but TypeScript assumes that it'sstring
, because of the type definition file.
Context (Environment)
Desktop
- OS: macOS Ventura
- Browser: NodeJS
- Version: 18.17.1
Detailed Description
Possible Implementation
hey @ekarademir How can I get access of concerto-type package? I tried to import that a couple of times but the module not found an error occurring
I am able to reproduce the type bug.
Should I change the last inside the type file of decorated
file itself or should I change anything else? Just need some suggestions