-
-
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
[ICE] Combination of concept, dotOperators
& static leads to internal error
#20996
Comments
Minimized? Unsure if this is the same error import std/macros
macro matchMe(x: typed): untyped =
discard x.getTypeImpl
type
ElementRT = object
Element[Z] = ElementRT # this version is needed, even though we don't use it
let ar = ElementRT()
matchMe(ar) For some reason this "generic alias impl AST replaces original type impl AST" situation feels familiar but I can't find a related issue. |
Haha, after manically reducing the code from having to remove 3 big dependencies to reproduce it and keeping "one bit" from each made me miss the forest for the trees. :) Yeah, your code is the same issue! |
metagn
added a commit
to metagn/Nim
that referenced
this issue
Dec 4, 2022
Merged
survivorm
pushed a commit
to survivorm/Nim
that referenced
this issue
Feb 28, 2023
* fix nim-lang#20996 * hopefully fix
capocasa
pushed a commit
to capocasa/Nim
that referenced
this issue
Mar 31, 2023
* fix nim-lang#20996 * hopefully fix
bung87
pushed a commit
to bung87/Nim
that referenced
this issue
Jul 29, 2023
* fix nim-lang#20996 * hopefully fix
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Description
This is a highly reduced case of an issue I encountered because a bug in a macro meant the wrong code was generated, leaving me with an internal error.
edit: See metagn's version in the first response for a smaller example.
Nim Version
Nim Compiler Version 1.7.3 [Linux: amd64]
Compiled at 2022-12-02
Copyright (c) 2006-2022 by Andreas Rumpf
git hash: 10b6e4f
active boot switches: -d:release -d:danger
Current Output
Expected Output
Possible Solution
Running
koch temp
on it yields:checking the source of the problem indicates the following line (https://github.com/nim-lang/Nim/blob/devel/compiler/vmdeps.nim#L170):
so it accesses the first child of
objectDef
, which in this case is invalid. Extending thenkRefTy
check above to:gives the correct compiler error in this case. But this is just me copying the logic from a few lines above for the case where the AST of the input symbol is itself a symbol. I suppose there is a cleaner solution?
Additional Information
No response
The text was updated successfully, but these errors were encountered: