Skip to content

Commit

Permalink
improve compiler performance on dot fields after nim-lang#24005
Browse files Browse the repository at this point in the history
  • Loading branch information
metagn committed Sep 7, 2024
1 parent 7cd1777 commit 078608d
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions compiler/semexprs.nim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 078608d

Please sign in to comment.