Bug 24784 – Error on first lambda parameter with default with type inference

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-09-25T16:32:09Z
Last change time
2024-12-13T19:37:36Z
Keywords
pull
Assigned to
Bolpat
Creator
Bolpat
Moved to GitHub: dmd#18269 →

Comments

Comment #0 by qs.il.paperinik — 2024-09-25T16:32:09Z
Example: ```d alias fp = (x = 0) { }; // Error: undefined identifier `x` ```
Comment #1 by nick — 2024-09-26T16:13:11Z
When there's a default initializer, I think the Identifier is parsed as a type: struct X {} alias fp = (X = X.init) { pragma(msg, is(X)); return 0; }; // true enum e = fp(X()); See Issue 12814.
Comment #2 by qs.il.paperinik — 2024-09-26T17:22:10Z
I’ll try to fix this.
Comment #3 by dlang-bot — 2024-09-26T17:32:32Z
@Bolpat created dlang/dmd pull request #16889 "Fix Bugzilla Issue 24784" fixing this issue: - Fix Bugzilla Issue 24784 https://github.com/dlang/dmd/pull/16889
Comment #4 by robert.schadek — 2024-12-13T19:37:36Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18269 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB