Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

visit_lambda_expr list index out of range #17215

Open
tilaks opened this issue May 4, 2024 · 0 comments
Open

visit_lambda_expr list index out of range #17215

tilaks opened this issue May 4, 2024 · 0 comments
Labels

Comments

@tilaks
Copy link

tilaks commented May 4, 2024

Traceback

Traceback (most recent call last):                                                                                                                                                                                                                   
  File "/Users/tilak/.pyenv/versions/venv-3.10/bin/mypy", line 8, in <module>                                                                                                                                                                        
    sys.exit(console_entry())                                                                                                                                                                                                                        
  File "/Users/tilak/.pyenv/versions/venv-3.10/lib/python3.10/site-packages/mypy/__main__.py", line 15, in console_entry                                                                                                                             
    main()                                                                                                                                                                                                                                           
  File "mypy/main.py", line 100, in main                                                                                                                                                                                                             
  File "mypy/main.py", line 182, in run_build                                                                                                                                                                                                        
  File "mypy/build.py", line 192, in build                                                                                                                                                                                                           
  File "mypy/build.py", line 266, in _build                                                                                                                                                                                                          
  File "mypy/build.py", line 2942, in dispatch                                                                                                                                                                                                       
  File "mypy/build.py", line 3333, in process_graph                                                                                                                                                                                                  
  File "mypy/build.py", line 3414, in process_fresh_modules                                                                                                                                                                                          
  File "mypy/build.py", line 2110, in fix_cross_refs                                                                                                                                                                                                 
  File "mypy/fixup.py", line 52, in fixup_module                                                                                                                                                                                                     
  File "mypy/fixup.py", line 158, in visit_symbol_table                                                                                                                                                                                              
  File "mypy/nodes.py", line 1037, in accept                                                                                                                                                                                                         
  File "mypy/fixup.py", line 211, in visit_var                                                                                                                                                                                                       
  File "mypy/types.py", line 1435, in accept                                                                                                                                                                                                         
  File "mypy/fixup.py", line 230, in visit_instance                                                                                                                                                                                                  
  File "mypy/fixup.py", line 371, in lookup_fully_qualified_typeinfo                                                                                                                                                                                 
AssertionError: Should never get here in normal mode, got TypeAlias:threading.local instead of TypeInfo 
<path redacted>.py:-1: error: INTERNAL ERROR -- Please try using mypy master on GitHub:
https://mypy.readthedocs.io/en/stable/common_issues.html#using-a-development-mypy-build
Please report a bug at https://github.com/python/mypy/issues
version: 1.9.0
Traceback (most recent call last):
  File "mypy/checkexpr.py", line 5742, in accept
  File "mypy/nodes.py", line 2213, in accept
  File "mypy/checkexpr.py", line 5217, in visit_lambda_expr
  File "mypy/nodes.py", line 2206, in expr
IndexError: list index out of range
<redacted>.py:-1: : note: use --pdb to drop into pdb

To Reproduce

I'm unable to share the source code, but the errors above occur alternately when commenting out a type definition,
objects: list[CustomType] = [] vs. objects: list[CustomType] = [].

Your Environment

  • Mypy version used: 1.9.0
  • Mypy command-line flags: --install-types --non-interactive --show-traceback
  • Mypy configuration options from mypy.ini (and other config files):
  • Python version used: 3.10.9
  • Operating system and version: MacOS Sonoma 14.4.1
@tilaks tilaks added the crash label May 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant