Bug 7136 – alias this lookup should run before merging modifiers of both sides.

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-12-19T03:19:00Z
Last change time
2011-12-20T13:03:31Z
Keywords
patch
Assigned to
nobody
Creator
k.hara.pg

Comments

Comment #0 by k.hara.pg — 2011-12-19T03:19:30Z
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 }
Comment #1 by k.hara.pg — 2011-12-19T07:11:57Z
Comment #2 by bugzilla — 2011-12-20T13:03:31Z