-
-
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
Crash in compiler when using system.any by accident. #14255
Labels
Comments
More cases, block:
var a = newSeq[bool](1000)
if false:
echo "ok?"
elif any(a):
echo "false"
block:
var a = newSeq[bool](1000)
while any(a):
echo "ok?"
block:
when any(a):
echo "when" It also causes problems in VM: static:
## unhandled exception: 'intVal' is not accessible using discriminant 'kind' of type 'TFullReg'
let a = newSeq[bool](1000)
if any(a):
echo "ok?" It works in JS backend. |
Could it be fixed before It seems hard to fix it in sem phase I guess? proc hello(a: int): any =
true
if hello(12):
echo "ok?" |
ringabout
added a commit
that referenced
this issue
Mar 23, 2023
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
…cident. (nim-lang#21562) fixes nim-lang#14255; Crash in compiler when using system.any by accident.
bung87
pushed a commit
to bung87/Nim
that referenced
this issue
Jul 29, 2023
…cident. (nim-lang#21562) fixes nim-lang#14255; Crash in compiler when using system.any by accident.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Reproduce the error with:
Get compiler crash:
I think i am using system.any which is a "meta type" and not sequtils.any. Even though I am using sequtils.any wrong. I expect to get an error some thing like: "system.any can't be created from an seq". Or even some thing less fancy like "invalid type" at line 2.
The text was updated successfully, but these errors were encountered: