Confusing error message if you try to access an internal enum
Open
Nobody has claimed this yet.
🐛 bug
🛠️ compiler
- Dominant language
- TypeScript
- Stars
- 5.4k
- Forks
- 215
- Avg merge
- 2h 9m
- Merged PRs (30d)
- 27
Description
Confusing error message if you try to access an internal enum
"error: Expected identifier "fixture" to be a variable, but it's a namespace
--> ../../../examples/tests/invalid/internal_access_modifiers.test.w:3:9
|
3 | let e = fixture.FavoritePlanets.MARS;
| ^^^^^^^
Originally posted by @Chriscbr in https://github.com/winglang/wing/pull/6980#discussion_r1702275372
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by running examples/tests/invalid/internal_access_modifiers.test.w and inspect the diagnostic produced at line 3 for the internal enum access. Trace the compiler entry point that reports this error and clarify the message so it accurately describes the attempted access instead of reporting only a namespace-versus-variable mismatch.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 35/100