File tree Expand file tree Collapse file tree 1 file changed +6
-23
lines changed Expand file tree Collapse file tree 1 file changed +6
-23
lines changed Original file line number Diff line number Diff line change @@ -119,32 +119,15 @@ x = f() # E: Function does not return a value
119
119
def f(x: None) -> None: pass
120
120
f(None)
121
121
122
- [case testInferOptionalFromDefaultNone]
123
- def f(x: int = None) -> None:
124
- x + 1 # E: Unsupported left operand type for + (some union)
125
- f(None)
126
- [out]
127
-
128
- [case testInferOptionalFromDefaultNoneWithFastParser]
129
-
130
- def f(x: int = None) -> None:
131
- x + 1 # E: Unsupported left operand type for + (some union)
132
- f(None)
133
- [out]
134
-
135
- [case testInferOptionalFromDefaultNoneComment]
136
- def f(x=None):
137
- # type: (int) -> None
138
- x + 1 # E: Unsupported left operand type for + (some union)
139
- f(None)
122
+ [case testNoInferOptionalFromDefaultNone]
123
+ def f(x: int = None) -> None: # E: Incompatible types in assignment (expression has type None, variable has type "int")
124
+ pass
140
125
[out]
141
126
142
- [case testInferOptionalFromDefaultNoneCommentWithFastParser]
143
-
144
- def f(x=None):
127
+ [case testNoInferOptionalFromDefaultNoneComment]
128
+ def f(x=None): # E: Incompatible types in assignment (expression has type None, variable has type "int")
145
129
# type: (int) -> None
146
- x + 1 # E: Unsupported left operand type for + (some union)
147
- f(None)
130
+ pass
148
131
[out]
149
132
150
133
[case testInferOptionalType]
You can’t perform that action at this time.
0 commit comments