Bug 18878 – Short-circuiting && not behaving correctly

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2018-05-19T18:38:13Z
Last change time
2020-03-21T03:56:39Z
Assigned to
No Owner
Creator
Manu

Comments

Comment #0 by turkeyman — 2018-05-19T18:38:13Z
Well, this is not okay! enum isInternal(string field) = field.length >= 2 && field[0..2] == "__"; pragma(msg, isInternal!"x"); > error : string slice `[0 .. 2]` is out of bounds My code used to compile.
Comment #1 by b2.temp — 2018-05-20T05:51:03Z
A fix is on the PR stack. *** This issue has been marked as a duplicate of issue 18115 ***