Bug 9274 – is + alias this = wrong code

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-01-06T05:55:10Z
Last change time
2018-11-06T17:54:42Z
Assigned to
No Owner
Creator
Zhenya Chapovsky
See also
https://issues.dlang.org/show_bug.cgi?id=11499, https://issues.dlang.org/show_bug.cgi?id=6777, https://issues.dlang.org/show_bug.cgi?id=5363

Comments

Comment #0 by zheny — 2013-01-06T05:55:10Z
struct OhWhy(S) { S[] arr; alias arr this; } void main() { static assert(!is(OhWhy!float unused == T[],T));/*fails,but shouldn't since struct OhWhy isn't an array */ }
Comment #1 by verylonglogin.reg — 2013-11-09T02:21:28Z
Reduced testcase --- struct S { float[] arr; alias arr this; } static assert(!is(S == float[])); // ok static assert(!is(S == T[], T)); // fails ---
Comment #2 by razvan.nitu1305 — 2018-10-17T14:31:12Z
Comment #3 by github-bugzilla — 2018-11-06T17:54:38Z
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/c4fa519661dcb584b23a4573c0e549925b5339db Fix Issue 9274 and 11499 - is + alias this = wrong code https://github.com/dlang/dmd/commit/80ce8b1ead69489e17d6ddaa8bb7b92d5890a6d9 Merge pull request #8839 from RazvanN7/Issue_9274 Fix Issue 9274 and 11499 - is + alias this = wrong code