Closed
Description
The following program fails to typecheck with mypy 1.27:
from openpulse.ast import CalibrationDefinition, CalibrationStatement
def foo(stmt: CalibrationDefinition):
stmt.body = []
The mypy
error is
mypy example.py
example.py:4: error: Incompatible types in assignment (expression has type "list[Never]", variable has type "str") [assignment]
Found 1 error in 1 file (checked 1 source file)
The variable has type "str"
comes from the openqasm3.ast.CalibrationDefinition
, which does use str
for the body
field.
Metadata
Metadata
Assignees
Labels
No labels