From 078608d193da279b1e7f46bff7ce74546d8f69f8 Mon Sep 17 00:00:00 2001 From: metagn Date: Sat, 7 Sep 2024 03:14:55 +0300 Subject: [PATCH] improve compiler performance on dot fields after #24005 --- compiler/semexprs.nim | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/compiler/semexprs.nim b/compiler/semexprs.nim index 737a846c0665..081eb684776f 100644 --- a/compiler/semexprs.nim +++ b/compiler/semexprs.nim @@ -1504,12 +1504,9 @@ proc tryReadingGenericParam(c: PContext, n: PNode, i: PIdent, t: PType): PNode = result.typ = makeTypeFromExpr(c, copyTree(result)) else: result = nil - elif t.containsGenericType: - if c.inGenericContext > 0: - result = semGenericStmt(c, n) - result.typ = makeTypeFromExpr(c, copyTree(result)) - else: - result = nil + elif c.inGenericContext > 0 and t.containsGenericType: + result = semGenericStmt(c, n) + result.typ = makeTypeFromExpr(c, copyTree(result)) else: result = nil