[Issue 24529] New: is expression ignores implicit conversion of enum when pattern matching
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 30 16:01:17 UTC 2024
https://issues.dlang.org/show_bug.cgi?id=24529
Issue ID: 24529
Summary: is expression ignores implicit conversion of enum when
pattern matching
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: major
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
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`.
--
More information about the Digitalmars-d-bugs
mailing list