D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 9274 - is + alias this = wrong code
Summary: is + alias this = wrong code
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-06 05:55 UTC by Zhenya Chapovsky
Modified: 2018-11-06 17:54 UTC (History)
4 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Zhenya Chapovsky 2013-01-06 05:55:10 UTC
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 Denis Shelomovskii 2013-11-09 02:21:28 UTC
Reduced testcase
---
struct S
{
    float[] arr;
    alias arr this;
}

static assert(!is(S == float[])); // ok
static assert(!is(S == T[], T)); // fails
---
Comment 2 RazvanN 2018-10-17 14:31:12 UTC
PR : https://github.com/dlang/dmd/pull/8839
Comment 3 github-bugzilla 2018-11-06 17:54:38 UTC
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