Bug 19634 – Usual Arithmetic Conversions doesn't define what happens on failure

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-01-30T01:10:48Z
Last change time
2024-12-13T19:02:16Z
Keywords
spec
Assigned to
No Owner
Creator
Neia Neutuladh
Moved to GitHub: dmd#19535 →

Comments

Comment #0 by dhasenan — 2019-01-30T01:10:48Z
https://dlang.org/spec/type.html#usual-arithmetic-conversions This defines a series of possible conversions used to bring two expressions to the same type for arithmetic operations. This set of conversions is mentioned for equality expressions, among others. However, the spec doesn't mention what happens when those conversions fail. I guess it's undefined behavior?
Comment #1 by dhasenan — 2019-01-30T01:19:10Z
The specific manifestation of this is with identity expressions on unrelated interfaces: --- interface A {} interface B {} class C : A, B {} void main() { A a = new C; B b = new C; assert(a !is b); } --- The spec doesn't say whether this should work. The Usual Arithmetic Conversions fail. It doesn't say that anything in particular should happen in this case, but it vaguely implies that they need to succeed.
Comment #2 by robert.schadek — 2024-12-13T19:02:16Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19535 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB