@@ -202,7 +202,9 @@ def _(factory: type[IntDiag] | type[StrDiag]):
202202## Any non-callable variant
203203
204204``` py
205- def f1 (a : int ): ...
205+ from typing import Any
206+
207+ def f1 (a : int ) -> Any: ...
206208def _ (flag : bool ):
207209 if flag:
208210 f = f1
@@ -211,14 +213,16 @@ def _(flag: bool):
211213
212214 # error: [call-non-callable] "Object of type `Literal["This is a string literal"]` is not callable"
213215 x = f(3 )
214- reveal_type(x) # revealed: Unknown
216+ reveal_type(x) # revealed: Any
215217```
216218
217219## Union of binding errors
218220
219221``` py
220- def f1 (): ...
221- def f2 (): ...
222+ from typing import Any
223+
224+ def f1 () -> Any: ...
225+ def f2 () -> Any: ...
222226def _ (flag : bool ):
223227 if flag:
224228 f = f1
@@ -228,15 +232,17 @@ def _(flag: bool):
228232 # error: [too-many-positional-arguments] "Too many positional arguments to function `f1`: expected 0, got 1"
229233 # error: [too-many-positional-arguments] "Too many positional arguments to function `f2`: expected 0, got 1"
230234 x = f(3 )
231- reveal_type(x) # revealed: Unknown
235+ reveal_type(x) # revealed: Any
232236```
233237
234238## One not-callable, one wrong argument
235239
236240``` py
241+ from typing import Any
242+
237243class C : ...
238244
239- def f1 (): ...
245+ def f1 () -> Any : ...
240246def _ (flag : bool ):
241247 if flag:
242248 f = f1
@@ -246,7 +252,7 @@ def _(flag: bool):
246252 # error: [too-many-positional-arguments] "Too many positional arguments to function `f1`: expected 0, got 1"
247253 # error: [call-non-callable] "Object of type `C` is not callable"
248254 x = f(3 )
249- reveal_type(x) # revealed: Unknown
255+ reveal_type(x) # revealed: Any
250256```
251257
252258## Union including a special-cased function
0 commit comments