Merge pull request #6865 from MathiasVP/fix-if-none

C++/C#/JS/Python: Replace 'if p() then q() else none()' with a conjunction
This commit is contained in:
Mathias Vorreiter Pedersen
2021-10-13 19:47:55 +01:00
committed by GitHub
10 changed files with 36 additions and 44 deletions

View File

@@ -132,12 +132,12 @@ predicate incorrect_special_method_defn(
else
if required < func.minParameters()
then message = "Too many parameters" and show_counts = true
else
if func.minParameters() < required and not func.getScope().hasVarArg()
then
message = (required - func.minParameters()) + " default values(s) will never be used" and
show_counts = false
else none()
else (
func.minParameters() < required and
not func.getScope().hasVarArg() and
message = (required - func.minParameters()) + " default values(s) will never be used" and
show_counts = false
)
)
}