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

Confusing error messages in type declarations #393

Open
skejeton opened this issue May 28, 2024 · 1 comment
Open

Confusing error messages in type declarations #393

skejeton opened this issue May 28, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@skejeton
Copy link
Contributor

import ("module.um")

type X = struct {
  field: ^module.Type
}

Will show ; expected but . found, instead of the usual "Unknown identifier x". Seems to be related to how pointers in structs work.


type X = struct {
  field: ^module::Type
}

Will show ; expected but :: found, instead of the usual "Unknown identifier x".

@vtereshkov vtereshkov added the enhancement New feature or request label May 28, 2024
@vtereshkov
Copy link
Owner

It's harder to say "Unknown identifier x" in type declarations because an unknown identifier per se is not an error. It may be a forward declaration of a recursive type. But I agree the message is confusing.

@vtereshkov vtereshkov changed the title Confusing error messages in struct fields. Confusing error messages in type declarations May 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants