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
if nil == X
crashes the compiler
#23534
Comments
Same issue as #16148 (though this is only realized after 15 comments), related is #15154 but this is a simpler case of just If Very easy bandaid is: proc `==`[T](a: typeof(nil) | typeof(nil), b: T) {.magic: "WhateverMagicPointerEqualityUses".} but in general |
Description
Fairly simple, passed some C code through c2nim and it spat out some
if nil == X
statements. These statements unfortunately crash the compiler withError: internal error: getTypeDescAux(tyGenericParam)
so figuring out what was wrong was a bit annoying. It works iftypeof(X)
ispointer
, but crashes if it is for exampleptr int
.Nim Version
Nim Compiler Version 2.0.4 [Linux: amd64]
Compiled at 2024-03-28
Copyright (c) 2006-2023 by Andreas Rumpf
git hash: b47747d
active boot switches: -d:release
Current Output
Expected Output
Possible Solution
No response
Additional Information
The text was updated successfully, but these errors were encountered: