D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6896 - ICE(glue.c !vthis->csym): on method with alias this access
Summary: ICE(glue.c !vthis->csym): on method with alias this access
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: No Owner
URL:
Keywords: ice
: 7082 (view as issue list)
Depends on:
Blocks:
 
Reported: 2011-11-05 11:12 UTC by Martin Nowak
Modified: 2012-05-04 16:07 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 Martin Nowak 2011-11-05 11:12:46 UTC
// REQUIRED_ARGS: -inline

struct Nested
{
    int _val;
}

struct S
{
    Nested _nested;
    alias _nested this;

    void set(int v)
    {
        assign(v);
    }

    void assign(int v)
    {
        _val = v;
    }
}

----

Note that this does not happen when the definition of assign
comes lexically before set. So the issue appears to be an alias this
access when inlining a function that was forward referenced.

This is probably related to
http://d.puremagic.com/issues/show_bug.cgi?id=2962.
Comment 1 David Simcha 2011-12-08 16:21:41 UTC
Here's another way to reproduce the same failure:

int expression( string op, Lhs, Rhs )
( auto ref Lhs lhs, auto ref Rhs rhs ) {
    return 0;
}

struct BasicMatrix( Storage_ ) {
    auto opBinary( string op, NewRhs )( auto ref NewRhs newRhs ) {
        alias this thisConverted;      
        return expression!op( thisConverted, newRhs );
    }
}

void ridgeLargeP() {
    BasicMatrix!double cwc;
    auto foo = cwc * cwc;
}
Comment 2 David Simcha 2011-12-08 16:21:49 UTC
*** Issue 7082 has been marked as a duplicate of this issue. ***
Comment 3 SomeDude 2012-04-20 17:15:45 UTC
Both tests pass and run with or without -inline
Comment 4 SomeDude 2012-04-20 17:16:10 UTC
(In reply to comment #3)
> Both tests pass and run with or without -inline

On 2.059 Win32
Comment 5 SomeDude 2012-05-01 15:56:08 UTC
Should be closed FIXED.