Issue 24789 - Disallow body-less, non-extern, local functions
Summary: Disallow body-less, non-extern, local functions
Status: NEW
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 minor
Assignee: No Owner
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-10-03 09:33 UTC by basile-z
Modified: 2024-10-03 09:37 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description basile-z 2024-10-03 09:33:34 UTC
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`.
Comment 1 basile-z 2024-10-03 09:37:07 UTC
local body-less **non-extern** funcdecls have no use.