Skip to content

Commit

Permalink
fixes #23295; don't expand constants for complex structures
Browse files Browse the repository at this point in the history
fixes #23295
  • Loading branch information
ringabout authored Feb 9, 2024
1 parent befb383 commit a426eb1
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions compiler/trees.nim
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,7 @@ proc stupidStmtListExpr*(n: PNode): bool =
proc dontInlineConstant*(orig, cnst: PNode): bool {.inline.} =
# symbols that expand to a complex constant (array, etc.) should not be
# inlined, unless it's the empty array:
result = orig.kind != cnst.kind and
cnst.kind in {nkCurly, nkPar, nkTupleConstr, nkBracket, nkObjConstr} and
result = cnst.kind in {nkCurly, nkPar, nkTupleConstr, nkBracket, nkObjConstr} and
cnst.len > ord(cnst.kind == nkObjConstr)

proc isRunnableExamples*(n: PNode): bool =
Expand Down

0 comments on commit a426eb1

Please sign in to comment.