We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Generic parameters are not propagated correctly when using structs
struct Foo<N> { field[N] inner; } def test<N>() -> Foo<N> { return Foo { inner: [0; N] }; } def main() -> Foo<2> { return test::<2>(); }
Fails to compile with message
Generic parameters must be compile-time constants, found test::<2>()
Assigning the result before returning works:
struct Foo<N> { field[N] inner; } def test<N>() -> Foo<N> { return Foo { inner: [0; N] }; } def main() -> Foo<2> { Foo<2> foo = test::<2>(); return foo; }
Using an array directly without the struct compiles fine as expected which might suggest something regarding structs is not right:
def test<N>() -> field[N] { return [0; N]; } def main() -> field[2] { return test::<2>(); }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Description
Generic parameters are not propagated correctly when using structs
Environment
Steps to Reproduce
Fails to compile with message
Assigning the result before returning works:
Using an array directly without the struct compiles fine as expected which might suggest something regarding structs is not right:
The text was updated successfully, but these errors were encountered: