Bug 24789 – Disallow body-less, non-extern, local functions

Status
NEW
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-10-03T09:33:34Z
Last change time
2024-12-13T19:37:43Z
Assigned to
No Owner
Creator
basile-z
Moved to GitHub: dmd#20522 →

Comments

Comment #0 by b2.temp — 2024-10-03T09:33:34Z
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 by b2.temp — 2024-10-03T09:37:07Z
local body-less **non-extern** funcdecls have no use.
Comment #2 by robert.schadek — 2024-12-13T19:37:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20522 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB