Skip to content

Avoid exposing compiler-generated lambda identifiers in instantiation traces - #23837

Closed
usefahmed07 wants to merge 1 commit into
dlang:masterfrom
usefahmed07:fix-instantiated-from-here-lambda
Closed

usefahmed07 wants to merge 1 commit into
dlang:masterfrom
usefahmed07:fix-instantiated-from-here-lambda

Conversation

@usefahmed07

Copy link
Copy Markdown
Contributor

Fixes #23836

Follow-up to #20261 (fixed in #23835)

… traces

Follow-up to dlang#20261 / dlang#23835. The 'instantiated from here' supplemental
error line, printed by TemplateInstance.printInstantiationTrace, still
exposed the internal compiler-generated identifier for lambda templates

Added a check in printInstantiationTrace: when a TemplateInstance's
tempdecl wraps a FuncLiteralDeclaration (i.e. it originates from a
lambda), the trace now reports it simply as 'lambda function' instead
of the internal name, across all three trace-printing code paths
(normal, collapsed-recursion, and too-deep).

Updated existing fail_compilation tests that asserted on the old
internal identifier.
@github-actions

Copy link
Copy Markdown

DMD perf check

Metric Base PR Δ
compile Phobos codegen (instr) 1,472.6 M 1,470.5 M -0.143%
dmd binary size (stripped) 6.87 MB 6.88 MB +0.11%
All measurements
Metric Base PR Δ
compile hello.d (instr) 213.4 M 213.3 M -0.018%
compile hello.d -O -release (instr) 231.7 M 231.6 M -0.012%
compile Phobos (instr) 5,122.6 M 5,120.6 M -0.038%
compile Phobos codegen (instr) 1,472.6 M 1,470.5 M -0.143%
compile vibe.d (instr) 15,115.0 M 15,116.4 M +0.009%
dmd binary size (stripped) 6.87 MB 6.88 MB +0.11%
hello binary size (stripped) 0.72 MB 0.72 MB 0.00%
peak RSS (compile hello.d) 43.19 MB 43.14 MB -0.10%
peak RSS (compile Phobos) 618.3 MB 620.5 MB +0.36%
peak RSS (compile vibe.d) 1919 MB 1918 MB -0.06%
compile dmd itself (wall) 12.6 s 12.7 s +0.86%
compile hello.d (wall) 68.0 ms 65.1 ms -4.18%
compile Phobos (wall) 1,645 ms 1,631 ms -0.80%

a2d4abe vs merge-base e1a45b8 · about these metrics

@usefahmed07
usefahmed07 deleted the fix-instantiated-from-here-lambda branch September 12, 2026 18:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lambda instantiation traces expose compiler-generated identifier (__lambda_LxxCyy!T)

1 participant