Skip to content

Commit

Permalink
Merge pull request #848 from bartsanchez/bart/fix-has-type-mypy
Browse files Browse the repository at this point in the history
fix: mypy "has-type" check
  • Loading branch information
boriel authored Oct 28, 2024
2 parents df19693 + a1fb678 commit 24fee37
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
1 change: 0 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,6 @@ disable_error_code = [
"assignment",
"attr-defined",
"call-overload",
"has-type",
"import-not-found",
"list-item",
"misc",
Expand Down
4 changes: 4 additions & 0 deletions src/arch/z80/optimizer/basicblock.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
from src.api.utils import flatten_list, sfirst
from src.arch.z80.backend.common import ASMS
from src.arch.z80.peephole import evaluator
from src.arch.z80.peephole.engine import OptPattern
from src.arch.z80.peephole.evaluator import FN

from .cpustate import CPUState
Expand Down Expand Up @@ -427,6 +428,9 @@ def optimize(self, patterns_list):
"""Tries to detect peep-hole patterns in this basic block
and remove them.
"""
i: int
p: OptPattern

if self.optimized:
return

Expand Down
2 changes: 1 addition & 1 deletion src/arch/z80/peephole/evaluator.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class Number:

def __init__(self, value):
if isinstance(value, Number):
self.value = value.value
self.value: int | None = value.value
return
self.value = utils.parse_int(str(value))

Expand Down

0 comments on commit 24fee37

Please sign in to comment.