http://d.puremagic.com/issues/show_bug.cgi?id=4269


yebblies <yebbl...@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebbl...@gmail.com


--- Comment #5 from yebblies <yebbl...@gmail.com> 2011-07-11 00:33:53 EST ---
The problem seems to be a huge forward reference bug.  When semantic is first
called on a declaration while errors are gagged, it is never attempted again. 
This leads to errors never being printed, and compilation happily continuing to
code generation.

The solution is probably the same as for bug 4042 - add the ability to rewind
the semantic pass on failure to each type of declaration's semantic routines.

Some fun test cases:

// Compiles without error
//static if(is(typeof(X1.init))) {}
//class X1 { Y y; }

// Compiles without error
//static if(is(typeof(X2.init))) {}
//struct X2 { Y y; }

// Assertion failure: '0' on line 1123 in file 'glue.c'
//static if(is(typeof(X3.init))) {}
//void X3(T) { }

// Compiles without error
//static if(is(typeof(X4.init))) {}
//Y X4() { return typeof(return).init; }

// Access violation in mtype.c:6819
//static if(is(typeof(X5.init))) {}
//typedef Y X5;

// Compiles without error
//static if(is(typeof(X6.init))) {}
//alias Y X6;

// Assertion failure: '0' on line 1123 in file 'glue.c'
//static if(is(typeof(X7))) {}
//Y X7;

// Compiles without error
//static if(is(typeof(X8.init))) {}
//class X8 : Y {}

// Compiles without error
//static if(is(typeof(X9.init))) {}
//interface X9 : Y {}

// Compiles without error
//static if(is(typeof(X9.init))) {}
//interface X9 { Y y; }

// Doesn't even need the errors gagged - what the hell?
// Probably a different bug
//struct X10 { alias Y this; }

// Assertion failure: '0' on line 1123 in file 'glue.c'
//static if(is(typeof(X11.init))) {}
//const { Y X11; }

// Compiles without error
//static if(is(typeof(X12.init))) {}
//enum X12 = Y;

// Compiles without error
//static if(is(typeof(X13!(0).init))) {}
//template X13(Y y) {}

// Compiles without error
//static if(is(typeof(X14.init))) {}
//struct X14 { int a; alias a this; alias a this; }

// Compiles without error
//static if(is(typeof(X15()))) {}
//auto X15() { alias x this; }

// Compiles without error
//static if(is(typeof(X16))) {}
//alias X16 X16;

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to