Errors from new parser can be worse (compared to old parser)
Open
Nobody has claimed this yet.
bug
topic-parser
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
This is a follow-up for https://github.com/python/mypy/pull/21823. Most notably something like this causes two errors with different error codes:
x = 0 # type: x y # E: Syntax error in type comment "x y" [syntax] \
# E: Invalid type comment or annotation [valid-type]
Potentially we may want to add some filtering logic to improve/simplify syntax errors.
cc @JukkaL
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reviewing pull request 21823 and reproducing the type-comment example shown here. Trace how the new parser reports its syntax and validity errors, then determine how diagnostics can be filtered or simplified so the result is not duplicated or contradictory; the issue does not specify an exact final message.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 48/100