diff --git a/pyproject.toml b/pyproject.toml index 14a75b2da..03098b0c2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -91,7 +91,6 @@ disable_error_code = [ "assignment", "attr-defined", "call-overload", - "has-type", "import-not-found", "list-item", "misc", diff --git a/src/arch/z80/optimizer/basicblock.py b/src/arch/z80/optimizer/basicblock.py index 89434760f..5c9320aa5 100644 --- a/src/arch/z80/optimizer/basicblock.py +++ b/src/arch/z80/optimizer/basicblock.py @@ -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 @@ -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 diff --git a/src/arch/z80/peephole/evaluator.py b/src/arch/z80/peephole/evaluator.py index f99f49c90..a78ae3f2c 100644 --- a/src/arch/z80/peephole/evaluator.py +++ b/src/arch/z80/peephole/evaluator.py @@ -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))