[Issue 7136] New: alias this lookup should run before merging modifiers of both sides.
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Dec 19 03:19:36 PST 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7136
Summary: alias this lookup should run before merging modifiers
of both sides.
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: normal
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: k.hara.pg at gmail.com
--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2011-12-19 03:19:30 PST ---
Test cases:
void test()
{
struct X
{
Object get() immutable { return null; }
alias get this;
}
immutable(X) x;
Object y;
static assert( is(typeof(1?x:y) == Object)); // fails
static assert(!is(typeof(1?x:y) == const(Object))); // fails
struct A
{
int[] get() immutable { return null; }
alias get this;
}
immutable(A) a;
int[] b;
static assert( is(typeof(1?a:b) == int[])); // fails
static assert(!is(typeof(1?a:b) == const(int[]))); // fails
}
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list