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

Apparent parser sensitivity to the positioning of parametric impls #1911

Open
richmckeever opened this issue Feb 6, 2025 · 0 comments
Open
Labels
dslx DSLX (domain specific language) implementation / front-end

Comments

@richmckeever
Copy link
Collaborator

Using this modified code example from a test in a pending type_system_v2 change:

struct S<N: u32> {}
struct T<N: u32> {}

fn f<N: u32>() -> u32 { N + 1 }

impl S<N> {
  const N_PLUS_1_VALUE = f<N>();
}

impl T<N> {
  const N_PLUS_2_VALUE = f<{S<N>::N_PLUS_1_VALUE}>();
}

When parsing the S impl, the parser appears to deal out a NameRef to N which points to the binding NameDef in T. However, if you move the S impl to immediately after the counterpart struct, it does the right thing.

@richmckeever richmckeever added the dslx DSLX (domain specific language) implementation / front-end label Feb 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dslx DSLX (domain specific language) implementation / front-end
Projects
Status: No status
Development

No branches or pull requests

1 participant