concerto icon indicating copy to clipboard operation
concerto copied to clipboard

Inconsistent ast types in introspect

Open ekarademir opened this issue 1 year ago • 2 comments

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

  1. Create a ModelFile that has declarations
  2. Obtain one of the declarations with for instance modelFile.getAllDeclarations().at(0)
  3. Now access the ast property of that declaration and check type with typeof declaration (no pun intended)
  4. typeof myDeclaration is object but TypeScript assumes that it's string, because of the type definition file.

Context (Environment)

Desktop

  • OS: macOS Ventura
  • Browser: NodeJS
  • Version: 18.17.1

Detailed Description

Possible Implementation

ekarademir avatar Sep 28 '23 12:09 ekarademir

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

subhajit20 avatar Mar 22 '24 06:03 subhajit20

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

subhajit20 avatar Mar 22 '24 15:03 subhajit20