test typedesc

This commit is contained in:
ringabout
2026-02-27 11:16:33 +08:00
parent 358d9b4497
commit 9f41d2bd79
2 changed files with 2 additions and 3 deletions

View File

@@ -981,7 +981,7 @@ proc setGenericParams(c: PContext, n, expectedParams: PNode) =
if e.typ == nil:
n[i].typ = errorType(c)
else:
n[i].typ = e.typ.skipTypes({tyTypeDesc})
n[i].typ = e.typ
proc explicitGenericInstantiation(c: PContext, n: PNode, s: PSym, doError: bool): PNode =
assert n.kind == nkBracketExpr

View File

@@ -160,8 +160,7 @@ proc matchGenericParam(m: var TCandidate, formal: PType, n: PNode) =
arg = newTypeS(tyStatic, m.c, son = evaluated.typ)
arg.n = evaluated
elif formalBase.kind == tyTypeDesc:
if arg.kind != tyTypeDesc:
arg = makeTypeDesc(m.c, arg)
discard # if arg is not tyTypeDesc, typeRel will report the mismatch
else:
arg = arg.skipTypes({tyTypeDesc})
let tm = typeRel(m, formal, arg)