mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-04 02:44:44 +00:00
semtypinst: don't wrap type nodes from expressions in static[T] (#18860)
This commit is contained in:
@@ -548,7 +548,7 @@ proc replaceTypeVarsTAux(cl: var TReplTypeVars, t: PType): PType =
|
||||
result = n.typ.skipTypes({tyTypeDesc})
|
||||
# result = n.typ.base
|
||||
else:
|
||||
if n.typ.kind != tyStatic:
|
||||
if n.typ.kind != tyStatic and n.kind != nkType:
|
||||
# XXX: In the future, semConstExpr should
|
||||
# return tyStatic values to let anyone make
|
||||
# use of this knowledge. The patching here
|
||||
|
||||
17
tests/generics/t18859.nim
Normal file
17
tests/generics/t18859.nim
Normal file
@@ -0,0 +1,17 @@
|
||||
import macros
|
||||
|
||||
macro symFromDesc(T: typedesc): untyped =
|
||||
let typ = getType(T)
|
||||
typ[1]
|
||||
|
||||
template produceType(T: typedesc): untyped =
|
||||
type
|
||||
XT = object
|
||||
x: symFromDesc(T)
|
||||
|
||||
XT
|
||||
|
||||
type
|
||||
X[T] = produceType(T)
|
||||
|
||||
var x: X[int]
|
||||
Reference in New Issue
Block a user