mirror of
https://github.com/dlang/phobos.git
synced 2025-04-30 23:20:29 +03:00
DScanner: check for useless asserts
This commit is contained in:
parent
395ae88ac7
commit
1552ed5e18
2 changed files with 3 additions and 3 deletions
|
@ -63,7 +63,7 @@ auto_ref_assignment_check="disabled" ; FIXME
|
|||
; Checks for incorrect infinite range definitions
|
||||
incorrect_infinite_range_check="enabled"
|
||||
; Checks for asserts that are always true
|
||||
useless_assert_check="skip-unittest"
|
||||
useless_assert_check="enabled"
|
||||
; Check for uses of the old-style alias syntax
|
||||
alias_syntax_check="enabled"
|
||||
; Checks for else if that should be else static if
|
||||
|
|
|
@ -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:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue