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
Fairly simple, passed some C code through c2nim and it spat out some if nil == X statements. These statements unfortunately crash the compiler with Error: internal error: getTypeDescAux(tyGenericParam) so figuring out what was wrong was a bit annoying. It works if typeof(X) is pointer, but crashes if it is for example ptr 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
Same issue as #16148 (though this is only realized after 15 comments), related is #15154 but this is a simpler case of just proc foo[T](a, b: ptr T).
If nil is matching ptr T and resolving T to itself (i.e. T = T vs T = nil) or stopping the resolution of T in some other simple way then this should be fixable (isGeneric?), but if T is being resolved to int and the type of the nil parameter is not populated after the fact then this is a limitation and we need to detect if we assign an unresolved type to a position that won't be populated with resolved parameters later.
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: