Bug 3598 – Static functions in immutable structs/classes needed

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2009-12-07T14:28:00Z
Last change time
2015-06-09T01:27:01Z
Assigned to
nobody
Creator
tomeksowi

Comments

Comment #0 by tomeksowi — 2009-12-07T14:28:59Z
Currently immutable types can't have static functions and I believe this impediment is a bug: immutable struct Strukt { static void funkcja() { } } Should compile but fails with message: function test.Strukt.funkcja without 'this' cannot be const/immutable
Comment #1 by tomeksowi — 2009-12-09T11:22:11Z
I heard the bug is not clear about what should we do, so I'll restate: Currently everything inside an immutable struct/class is tagged with "immutable". I say, tag everything but static functions.
Comment #2 by bugzilla — 2010-12-05T13:00:04Z
*** This issue has been marked as a duplicate of issue 5110 ***