Skip to content

Disallow body-less, non-extern, local functions #3362

Open
@dlangBugzillaToGithub

Description

@dlangBugzillaToGithub

basile-z reported this on 2024-10-03T09:33:34Z

Transferred from https://issues.dlang.org/show_bug.cgi?id=24789

Description

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`.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions