Bug 23905 – Initialization of SumType with opaque enum causes ICE

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2023-05-08T13:26:43Z
Last change time
2023-05-16T12:29:00Z
Keywords
pull
Assigned to
No Owner
Creator
Paul Backus

Comments

Comment #0 by snarwin+bugzilla — 2023-05-08T13:26:43Z
As of DMD 2.103.1, the following program fails to compile: --- import std.sumtype : SumType; enum Foo; void main(){ SumType!Foo data = Foo.init; // int.init; } --- The error message is: --- Error: unknown, please file report on issues.dlang.org ---
Comment #1 by snarwin+bugzilla — 2023-05-08T13:27:21Z
Reduced: --- struct SumType(T) { T storage; bool opEquals(Rhs)(Rhs rhs) if (is(typeof(Rhs.init))) { } } enum Foo; void main(){ SumType!Foo data = Foo.init; } ---
Comment #2 by razvan.nitu1305 — 2023-05-09T06:04:33Z
Comment #3 by dlang-bot — 2023-05-09T07:56:42Z
@RazvanN7 created dlang/dmd pull request #15207 "Fix Issue 23905 - Initialization of SumType with opaque enum causes ICE" fixing this issue: - Fix Issue 23905 - Initialization of SumType with opaque enum causes ICE https://github.com/dlang/dmd/pull/15207
Comment #4 by dlang-bot — 2023-05-10T06:11:01Z
dlang/dmd pull request #15207 "Fix Issue 23905 - Initialization of SumType with opaque enum causes ICE" was merged into stable: - 355a261e39d05958025239a7484f190ba3886a80 by RazvanN7: Fix Issue 23905 - Initialization of SumType with opaque enum causes ICE https://github.com/dlang/dmd/pull/15207
Comment #5 by dlang-bot — 2023-05-16T12:29:00Z
dlang/dmd pull request #15238 "merge stable" was merged into master: - 2a650f7609f579d026b6f363b4ad3ed9e162984e by Razvan Nitu: Fix Issue 23905 - Initialization of SumType with opaque enum causes ICE (#15207) https://github.com/dlang/dmd/pull/15238