[Issue 24219] New: Can't compare AliasSeq with is operator
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Thu Nov 2 11:48:53 UTC 2023
https://issues.dlang.org/show_bug.cgi?id=24219
Issue ID: 24219
Summary: Can't compare AliasSeq with is operator
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: snarwin+bugzilla at gmail.com
As of DMD 2.105.2, the following program fails to compile:
---
struct S { int x, y; }
void main()
{
auto s1 = S(123, 456);
auto s2 = S(123, 456);
assert(s1.tupleof is s2.tupleof);
}
---
The error message is:
---
test.d(7): Error: incompatible types for `(AliasSeq!(s1.x, s1.y)) is
(AliasSeq!(s2.x, s2.y))`: both operands are of type `(int, int)`
---
If the `is` operator is replaced with `==`, the program compiles and runs
successfully.
--
More information about the Digitalmars-d-bugs
mailing list