diff --git a/src/expression.c b/src/expression.c index aac5b45ab5a7..cf3ca6418b18 100644 --- a/src/expression.c +++ b/src/expression.c @@ -8920,6 +8920,8 @@ Expression *NotExp::semantic(Scope *sc) UnaExp::semantic(sc); e1 = resolveProperties(sc, e1); e1 = e1->checkToBoolean(sc); + if (e1->type == Type::terror) + return e1; type = Type::tboolean; } return this; @@ -8947,6 +8949,8 @@ Expression *BoolExp::semantic(Scope *sc) UnaExp::semantic(sc); e1 = resolveProperties(sc, e1); e1 = e1->checkToBoolean(sc); + if (e1->type == Type::terror) + return e1; type = Type::tboolean; } return this; diff --git a/test/fail_compilation/test8556.d b/test/fail_compilation/test8556.d index e87eb3efa14b..e40d43b64e49 100644 --- a/test/fail_compilation/test8556.d +++ b/test/fail_compilation/test8556.d @@ -1,10 +1,11 @@ /* TEST_OUTPUT: --- -fail_compilation/test8556.d(44): Error: template test8556.grabExactly matches more than one template declaration, fail_compilation/test8556.d(30):grabExactly(R)(R range) if (!isSliceable!(R)) and fail_compilation/test8556.d(31):grabExactly(R)(R range) if (isSliceable!(R)) -fail_compilation/test8556.d(19): Error: template instance test8556.isSliceable!(Circle!(uint[])) error instantiating -fail_compilation/test8556.d(24): Error: Grab!(Circle!(uint[])) is used as a type -fail_compilation/test8556.d(55): Error: template instance test8556.grab!(Circle!(uint[])) error instantiating +fail_compilation/test8556.d(45): Error: template test8556.grabExactly matches more than one template declaration, fail_compilation/test8556.d(31):grabExactly(R)(R range) if (!isSliceable!(R)) and fail_compilation/test8556.d(32):grabExactly(R)(R range) if (isSliceable!(R)) +fail_compilation/test8556.d(20): Error: template instance test8556.isSliceable!(Circle!(uint[])) error instantiating +fail_compilation/test8556.d(25): Error: template instance Grab!(Circle!(uint[])) Grab!(Circle!(uint[])) does not match template declaration Grab(Range) if (!isSliceable!(Range)) +fail_compilation/test8556.d(25): Error: Grab!(Circle!(uint[])) is used as a type +fail_compilation/test8556.d(56): Error: template instance test8556.grab!(Circle!(uint[])) error instantiating --- */