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

erroneous "Mismatch between member and argument types." Related to parametric signedness? #1861

Open
dank-openai opened this issue Jan 16, 2025 · 0 comments · May be fixed by #1864
Open

erroneous "Mismatch between member and argument types." Related to parametric signedness? #1861

dank-openai opened this issue Jan 16, 2025 · 0 comments · May be fixed by #1864
Assignees
Labels
bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end

Comments

@dank-openai
Copy link

Describe the bug


pub struct foo<IS_SIGNED: bool , NUM_BITS: u32> {
    data: xN[IS_SIGNED][NUM_BITS], 
}

#[test]
fn test_instantiate_foo() {
    let _ = foo<false, u32:1> { data: xN[false][1]:0};
}

fails with

0012:     let _ = foo<false, u32:1> { data: xN[false][1]:0};
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^------------^ XlsTypeError: Mismatch between member and argument types.
Type mismatch:
   xN[is_signed=0][1]
vs xN[is_signed=0][1]

Maybe this is related to parametric signedness?

To Reproduce

Compile the above.

Expected behavior
That it works without error.

@cdleary cdleary self-assigned this Jan 16, 2025
@cdleary cdleary added bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end labels Jan 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working or is incorrect dslx DSLX (domain specific language) implementation / front-end
Projects
Status: No status
Development

Successfully merging a pull request may close this issue.

2 participants