[Issue 2214] No error if void function returns a non-void value

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jul 10 12:17:46 PDT 2008


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


2korden at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|No error if void function   |No error if void function
                   |returns a value             |returns a non-void value




------- Comment #1 from 2korden at gmail.com  2008-07-10 14:17 -------
I agree that this code is correct:

void foo() {
}

void bar() {
  return foo();
}

while I think that this isn't:

void foo() {
  return -1;
}

Besides, if it *is* supposed to work this way, it should be mentioned in spec.


-- 



More information about the Digitalmars-d-bugs mailing list