Skip to content

Commit a0621b7

Browse files
committed
fix(ci): satisfy mypy for drop-glue reachability
1 parent 3615030 commit a0621b7

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

kmir/src/kmir/kompile.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -487,7 +487,10 @@ def get_int_arg(app: KInner) -> int:
487487

488488
type_equations = _make_stratified_rules(kmir, 'lookupTy', 'Ty', 'TypeInfo', 'ty', type_assocs, invalid_type)
489489

490-
drop_function_assocs = [(int(ty), KApply('ty', (intToken(int(drop_ty)),))) for ty, drop_ty in smir_info.drop_function_tys.items()]
490+
drop_function_assocs: list[tuple[int, KInner]]
491+
drop_function_assocs = [
492+
(int(ty), KApply('ty', (intToken(int(drop_ty)),))) for ty, drop_ty in smir_info.drop_function_tys.items()
493+
]
491494
drop_function_equations = _make_stratified_rules(
492495
kmir,
493496
'lookupDropFunctionTy',

kmir/src/kmir/smir.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,8 +304,9 @@ def _place_ty(self, body: dict, place: dict) -> Ty | None:
304304
if not (0 <= local < len(locals_)):
305305
return None
306306

307-
current_ty = Ty(locals_[local]['ty'])
307+
current_ty: Ty | None = Ty(locals_[local]['ty'])
308308
for projection in place.get('projection', []):
309+
assert current_ty is not None
309310
current_ty = self._projected_ty(current_ty, projection)
310311
if current_ty is None:
311312
return None

0 commit comments

Comments
 (0)