Bug 13322 – Remove the ability to mark a module level declaration static

Status
RESOLVED
Resolution
WONTFIX
Severity
trivial
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
All
Creation time
2014-08-18T15:28:14Z
Last change time
2021-09-14T13:55:32Z
Assigned to
No Owner
Creator
Phil Lavoie

Comments

Comment #0 by maidenphil — 2014-08-18T15:28:14Z
module toto; static int x = 4; static void myFunc(){} static template myTemplate(){} static struct Hello{} static class GoodBye{} static interface Wow{} This compiles. It seems like static works with every module declaration, yet changes nothing. I think it is misleading and should not compile. In the eventuality that "static class" ever means something at module level, it would be even more confusing if every version of the compiler allows it yet only a few do something with it. Philz
Comment #1 by razvan.nitu1305 — 2021-09-14T13:55:32Z
Redundant attributes are not errored out in D. That would break a lot of code.