DScanner: check for useless asserts

This commit is contained in:
Sebastian Wilzbach 2017-02-20 15:10:09 +01:00
parent 395ae88ac7
commit 1552ed5e18
2 changed files with 3 additions and 3 deletions

View file

@ -417,7 +417,7 @@ auto castSwitch(choices...)(Object switchObject)
// Void handlers are also allowed if all the handlers are void:
new A().castSwitch!(
(A a) { assert(true); },
(A a) { },
(B b) { assert(false); },
)();
}
@ -485,7 +485,7 @@ auto castSwitch(choices...)(Object switchObject)
// All-void handlers work for the null case:
null.castSwitch!(
(Object o) { assert(false); },
() { assert(true); },
() { },
)();
// Throwing void handlers work for the null case: