Bug 5397 – Compiler error on struct with invariant and postblitz

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Linux
Creation time
2011-01-01T13:12:00Z
Last change time
2011-01-01T22:26:12Z
Assigned to
nobody
Creator
alex.khmara

Comments

Comment #0 by alex.khmara — 2011-01-01T13:12:38Z
This code: module properties; struct PropertyList { invariant() { assert(1); } this(this) { _props = []; } string[] _props; } gives compiler error: Error: __result = this is not mutable Error: __result = this is not an lvalue Without invariant all works good.
Comment #1 by alex.khmara — 2011-01-01T13:14:12Z
It seems that I cannot set proper DMD version - It was on DMD 2.0.51, Linux x86
Comment #2 by clugdbug — 2011-01-01T22:26:12Z
(In reply to comment #1) > It seems that I cannot set proper DMD version - It was on DMD 2.0.51, Linux x86 You should just set version = D2 (the exact release number is useless information). Same issue as bug 3273. *** This issue has been marked as a duplicate of issue 3273 ***