-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Compiler crash related to static[T] #14053
Comments
It is not really static[T] , you currently can't use calls in proc return type. Would be nice to get fixed |
@cooldome It's not caused by using a call in a return type, the same errors occurs if the call is used for a parameter type: template returnType(value: static[int]): typedesc =
int
proc fun*(value: static[int], _: returnType(value)) =
discard If the call does not reference another parameter however it works for both parameter types and return types. |
The example successfully compiles with Nim devel v1.3.5 on my machine. @GULPF, can you confirm? |
The original example now compiles, but attempting to use template returnType(value: static[int]): typedesc =
when value == 1:
int
else:
float
proc fun*(value: static[int]): returnType(value) =
discard
echo fun(1) Output:
I can update the issue or create a new one |
Works now #24005 |
closes nim-lang#1969, closes nim-lang#7737, closes nim-lang#11838, closes nim-lang#12283, closes nim-lang#14053, closes nim-lang#16118, closes nim-lang#19670, closes nim-lang#22645
Updated example (from the comment below)
Original Example
Current Output
koch temp output
The text was updated successfully, but these errors were encountered: