[Issue 368] New: "immediate"-function types allowed as the return type of functions.

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Sep 26 05:00:46 PDT 2006


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

           Summary: "immediate"-function types allowed as the return type of
                    functions.
           Product: D
           Version: 0.167
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Keywords: accepts-invalid, ice-on-invalid-code
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: brunodomedeiros+bugz at gmail.com


"immediate"-function types allowed as the return type of functions. Example:

--------
void func(int a) { }
//typedef int ft(int);

typeof(func) test() {
}
----
Instead, the compiler complains that a return is needed (yet such return value
can not be specified). Using a typedef results in the same problem.

The following extended testcase crashes the compiler:

--------
void func(int a) { }

typeof(func) test() {
    if(true) throw new Exception("");
}
----


-- 




More information about the Digitalmars-d-bugs mailing list