[Issue 24789] New: Disallow body-less, non-extern, local functions
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Oct 3 09:33:34 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24789
Issue ID: 24789
Summary: Disallow body-less, non-extern, local functions
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: b2.temp at gmx.com
Given this small program, which compiles and run without error:
```d
module m;
void oops(){}
void main() {
void oops();
}
```
there could be an error for `main.oops` because
1. local body-less funcdecls have no use.
2. possibly the author was super-tired and meant to call `m.oops`.
--
More information about the Digitalmars-d-bugs
mailing list