You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test-data/unit/check-errorcodes.test
+7-7Lines changed: 7 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -440,7 +440,7 @@ class D(Generic[S]): pass
440
440
class E(Generic[S, T]): pass
441
441
442
442
x: C[object] # E: Value of type variable "T" of "C" cannot be "object" [type-var]
443
-
y: D[int] # E: Type argument "builtins.int" of "D" must be a subtype of "builtins.str" [type-var]
443
+
y: D[int] # E: Type argument "int" of "D" must be a subtype of "str" [type-var]
444
444
z: D[int, int] # E: "D" expects 1 type argument, but 2 given [type-arg]
445
445
446
446
def h(a: TT, s: S) -> None:
@@ -854,7 +854,7 @@ class Foo:
854
854
pass
855
855
856
856
foo = Foo()
857
-
if foo: # E: "__main__.foo" has type "__main__.Foo" which does not implement __bool__ or __len__ so it could always be true in boolean context [truthy-bool]
857
+
if foo: # E: "__main__.foo" has type "Foo" which does not implement __bool__ or __len__ so it could always be true in boolean context [truthy-bool]
858
858
pass
859
859
860
860
zero = 0
@@ -880,18 +880,18 @@ if not good_union:
880
880
pass
881
881
882
882
bad_union: Union[Foo, object] = Foo()
883
-
if bad_union: # E: "__main__.bad_union" has type "Union[__main__.Foo, builtins.object]" of which no members implement __bool__ or __len__ so it could always be true in boolean context [truthy-bool]
883
+
if bad_union: # E: "__main__.bad_union" has type "Union[Foo, object]" of which no members implement __bool__ or __len__ so it could always be true in boolean context [truthy-bool]
884
884
pass
885
-
if not bad_union: # E: "__main__.bad_union" has type "builtins.object" which does not implement __bool__ or __len__ so it could always be true in boolean context [truthy-bool]
885
+
if not bad_union: # E: "__main__.bad_union" has type "object" which does not implement __bool__ or __len__ so it could always be true in boolean context [truthy-bool]
886
886
pass
887
887
888
888
def f():
889
889
pass
890
-
if f: # E: Function "def () -> Any" could always be true in boolean context [truthy-bool]
890
+
if f: # E: Function "Callable[[], Any]" could always be true in boolean context [truthy-bool]
891
891
pass
892
-
if not f: # E: Function "def () -> Any" could always be true in boolean context [truthy-bool]
892
+
if not f: # E: Function "Callable[[], Any]" could always be true in boolean context [truthy-bool]
893
893
pass
894
-
conditional_result = 'foo' if f else 'bar' # E: Function "def () -> Any" could always be true in boolean context [truthy-bool]
894
+
conditional_result = 'foo' if f else 'bar' # E: Function "Callable[[], Any]" could always be true in boolean context [truthy-bool]
0 commit comments