D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7580 - Identity assignment of Nullable crashes dmd
Summary: Identity assignment of Nullable crashes dmd
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: ice, pull
: 7588 (view as issue list)
Depends on:
Blocks:
 
Reported: 2012-02-25 04:34 UTC by Kenji Hara
Modified: 2012-02-25 18:44 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Kenji Hara 2012-02-25 04:34:30 UTC
Following code compilation crashes dmd.

import std.typecons;
void main()
{
    Nullable!(int, 0) ni;
    ni = ni;
}

This is alias this issue that fallbacks to template member function.
Reduced test case:

struct S(T)
{
    void opAssign()(T value) {}
}
struct X(T)
{
    private T val;
    @property ref inout(T) get()() inout { return val; }
    alias get this;
}
void test()
{
    S!(int) s;
    X!int x;
    s = x;
}
Comment 2 github-bugzilla 2012-02-25 15:59:22 UTC
Commits pushed to master at https://github.com/D-Programming-Language/dmd

https://github.com/D-Programming-Language/dmd/commit/9d24a9916f573bb78504ef9a642fd7747f282393
fix Issue 7580 - Identity assignment of Nullable crashes dmd

https://github.com/D-Programming-Language/dmd/commit/a03216f62665b8e04d2d67dc1b52dc3ec8826163
Merge pull request #762 from 9rnsr/fix7580

Issue 7580 - Identity assignment of Nullable crashes dmd
Comment 3 Kenji Hara 2012-02-25 18:44:07 UTC
*** Issue 7588 has been marked as a duplicate of this issue. ***