[mypyc] Assertion on untyped property
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 20.6k
- Forks
- 3.3k
- PR merge metrics
- PR metrics pending
Description
Bug Report
If you try and compile code with mypyc that has an untyped return, you'll hit an AssertionError
To Reproduce
Run mypyc on:
class Math:
@property
def learn(self):
return ""
Expected Behavior
At least a helpful message (a la https://github.com/python/mypy/pull/12119)
Actual Behavior
mypyc schoo.py
Traceback (most recent call last):
File "mypyc/irbuild/prepare.py", line 72, in build_type_map
File "mypyc/irbuild/prepare.py", line 192, in prepare_class_def
File "mypyc/irbuild/prepare.py", line 145, in prepare_method_def
school.py:1: AssertionError:
(That's the full output)
Your Environment
(Doesn't matter 😉 )
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
Run mypyc on the reproducer and start in mypyc/irbuild/prepare.py, following the traceback through build_type_map, prepare_class_def, and prepare_method_def. Replace the AssertionError path with a helpful diagnostic for an untyped property return, then verify the reproducer reports that diagnostic instead of crashing.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100