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
Its a pretty specific error, but i have simplified my code to 4 examples that showcase when the compiler crashes and when it doesnt.
Example
# Example 1procsplitArray*[T](arr: array[T, int]; x, y: static[int]): array[y - x, int] =# compiles with nim -v 1.4.2 and abovediscard# Example 2procsplitArray*[T: static[int]](arr: array[T, int]; x: static[int] = T; y: static[int]): array[y - x, int] =# compile time error (although it shouldnt error afaik) discard# Example 3procsplitArray*[T: static[int]](arr: array[T, int]; x = T, y: static[int]): array[y - x, int] =# segfault (coment example 3 to check)discard# Example 4procsplitArray*[T](arr: array[T, int]; x = T, y: static[int]): array[y - x, int] =# segfault (coment example 3 to check)discard
Current Output
Example 2
Error: cannot generate code for: T
Examples 3 and 4
....SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Expected Output
compiles (?) (or at least output a proper error message if this is not intended to compile)
Additional Information
Segfault occurs with versions 0.19 to 1.5.1 (that i have tested, probably still happens in devel), so the segfault was introduced somewhere inbetween 0.18 and 0.19.
Versions 0.19 to 1.4 throw an ordinal type expected error on the first example, while versions 0.18 and below throw a cannot evaluate at compile time: y.
Similarly, in example 2, when using nim -v 0.18 and below, Error: cannot evaluate at compile time: y occurs, and from version 0.19 to 1.5.1 (and probably devel) (5, 71) Error: cannot generate code for: T is raised instead.
So probably, a PR that had something to do with examples 1 and/or 2 broke something and has passed unoticed until now.
The text was updated successfully, but these errors were encountered:
I am unsure if this is a separate issue, but the following also leads to a compiler crash. Removing Foo.b, or initializing it with a constant value works.
Its a pretty specific error, but i have simplified my code to 4 examples that showcase when the compiler crashes and when it doesnt.
Example
Current Output
Example 2
Examples 3 and 4
Expected Output
Additional Information
Segfault occurs with versions 0.19 to 1.5.1 (that i have tested, probably still happens in devel), so the segfault was introduced somewhere inbetween 0.18 and 0.19.
Versions 0.19 to 1.4 throw an
ordinal type expected
error on the first example, while versions 0.18 and below throw acannot evaluate at compile time: y
.Similarly, in example 2, when using nim -v 0.18 and below,
Error: cannot evaluate at compile time: y
occurs, and from version 0.19 to 1.5.1 (and probably devel)(5, 71) Error: cannot generate code for: T
is raised instead.So probably, a PR that had something to do with examples 1 and/or 2 broke something and has passed unoticed until now.
The text was updated successfully, but these errors were encountered: