Bug 10120 – @disable this(); and switch statement

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-19T12:25:00Z
Last change time
2015-06-09T01:31:21Z
Keywords
accepts-invalid
Assigned to
nobody
Creator
maxim

Comments

Comment #0 by maxim — 2013-05-19T12:25:05Z
struct S { int a; @disable this(); this(int) { a = 1; } ~this() { assert(a !is 0); } alias a this; int opCall() { return a; } } void main() { switch (S.init()) { case 0: assert(0); //oops default: } } Maybe in the first order this is 'calling member function on type' problem.