Bug 2468 – result type of AndAndExp and OrOrExp deduced incorrectly
Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Linux
Creation time
2008-11-23T03:46:00Z
Last change time
2014-03-01T00:36:15Z
Keywords
patch
Assigned to
bugzilla
Creator
kamm-removethis
Comments
Comment #0 by kamm-removethis — 2008-11-23T03:46:49Z
The spec says that "The result type of an OrOrExpression is bool, unless the right operand has type void, when the result is type void."
However, in AndAndExp and OrOrExp::semantic, it says:
if (e1->type->ty == Tvoid)
type = Type::tvoid;
The second seems to be a typo and shoud say e2->type->ty. Thanks to wilsonk, who found the bug that resulted from this in LDC and also provided the fix.