[Issue 4269] Regression(2.031): invalid type accepted if evaluated while errors are gagged

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Jul 10 07:39:03 PDT 2011


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


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |yebblies at gmail.com


--- Comment #5 from yebblies <yebblies at 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: -------


More information about the Digitalmars-d-bugs mailing list