mirror of
https://github.com/nim-lang/Nim.git
synced 2026-08-23 23:21:42 +00:00
test typedesc
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user