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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 10 04:05:56 PST 2012


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


yebblies <yebblies at gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|regression                  |normal


--- Comment #19 from yebblies <yebblies at gmail.com> 2012-02-10 23:05:52 EST ---
To be more specific - any declaration semantic routine that might result in
errors needs to give an error the second time semantic is run too - the reason
it happens with the X3 test case is because errors in parameter types are not
propagated to the function type, but there are plenty of other errors in
FuncDeclaration::semantic that will be silently ignored as the type isn't set
to Type::terror.  I haven't looked at the other declaration types yet but there
are probably cases there too.

Some FuncDeclaration cases:

//static if (is(typeof(X17.init))) {}
//scope void X17() {}

//static if (is(typeof(X18.init))) {}
//abstract void X18() {}

//static if (is(typeof(X19.init))) {}
//override void X19() {}

//static if (is(typeof(X20.init))) {}
//const void X20() {}

//static if (is(typeof(X21.init))) {}
//immutable void X21() {}

//static if (is(typeof(main.init))) {}
//string main();

//static if (is(typeof(main.init))) {}
//auto main() { return ""; }

//static if (is(typeof(main.init))) {}
//void main(int) { }

Some of these are just accepts-invalid with meaningless attributes, but the
'main' ones will generate wrong code.

Errors in the declaration type are not all that needs to be monitored - either
the error count needs to be examined or every possible error needs to set the
type to Type::terror.

-- 
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