classes icon indicating copy to clipboard operation
classes copied to clipboard

Crash: lookup of unknown name

Open sobolevn opened this issue 4 years ago • 1 comments

Screen shot sent by our user: 2021-11-26 14 15 24

Repro: https://github.com/ftaebi/demo

sobolevn avatar Nov 26 '21 11:11 sobolevn

I am getting this error as well on the following line of my project: https://github.com/ruancomelli/boiling-learning/blob/main/boiling_learning/describe/describers.py#L36.

I was able to simplify that file as

from classes import typeclass

@typeclass
def describe(instance: str) -> str:
    '''Return a JSON description of an object.'''

@describe.instance(str)  # Internal error: attempted lookup of unknown name  [misc]
def _describe_basics(instance: str) -> str:
    return instance

and the error still persists:

$ mypy boiling_learning/describe/describers.py
boiling_learning/describe/describers.py:9: error: Internal error: attempted lookup of unknown name  [misc]
Found 1 error in 1 file (checked 1 source file)

Tested with mypy==0.971 and classes==0.4.1 on Ubuntu 20.04 with Python 3.9.14.

The problem probably has something to do with my project (either a configuration or another Python file), because I could NOT reproduce it by creating a draft project containing only that offending file.

ruancomelli avatar Sep 16 '22 01:09 ruancomelli