From 9f41d2bd79b2556e92a228ece9093a528d2b791c Mon Sep 17 00:00:00 2001 From: ringabout <43030857+ringabout@users.noreply.github.com> Date: Fri, 27 Feb 2026 11:16:33 +0800 Subject: [PATCH] test typedesc --- compiler/semcall.nim | 2 +- compiler/sigmatch.nim | 3 +-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/compiler/semcall.nim b/compiler/semcall.nim index 4557ab4c69..29d19875d4 100644 --- a/compiler/semcall.nim +++ b/compiler/semcall.nim @@ -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 diff --git a/compiler/sigmatch.nim b/compiler/sigmatch.nim index d97148baef..bcd68f621d 100644 --- a/compiler/sigmatch.nim +++ b/compiler/sigmatch.nim @@ -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)