forked from python/typing
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconstructors_callable.toml
More file actions
49 lines (49 loc) · 4.22 KB
/
constructors_callable.toml
File metadata and controls
49 lines (49 loc) · 4.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
conformant = "Partial"
notes = """
Does not generate a union type for __new__ and __init__ when converting class to callable.
Does not ignore __init__ based on __new__ return type when converting class to callable.
Does not support __new__ return type that is different from class being constructed.
"""
conformance_automated = "Fail"
errors_diff = """
Line 129: Expected 1 errors
Line 146: Expected 1 errors
Line 74: Unexpected errors ['constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]']
Line 80: Unexpected errors ['constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type]']
Line 102: Unexpected errors ['constructors_callable.py:102: error: Expression is of type "Class5", not "Never" [assert-type]']
Line 107: Unexpected errors ['constructors_callable.py:107: error: Expression is of type "Class5", not "Never" [assert-type]']
Line 118: Unexpected errors ['constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]']
Line 128: Unexpected errors ['constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]', 'constructors_callable.py:128: error: Too few arguments [call-arg]']
Line 145: Unexpected errors ['constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [assert-type]', 'constructors_callable.py:145: error: Too few arguments [call-arg]']
"""
output = """
constructors_callable.py:36: note: Revealed type is "def (x: int) -> constructors_callable.Class1"
constructors_callable.py:38: error: Too few arguments [call-arg]
constructors_callable.py:39: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:49: note: Revealed type is "def () -> constructors_callable.Class2"
constructors_callable.py:51: error: Too many arguments [call-arg]
constructors_callable.py:64: note: Revealed type is "def (x: int) -> constructors_callable.Class3"
constructors_callable.py:66: error: Too few arguments [call-arg]
constructors_callable.py:67: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:68: error: Too many arguments [call-arg]
constructors_callable.py:74: error: Incompatible return type for "__new__" (returns "int", but must return a subtype of "Class4") [misc]
constructors_callable.py:79: note: Revealed type is "def (x: int) -> constructors_callable.Class4"
constructors_callable.py:80: error: Expression is of type "Class4", not "int" [assert-type]
constructors_callable.py:81: error: Too few arguments [call-arg]
constructors_callable.py:82: error: Unexpected keyword argument "y" [call-arg]
constructors_callable.py:99: note: Revealed type is "def (*args: Any, **kwargs: Any) -> constructors_callable.Class5"
constructors_callable.py:102: error: Expression is of type "Class5", not "Never" [assert-type]
constructors_callable.py:107: error: Expression is of type "Class5", not "Never" [assert-type]
constructors_callable.py:118: error: Incompatible return type for "__new__" (returns "Class6Proxy", but must return a subtype of "Class6") [misc]
constructors_callable.py:127: note: Revealed type is "def (x: int) -> constructors_callable.Class6"
constructors_callable.py:128: error: Expression is of type "Class6", not "Class6Proxy" [assert-type]
constructors_callable.py:128: error: Too few arguments [call-arg]
constructors_callable.py:144: note: Revealed type is "def (x: int) -> constructors_callable.Class6Any"
constructors_callable.py:145: error: Expression is of type "Class6Any", not "Any" [assert-type]
constructors_callable.py:145: error: Too few arguments [call-arg]
constructors_callable.py:164: note: Revealed type is "Overload(def (x: int) -> constructors_callable.Class7[int], def (x: str) -> constructors_callable.Class7[str])"
constructors_callable.py:184: note: Revealed type is "def [T] (x: list[T], y: list[T]) -> constructors_callable.Class8[T]"
constructors_callable.py:186: error: Cannot infer function type argument [misc]
constructors_callable.py:195: note: Revealed type is "def [T] (x: list[T], y: list[T]) -> constructors_callable.Class9"
constructors_callable.py:197: error: Cannot infer function type argument [misc]
"""