Bug 18430 – isSame is wrong for non global lambdas

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-02-13T04:00:37Z
Last change time
2018-02-13T14:03:17Z
Assigned to
No Owner
Creator
Илья Ярошенко

Comments

Comment #0 by ilyayaroshenko — 2018-02-13T04:00:37Z
template Alias(alias a) { alias Alias = a; } auto foo() { auto scale = 4; alias edentity = a => a * scale; static assert(__traits(isSame, Alias!edentity, edentity)); // fails in dmd-nightly } Mir Algorithm uses this technique a lot to reduce template bloat. It does not compiles with dmd-nightly now, see CI https://travis-ci.org/libmir/mir-algorithm/jobs/339855290
Comment #1 by razvan.nitu1305 — 2018-02-13T09:22:39Z
Comment #2 by github-bugzilla — 2018-02-13T14:03:16Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/1701bf9f7ff68538ca4ae279078233e74bc3b617 Fix Issue 18430 - isSame is wrong for non global lambdas https://github.com/dlang/dmd/commit/01fb3ca67d15571a374c2efb821f82c0d9d39c9f Merge pull request #7885 from RazvanN7/Issue_18430 Fix Issue 18430 - isSame is wrong for non global lambdas