Skip to content
New issue

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

Inconsistent ast types in introspect #721

Open
ekarademir opened this issue Sep 28, 2023 · 2 comments · May be fixed by #831
Open

Inconsistent ast types in introspect #721

ekarademir opened this issue Sep 28, 2023 · 2 comments · May be fixed by #831

Comments

@ekarademir
Copy link
Contributor

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

@subhajit20
Copy link
Contributor

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
Copy link
Contributor

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 subhajit20 linked a pull request Mar 22, 2024 that will close this issue
5 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Next 3 Months
Development

Successfully merging a pull request may close this issue.

3 participants