Bug 24529 – is expression ignores implicit conversion of enum when pattern matching

Status
NEW
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-04-30T16:01:17Z
Last change time
2024-12-13T19:34:58Z
Assigned to
No Owner
Creator
Paul Backus
Moved to GitHub: dmd#20448 →

Comments

Comment #0 by snarwin+bugzilla — 2024-04-30T16:01:17Z
As of DMD 2.108.0, the following program fails to compile: --- struct S(T) {} enum E : S!int { a = S!int() } static assert(is(E : S!int)); // ok static assert(is(E : S!T, T)); // error --- The error message is: --- bug.d(5): Error: static assert: `is(E : S!T, __isexp_id2, T)` is false --- The expected behavior is for both static assert statements to pass. See also issue 21975, in which the same error was caused by a struct with `alias this`.
Comment #1 by robert.schadek — 2024-12-13T19:34:58Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20448 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB