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: conformance/results/pycroscope/constructors_callable.toml
+5-3Lines changed: 5 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -21,7 +21,9 @@ output = """
21
21
./constructors_callable.py:146:0: Takes 0 positional arguments but 1 were given [incompatible_call]
22
22
./constructors_callable.py:164:4: Revealed type is '(x: ~_Ctor_Class7_T) -> ./constructors_callable.py.Class7[~_Ctor_Class7_T]' [reveal_type]
23
23
./constructors_callable.py:184:12: Revealed type is '(x: list[~T@./constructors_callable.py.Class8], y: list[~T@./constructors_callable.py.Class8]) -> ./constructors_callable.py.Class8[~T@./constructors_callable.py.Class8]' [reveal_type]
24
-
./constructors_callable.py:186:0: Cannot resolve type variables [incompatible_call]
25
-
./constructors_callable.py:195:12: Revealed type is '(x: list[~T@./constructors_callable.py.Class9.__init__.<locals>.__init__], y: list[~T@./constructors_callable.py.Class9.__init__.<locals>.__init__]) -> ./constructors_callable.py.Class9' [reveal_type]
26
-
./constructors_callable.py:197:0: Cannot resolve type variables [incompatible_call]
24
+
./constructors_callable.py:185:9: Incompatible argument type for y: expected list[~T@./constructors_callable.py.Class8] but got Literal['not a list'] [incompatible_argument]
25
+
./constructors_callable.py:187:0: Cannot resolve type variables [incompatible_call]
26
+
./constructors_callable.py:196:12: Revealed type is '(x: list[~T@./constructors_callable.py.Class9.__init__.<locals>.__init__], y: list[~T@./constructors_callable.py.Class9.__init__.<locals>.__init__]) -> ./constructors_callable.py.Class9' [reveal_type]
27
+
./constructors_callable.py:197:9: Incompatible argument type for y: expected list[~T@./constructors_callable.py.Class9.__init__.<locals>.__init__] but got Literal['not a list'] [incompatible_argument]
28
+
./constructors_callable.py:199:0: Cannot resolve type variables [incompatible_call]
./generics_basic.py:223:21: Incompatible argument type for y: expected list[~T@./generics_basic.py.takes_two_lists.<locals>.takes_two_lists] but got Literal['not a list'] [incompatible_argument]
19
+
./generics_basic.py:225:0: Cannot resolve type variables [incompatible_call]
20
+
./generics_basic.py:232:4: Cannot resolve type variables [incompatible_call]
21
+
./generics_basic.py:240:25: Incompatible argument type for y: expected list[~T_int@./generics_basic.py.takes_two_int_lists.<locals>.takes_two_int_lists] but got Literal['not a list'] [incompatible_argument]
22
+
./generics_basic.py:241:25: Incompatible argument type for y: expected list[~T_int@./generics_basic.py.takes_two_int_lists.<locals>.takes_two_int_lists] but got Literal[['']] [incompatible_argument]
23
+
./generics_basic.py:251:4: Cannot resolve type variables [incompatible_call]
ERROR constructors_callable.py:197:9-13: Argument `list[str]` is not assignable to parameter `y` with type `list[int]` [bad-argument-type]
23
+
ERROR constructors_callable.py:185:10-22: Argument `Literal['not a list']` is not assignable to parameter `y` with type `list[Unknown]` [bad-argument-type]
ERROR constructors_callable.py:197:10-22: Argument `Literal['not a list']` is not assignable to parameter `y` with type `list[str]` [bad-argument-type]
26
+
ERROR constructors_callable.py:199:9-13: Argument `list[str]` is not assignable to parameter `y` with type `list[int]` [bad-argument-type]
Copy file name to clipboardExpand all lines: conformance/results/pyrefly/generics_basic.toml
+7Lines changed: 7 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -15,4 +15,11 @@ ERROR generics_basic.py:163:7-11: Expected a type variable, got `int` [invalid-t
15
15
ERROR generics_basic.py:171:7-11: Class `Bad3` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var]
16
16
ERROR generics_basic.py:172:7-11: Class `Bad4` uses type variables not specified in `Generic` or `Protocol` base [invalid-type-var]
17
17
ERROR generics_basic.py:208:7-26: Metaclass may not be an unbound generic [invalid-inheritance]
18
+
ERROR generics_basic.py:223:22-34: Argument `Literal['not a list']` is not assignable to parameter `y` with type `list[int]` in function `takes_two_lists` [bad-argument-type]
19
+
ERROR generics_basic.py:225:22-26: Argument `list[str]` is not assignable to parameter `y` with type `list[int]` in function `takes_two_lists` [bad-argument-type]
20
+
ERROR generics_basic.py:232:24-25: Argument `list[str]` is not assignable to parameter `y` with type `list[int]` in function `takes_two_lists` [bad-argument-type]
21
+
ERROR generics_basic.py:240:26-38: Argument `Literal['not a list']` is not assignable to parameter `y` with type `list[int]` in function `takes_two_int_lists` [bad-argument-type]
22
+
ERROR generics_basic.py:241:20-31: `str` is not assignable to upper bound `int` of type variable `T_int` [bad-specialization]
23
+
ERROR generics_basic.py:241:26-30: Argument `list[str]` is not assignable to parameter `y` with type `list[int]` in function `takes_two_int_lists` [bad-argument-type]
24
+
ERROR generics_basic.py:251:28-29: Argument `list[bool]` is not assignable to parameter `y` with type `list[int]` in function `takes_two_int_lists` [bad-argument-type]
Copy file name to clipboardExpand all lines: conformance/results/pyright/generics_basic.toml
+16Lines changed: 16 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -20,6 +20,22 @@ generics_basic.py:171:7 - error: Generic[] or Protocol[] must include all type v
20
20
generics_basic.py:172:7 - error: Generic[] or Protocol[] must include all type variables
21
21
Missing type variables: "T_co" (reportGeneralTypeIssues)
22
22
generics_basic.py:208:37 - error: Metaclass cannot be generic (reportGeneralTypeIssues)
23
+
generics_basic.py:223:22 - error: Argument of type "Literal['not a list']" cannot be assigned to parameter "y" of type "list[T@takes_two_lists]" in function "takes_two_lists"
24
+
"Literal['not a list']" is not assignable to "list[int]" (reportArgumentType)
25
+
generics_basic.py:225:23 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@takes_two_lists]" in function "takes_two_lists"
26
+
"Literal['']" is not assignable to "int" (reportArgumentType)
27
+
generics_basic.py:232:24 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T@takes_two_lists]" in function "takes_two_lists"
28
+
"list[str]" is not assignable to "list[int]"
29
+
Type parameter "_T@list" is invariant, but "str" is not the same as "int"
30
+
Consider switching from "list" to "Sequence" which is covariant (reportArgumentType)
31
+
generics_basic.py:240:26 - error: Argument of type "Literal['not a list']" cannot be assigned to parameter "y" of type "list[T_int@takes_two_int_lists]" in function "takes_two_int_lists"
32
+
"Literal['not a list']" is not assignable to "list[int]" (reportArgumentType)
33
+
generics_basic.py:241:27 - error: Argument of type "list[str]" cannot be assigned to parameter "y" of type "list[T_int@takes_two_int_lists]" in function "takes_two_int_lists"
34
+
"Literal['']" is not assignable to "int" (reportArgumentType)
35
+
generics_basic.py:251:28 - error: Argument of type "list[bool]" cannot be assigned to parameter "y" of type "list[T_int@takes_two_int_lists]" in function "takes_two_int_lists"
36
+
"list[bool]" is not assignable to "list[int]"
37
+
Type parameter "_T@list" is invariant, but "bool" is not the same as "int"
38
+
Consider switching from "list" to "Sequence" which is covariant (reportArgumentType)
Copy file name to clipboardExpand all lines: conformance/results/ty/generics_basic.toml
+10Lines changed: 10 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -19,4 +19,14 @@ generics_basic.py:163:12: error[invalid-argument-type] `<class 'int'>` is not a
19
19
generics_basic.py:171:1: error[invalid-generic-class] `Generic` base class must include all type variables used in other base classes
20
20
generics_basic.py:172:1: error[invalid-generic-class] `Generic` base class must include all type variables used in other base classes
21
21
generics_basic.py:208:27: error[invalid-metaclass] Generic metaclasses are not supported
22
+
generics_basic.py:223:22: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int]`, found `Literal["not a list"]`
23
+
generics_basic.py:225:17: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int | str]`, found `list[int]`
24
+
generics_basic.py:225:22: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int | str]`, found `list[str]`
25
+
generics_basic.py:232:21: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int | str]`, found `list[int]`
26
+
generics_basic.py:232:24: error[invalid-argument-type] Argument to function `takes_two_lists` is incorrect: Expected `list[int | str]`, found `list[str]`
27
+
generics_basic.py:240:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Expected `list[int]`, found `Literal["not a list"]`
28
+
generics_basic.py:241:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Argument type `str` does not satisfy upper bound `int` of type variable `T_int`
29
+
generics_basic.py:241:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Expected `list[int]`, found `list[str]`
30
+
generics_basic.py:244:26: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Expected `list[int]`, found `list[bool]`
31
+
generics_basic.py:251:28: error[invalid-argument-type] Argument to function `takes_two_int_lists` is incorrect: Expected `list[int]`, found `list[bool]`
0 commit comments