You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The compiler crashes with the following example, where FloatGen is defined as an alias to Gen[float, 8].
Example
typeGen[T; U: int] =object
a: array[U, T]
procinitGen[T; U: int](): Gen[T, U] =result=Gen[T, U]()
result.a = []
typeFloatGen=Gen[float, 8] # this makes the compiler crashvar gen =initGen[float, 8]()
echo gen
Current Output
fatal.nim(39) sysFatal
Error: unhandled exception: int128.nim(72, 11) `arg.sdata(2) == 0` out of range [AssertionError]
Expected Output
This is the output when the type alias is removed, it's also the expected error message.
/usercode/in.nim(9, 18) template/generic instantiation of `initGen` from here
/usercode/in.nim(7, 14) Error: type mismatch: got <array[0..-1, empty]> but expected 'array[int, float]'
Additional Information
$ nim -v
Nim Compiler Version 1.0.0 [Linux: amd64]
Compiled at 2019-09-23
Copyright (c) 2006-2019 by Andreas Rumpf
git hash: f7a8fc46c0012033917582eb740dc0343c093e35
active boot switches: -d:release
The text was updated successfully, but these errors were encountered:
The compiler crashes with the following example, where
FloatGen
is defined as an alias toGen[float, 8]
.Example
Current Output
Expected Output
This is the output when the type alias is removed, it's also the expected error message.
Additional Information
The text was updated successfully, but these errors were encountered: