Make test for wrong bool type pass

This commit is contained in:
Rasmus Lerchedahl Petersen
2020-05-14 15:56:57 +02:00
parent 7b004c3746
commit 1817d2af2b
2 changed files with 3 additions and 0 deletions

View File

@@ -116,6 +116,8 @@ predicate preferred_raise(string name, ClassObject ex) {
ordering_method(name) and ex = theTypeErrorType()
or
arithmetic_method(name) and ex = Object::builtin("ArithmeticError")
or
name = "__bool__" and ex = theTypeErrorType()
}
predicate no_need_to_raise(string name, string message) {

View File

@@ -1,2 +1,3 @@
| protocols.py:98:5:98:33 | Function __getitem__ | Function always raises $@; raise LookupError instead | file://:Compiled Code:0:0:0:0 | builtin-class ZeroDivisionError | builtin-class ZeroDivisionError |
| protocols.py:101:5:101:26 | Function __getattr__ | Function always raises $@; raise AttributeError instead | file://:Compiled Code:0:0:0:0 | builtin-class ZeroDivisionError | builtin-class ZeroDivisionError |
| protocols.py:124:5:124:23 | Function __bool__ | Function always raises $@; raise TypeError instead | file://:Compiled Code:0:0:0:0 | builtin-class ZeroDivisionError | builtin-class ZeroDivisionError |