Skip to content

free types in type constraints will appear as type parameters in wrong order #5078

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

Open
fridis opened this issue Apr 15, 2025 · 0 comments
Open
Labels
enhancement New feature or request Fuzion language related to the language, syntax, etc

Comments

@fridis
Copy link
Member

fridis commented Apr 15, 2025

Take this example with type parameters Q and R

x(a Q : Sequence R) => say "Q $Q R $R"
x [1,2,3]
x i32 (array i32) [1,2,3]

it works

 > ./build/bin/fz test_free.fz 
Q Type of 'array i32' R Type of 'i32'
Q Type of 'array i32' R Type of 'i32'

but it is surprising that in the call without type inference x i32 (array i32) [1,2,3], the actual argument for R, which is i32 has to come before that for Q even though in the declaration, the order to the free types is Q before R.

@fridis fridis added enhancement New feature or request Fuzion language related to the language, syntax, etc labels Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Fuzion language related to the language, syntax, etc
Projects
None yet
Development

No branches or pull requests

1 participant