[Issue 17334] New: Template constraints do short circuit semantic analysis for && and ||, but not for ?:
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Apr 19 15:42:16 PDT 2017
https://issues.dlang.org/show_bug.cgi?id=17334
Issue ID: 17334
Summary: Template constraints do short circuit semantic
analysis for && and ||, but not for ?:
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: bugzilla at digitalmars.com
It should do it for ?: too.
Spelunking the code, 'constraint' is the field of interest:
https://github.com/dlang/dmd/blob/master/src/ddmd/dtemplate.d#L497
and it gets semantically analyzed here:
https://github.com/dlang/dmd/blob/master/src/ddmd/dtemplate.d#L892
But before that it sets SCOPEcondition here:
https://github.com/dlang/dmd/blob/master/src/ddmd/dtemplate.d#L887
and looking in expression.d for SCOPEcondition:
https://github.com/dlang/dmd/blob/master/src/ddmd/expression.d#L15212
https://github.com/dlang/dmd/blob/master/src/ddmd/expression.d#L15212
and there's the short circuit conditional semantic analysis of constraints.
But it's not there for ?:
--
More information about the Digitalmars-d-bugs
mailing list