Skip to content

Invalid "unused 'type ignore' comment" messages #4288

@JukkaL

Description

@JukkaL

I've seen invalid complaints about unused 'type ignore' comments recently in incremental mode. Here's an example:

$ mypy --config-file mypy_self_check.ini -i mypy scripts/finegrained.py
mypy/server/update.py:188: error: Need more than 3 values to unpack (5 expected)
mypy/server/update.py:195: error: Argument 2 to "calculate_active_triggers" has incompatible type "Dict[str, Optional[Dict[str, Tuple[object, ...]]]]"; expected "Dict[str, Dict[str, Tuple[object, ...]]]"
mypy/test/testmerge.py:82: error: "FineGrainedBuildManager" has no attribute "graph"
mypy/test/testmerge.py:88: error: "FineGrainedBuildManager" has no attribute "graph"
mypy/test/testmerge.py:123: error: "FineGrainedBuildManager" has no attribute "graph"
mypy/test/data.py:10: note: unused 'type: ignore' comment
mypy/report.py:28: note: unused 'type: ignore' comment
mypy/test/testreports.py:7: note: unused 'type: ignore' comment

The comments disappeared on the next incremental run. I hadn't touched the files where the messages came from.

I don't have a repro yet -- I'm creating the issue so that I won't lose track of it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions