From 6a1e4ea79b1cc11bd96acc33bf729c73f7e51d35 Mon Sep 17 00:00:00 2001 From: metagn Date: Tue, 25 Nov 2025 20:09:32 +0300 Subject: [PATCH] test producing typedesc type for generic param in semSym --- compiler/semexprs.nim | 2 +- tests/tuples/tgenericparamtypetuple.nim | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) create mode 100644 tests/tuples/tgenericparamtypetuple.nim diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 31b3770459d71..40da501b93792 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1411,7 +1411,7 @@ proc semSym(c: PContext, n: PNode, sym: PSym, flags: TExprFlags): PNode = elif s.ast != nil: result = semExpr(c, s.ast) else: - n.typ() = s.typ + n.typ() = makeTypeDesc(c, s.typ) return n of skType: if n.kind != nkDotExpr: # dotExpr is already checked by builtinFieldAccess diff --git a/tests/tuples/tgenericparamtypetuple.nim b/tests/tuples/tgenericparamtypetuple.nim new file mode 100644 index 0000000000000..6701a44e781c6 --- /dev/null +++ b/tests/tuples/tgenericparamtypetuple.nim @@ -0,0 +1,6 @@ +# issue #25312 + +import heapqueue + +proc failingTest[T](test: HeapQueue[(float, T)]) = # (Compile) Error: Mixing types and values in tuples is not allowed. + discard