[Issue 228] Crash on inferring function literal return type after prior errors

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Nov 19 03:48:27 PST 2006


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


deewiant at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|Crash on inferring function |Crash on inferring function
                   |literal return type with    |literal return type after
                   |undefined identifier        |prior errors
            Version|0.161                       |0.174




------- Comment #1 from deewiant at gmail.com  2006-11-19 05:48 -------
This annoyance takes place with some other errors as well:
--
void main() {
        bool b = 2; // cannot implicitly convert expression (2) of type int to
bool
        auto x = function(){}; // ... and a DMD crash
}
--
deprecated int a;
void main() {
        a = 2; // variable asdf.a is deprecated
        auto x = function(){}; // ... and a DMD crash
}
--
void main() {
        const int a = [2]; // cannot use array to initialize
        auto x = function(){}; // ... and a DMD crash
}
--
const int a; // variable asdf.a missing initializer in static constructor for
const variable
static this() {
}
void main() {
        auto x = function(){}; // ... and a DMD crash
}
--
void f(int i) {}
void main() {
        f(); // expected 1 arguments, not 0
        auto x = function(){}; // ... and a DMD crash
}
--
I'm sure I could find more examples if I felt like it. Still, all errors don't
trigger it:
--
void main() {
        int x;
        auto x = function(){}; // asdf.main.x is already defined
}
--
void main() {
        import auto x = function(){}; // found 'import' instead of statement
}
--
This one was interesting, it triggers only if it's at function scope:
--
void main() {
        void x = function(){}; // variable asdf.main.x voids have no value, DMD
crash
}
--
void x = function(){}; // variable asdf.x voids have no value, DMD doesn't
crash
--


-- 




More information about the Digitalmars-d-bugs mailing list