From 7481f4375303f3bf41ec1d7f685283e558856531 Mon Sep 17 00:00:00 2001 From: Timothee Cour Date: Thu, 6 Feb 2020 21:58:04 -0800 Subject: fix #13349 regression: isNamedTuple now works with generic tuples (#13350) --- compiler/docgen2.nim | 2 +- compiler/semmagic.nim | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) (limited to 'compiler') diff --git a/compiler/docgen2.nim b/compiler/docgen2.nim index b5ef7e32d..438417ca0 100644 --- a/compiler/docgen2.nim +++ b/compiler/docgen2.nim @@ -11,7 +11,7 @@ # semantic checking. import - options, ast, msgs, idents, passes, docgen, lineinfos, pathutils + options, ast, msgs, passes, docgen, lineinfos, pathutils from modulegraphs import ModuleGraph, PPassContext diff --git a/compiler/semmagic.nim b/compiler/semmagic.nim index 0cd5a5332..41a920371 100644 --- a/compiler/semmagic.nim +++ b/compiler/semmagic.nim @@ -176,6 +176,7 @@ proc evalTypeTrait(c: PContext; traitCall: PNode, operand: PType, context: PSym) hasDestructor(t) result = newIntNodeT(toInt128(ord(not complexObj)), traitCall, c.graph) of "isNamedTuple": + var operand = operand.skipTypes({tyGenericInst}) let cond = operand.kind == tyTuple and operand.n != nil result = newIntNodeT(toInt128(ord(cond)), traitCall, c.graph) of "distinctBase": -- cgit 1.4.1-2-gfad0