Skip to content

Commit 027f79b

Browse files
committed
Fix issues caused by rebase
1 parent 23ca75b commit 027f79b

File tree

7 files changed

+12
-24
lines changed

7 files changed

+12
-24
lines changed

mypy/semanal.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,6 @@
7878
NoneTyp, CallableType, Overloaded, Instance, Type, TypeVarType, AnyType,
7979
FunctionLike, UnboundType, TypeList, TypeVarDef, TypeType,
8080
TupleType, UnionType, StarType, EllipsisType, function_type, TypedDictType,
81-
Void,
8281
)
8382
from mypy.nodes import implicit_module_attrs
8483
from mypy.typeanal import (
@@ -469,7 +468,7 @@ def find_type_variables_in_type(self, type: Type) -> List[Tuple[str, TypeVarExpr
469468
result.extend(self.find_type_variables_in_type(item))
470469
elif isinstance(type, AnyType):
471470
pass
472-
elif isinstance(type, (EllipsisType, TupleType, Void)):
471+
elif isinstance(type, (EllipsisType, TupleType)):
473472
# TODO: Need to process tuple items?
474473
pass
475474
elif isinstance(type, Instance):
@@ -719,9 +718,8 @@ def analyze_class_body(self, defn: ClassDef) -> Iterator[bool]:
719718
if self.analyze_namedtuple_classdef(defn):
720719
# just analyze the class body so we catch type errors in default values
721720
self.enter_class(defn)
722-
yield False
721+
yield True
723722
self.leave_class()
724-
return
725723
else:
726724
self.setup_class_def_analysis(defn)
727725

mypy/server/astdiff.py

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from mypy.nodes import SymbolTable, SymbolTableNode, FuncBase, TypeInfo, Var
1313
from mypy.types import (
14-
Type, TypeVisitor, UnboundType, ErrorType, TypeList, AnyType, Void, NoneTyp, UninhabitedType,
14+
Type, TypeVisitor, UnboundType, TypeList, AnyType, NoneTyp, UninhabitedType,
1515
ErasedType, DeletedType, Instance, TypeVarType, CallableType, TupleType, TypedDictType,
1616
UnionType, Overloaded, PartialType, TypeType
1717
)
@@ -137,18 +137,12 @@ def __init__(self, right: Type) -> None:
137137
def visit_unbound_type(self, left: UnboundType) -> bool:
138138
return False
139139

140-
def visit_error_type(self, left: ErrorType) -> bool:
141-
return False
142-
143140
def visit_type_list(self, t: TypeList) -> bool:
144141
assert False, 'Not supported'
145142

146143
def visit_any(self, left: AnyType) -> bool:
147144
return isinstance(self.right, AnyType)
148145

149-
def visit_void(self, left: Void) -> bool:
150-
return isinstance(self.right, Void)
151-
152146
def visit_none_type(self, left: NoneTyp) -> bool:
153147
return isinstance(self.right, NoneTyp)
154148

mypy/server/astmerge.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
from mypy.types import (
1414
Type, TypeVisitor, Instance, AnyType, NoneTyp, CallableType, DeletedType, PartialType,
1515
TupleType, TypeType, TypeVarType, TypedDictType, UnboundType, UninhabitedType, UnionType,
16-
Void, Overloaded
16+
Overloaded
1717
)
1818

1919

@@ -195,9 +195,6 @@ def visit_uninhabited_type(self, typ: UninhabitedType) -> None:
195195
def visit_union_type(self, typ: UnionType) -> None:
196196
raise NotImplementedError
197197

198-
def visit_void(self, typ: Void) -> None:
199-
pass
200-
201198
# Helpers
202199

203200
def fixup(self, node: SN) -> SN:

mypy/server/deps.py

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
from mypy.types import (
1212
Type, Instance, AnyType, NoneTyp, TypeVisitor, CallableType, DeletedType, PartialType,
1313
TupleType, TypeType, TypeVarType, TypedDictType, UnboundType, UninhabitedType, UnionType,
14-
Void, FunctionLike
14+
FunctionLike
1515
)
1616
from mypy.server.trigger import make_trigger
1717

@@ -224,9 +224,6 @@ def visit_uninhabited_type(self, typ: UninhabitedType) -> List[str]:
224224
def visit_union_type(self, typ: UnionType) -> List[str]:
225225
raise NotImplementedError
226226

227-
def visit_void(self, typ: Void) -> List[str]:
228-
return []
229-
230227

231228
def non_trivial_bases(info: TypeInfo) -> List[TypeInfo]:
232229
return [base for base in info.mro[1:]

mypy/server/subexpr.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from mypy.nodes import (
66
Expression, Node, MemberExpr, YieldFromExpr, YieldExpr, CallExpr, OpExpr, ComparisonExpr,
77
SliceExpr, CastExpr, RevealTypeExpr, UnaryExpr, ListExpr, TupleExpr, DictExpr, SetExpr,
8-
IndexExpr, GeneratorExpr, ListComprehension, ConditionalExpr, TypeApplication, FuncExpr,
8+
IndexExpr, GeneratorExpr, ListComprehension, ConditionalExpr, TypeApplication, LambdaExpr,
99
StarExpr, BackquoteExpr, AwaitExpr
1010
)
1111
from mypy.traverser import TraverserVisitor
@@ -116,7 +116,7 @@ def visit_type_application(self, e: TypeApplication) -> None:
116116
self.add(e)
117117
super().visit_type_application(e)
118118

119-
def visit_func_expr(self, e: FuncExpr) -> None:
119+
def visit_lambda_expr(self, e: LambdaExpr) -> None:
120120
self.add(e)
121121
super().visit_func_expr(e)
122122

mypy/test/testmerge.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -191,6 +191,8 @@ def dump_types(self, graph: Dict[str, State]) -> List[str]:
191191
# To make the results repeatable, we try to generate unique and
192192
# deterministic sort keys.
193193
for module_id in sorted(graph):
194+
if module_id == 'builtins':
195+
continue
194196
type_map = graph[module_id].type_checker.type_map
195197
if type_map:
196198
a.append('## {}'.format(module_id))

test-data/unit/fine-grained.test

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ main:3: error: "module" has no attribute "g"
383383
[case testAddBaseClassMethodCausingInvalidOverride]
384384
import m
385385
class B(m.A):
386-
def f(self) -> None: pass
386+
def f(self) -> str: pass
387387
[file m.py]
388388
class A: pass
389389
[file m.py.2]
@@ -396,10 +396,10 @@ main:3: error: Return type of "f" incompatible with supertype "A"
396396
[case testModifyBaseClassMethodCausingInvalidOverride]
397397
import m
398398
class B(m.A):
399-
def f(self) -> None: pass
399+
def f(self) -> str: pass
400400
[file m.py]
401401
class A:
402-
def f(self) -> None: pass
402+
def f(self) -> str: pass
403403
[file m.py.2]
404404
class A:
405405
def f(self) -> int: pass

0 commit comments

Comments
 (0)