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: crates/ty_python_semantic/resources/mdtest/diagnostics/union_call.md
-1Lines changed: 0 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -103,7 +103,6 @@ def _(n: int):
103
103
# error: [missing-argument]
104
104
# error: [invalid-argument-type] "Argument to function `f4` is incorrect: Argument type `Literal[3]` does not satisfy upper bound of type variable `T`"
105
105
# error: [call-non-callable] "Object of type `Literal[5]` is not callable"
106
-
# error: [no-matching-overload]
107
106
# error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possibly unbound `__call__` method)"
Copy file name to clipboardExpand all lines: crates/ty_python_semantic/resources/mdtest/snapshots/union_call.md_-_Calling_a_union_of_f…_-_Try_to_cover_all_pos…_-_Cover_non-keyword_re…_(707b284610419a54).snap
44 | # error: [invalid-argument-type] "Argument to function `f4` is incorrect: Argument type `Literal[3]` does not satisfy upper bound of type variable `T`"
59
59
45 | # error: [call-non-callable] "Object of type `Literal[5]` is not callable"
60
-
46 | # error: [no-matching-overload]
61
-
47 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
62
-
48 | x = f(3)
60
+
46 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
61
+
47 | x = f(3)
63
62
```
64
63
65
64
# Diagnostics
66
65
67
66
```
68
67
error[call-non-callable]: Object of type `Literal[5]` is not callable
69
-
--> src/mdtest_snippet.py:48:9
68
+
--> src/mdtest_snippet.py:47:9
70
69
|
71
-
46 | # error: [no-matching-overload]
72
-
47 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
73
-
48 | x = f(3)
70
+
45 | # error: [call-non-callable] "Object of type `Literal[5]` is not callable"
71
+
46 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
72
+
47 | x = f(3)
74
73
| ^^^^
75
74
|
76
75
info: Union variant `Literal[5]` is incompatible with this call site
@@ -81,11 +80,11 @@ info: rule `call-non-callable` is enabled by default
81
80
82
81
```
83
82
error[call-non-callable]: Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)
84
-
--> src/mdtest_snippet.py:48:9
83
+
--> src/mdtest_snippet.py:47:9
85
84
|
86
-
46 | # error: [no-matching-overload]
87
-
47 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
88
-
48 | x = f(3)
85
+
45 | # error: [call-non-callable] "Object of type `Literal[5]` is not callable"
86
+
46 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
87
+
47 | x = f(3)
89
88
| ^^^^
90
89
|
91
90
info: Union variant `PossiblyNotCallable` is incompatible with this call site
@@ -96,11 +95,11 @@ info: rule `call-non-callable` is enabled by default
96
95
97
96
```
98
97
error[missing-argument]: No argument provided for required parameter `b` of function `f3`
99
-
--> src/mdtest_snippet.py:48:9
98
+
--> src/mdtest_snippet.py:47:9
100
99
|
101
-
46 | # error: [no-matching-overload]
102
-
47 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
103
-
48 | x = f(3)
100
+
45 | # error: [call-non-callable] "Object of type `Literal[5]` is not callable"
101
+
46 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
102
+
47 | x = f(3)
104
103
| ^^^^
105
104
|
106
105
info: Union variant `def f3(a:int, b:int) -> int` is incompatible with this call site
@@ -109,28 +108,13 @@ info: rule `missing-argument` is enabled by default
109
108
110
109
```
111
110
112
-
```
113
-
error[no-matching-overload]: No overload of method wrapper `__get__` of function `f` matches arguments
114
-
--> src/mdtest_snippet.py:48:9
115
-
|
116
-
46 | # error: [no-matching-overload]
117
-
47 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
118
-
48 | x = f(3)
119
-
| ^^^^
120
-
|
121
-
info: Union variant `<method-wrapper `__get__` of `f`>` is incompatible with this call site
122
-
info: Attempted to call union type `(deff1() -> int) | (deff2(name:str) -> int) | (deff3(a:int, b:int) -> int) | (deff4(x:T) -> int) | Literal[5] | Unknown | (<method-wrapper `__get__` of `f`>) | PossiblyNotCallable`
123
-
info: rule `no-matching-overload` is enabled by default
124
-
125
-
```
126
-
127
111
```
128
112
error[invalid-argument-type]: Argument to function `f2` is incorrect
129
-
--> src/mdtest_snippet.py:48:11
113
+
--> src/mdtest_snippet.py:47:11
130
114
|
131
-
46 | # error: [no-matching-overload]
132
-
47 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
133
-
48 | x = f(3)
115
+
45 | # error: [call-non-callable] "Object of type `Literal[5]` is not callable"
116
+
46 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
117
+
47 | x = f(3)
134
118
| ^ Expected `str`, found `Literal[3]`
135
119
|
136
120
info: Function defined here
@@ -150,11 +134,11 @@ info: rule `invalid-argument-type` is enabled by default
150
134
151
135
```
152
136
error[invalid-argument-type]: Argument to function `f4` is incorrect
153
-
--> src/mdtest_snippet.py:48:11
137
+
--> src/mdtest_snippet.py:47:11
154
138
|
155
-
46 | # error: [no-matching-overload]
156
-
47 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
157
-
48 | x = f(3)
139
+
45 | # error: [call-non-callable] "Object of type `Literal[5]` is not callable"
140
+
46 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
141
+
47 | x = f(3)
158
142
| ^ Argument type `Literal[3]` does not satisfy upper bound of type variable `T`
159
143
|
160
144
info: Type variable defined here
@@ -174,11 +158,11 @@ info: rule `invalid-argument-type` is enabled by default
174
158
175
159
```
176
160
error[too-many-positional-arguments]: Too many positional arguments to function `f1`: expected 0, got 1
177
-
--> src/mdtest_snippet.py:48:11
161
+
--> src/mdtest_snippet.py:47:11
178
162
|
179
-
46 | # error: [no-matching-overload]
180
-
47 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
181
-
48 | x = f(3)
163
+
45 | # error: [call-non-callable] "Object of type `Literal[5]` is not callable"
164
+
46 | # error: [call-non-callable] "Object of type `PossiblyNotCallable` is not callable (possiblyunbound `__call__` method)"
165
+
47 | x = f(3)
182
166
| ^
183
167
|
184
168
info: Union variant `def f1() -> int` is incompatible with this call site
0 commit comments