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

Type checker doesn't warn about "shadowing" nonterminal type #2092

Open
tvdstorm opened this issue Dec 6, 2024 · 0 comments
Open

Type checker doesn't warn about "shadowing" nonterminal type #2092

tvdstorm opened this issue Dec 6, 2024 · 0 comments

Comments

@tvdstorm
Copy link
Member

tvdstorm commented Dec 6, 2024

The type checker does not provide diagnostics about name collisions between ordinary types (or at least aliases) and nonterminal types. I've been able to narrow it down to the snippets below. I have experienced that a call like the first foo in main did not get called, so I expect that the arbitrary ordering of imports could is a cause of that (but I can't reproduce the behavior).

module Bug1

syntax Foo = "foo";
module Bug2

import Bug1;
import IO;

alias Foo = str; // no error or warning

void foo(Foo foo) {
    println("boom");
}

void main() {
    foo("foo"); // no error, boom gets printed.
    foo((Foo)`foo`); // error: `str or Foo` possibly not supported by parser generator
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant