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

thread 'pylyzer' panicked at crates/py2erg/convert.rs:1175:55: removal index (is 0) should be < len (is 0) #119

Open
copdips opened this issue Dec 27, 2024 · 0 comments

Comments

@copdips
Copy link

copdips commented Dec 27, 2024

Describe the bug
I enabled venv, and both pylyzer and pytest packages are installed in the venv.

Reproducible Code

file demo_pytest.py:

import pytest

check by pylyzer:

12:17 $ RUST_BACKTRACE=1 pylyzer demo_pytest.py
Start checking: demo_pytest.py
thread 'pylyzer' panicked at crates/py2erg/convert.rs:1175:55:
removal index (is 0) should be < len (is 0)
stack backtrace:
   0: rust_begin_unwind
   1: core::panicking::panic_fmt
   2: alloc::vec::Vec<T,A>::remove::assert_failed
   3: py2erg::convert::ASTConverter::convert_const_expr
   4: py2erg::convert::ASTConverter::convert_expr_to_const
   5: py2erg::convert::ASTConverter::convert_compound_type_spec
   6: py2erg::convert::ASTConverter::convert_type_spec
   7: py2erg::convert::ASTConverter::convert_statement
   8: py2erg::convert::ASTConverter::convert_block
   9: py2erg::convert::ASTConverter::convert_funcdef
  10: py2erg::convert::ASTConverter::convert_statement
  11: alloc::vec::in_place_collect::<impl alloc::vec::spec_from_iter::SpecFromIter<T,I> for alloc::vec::Vec<T>>::from_iter
  12: py2erg::convert::ASTConverter::convert_program
  13: <pylyzer_core::analyze::SimplePythonParser as erg_parser::build_ast::ASTBuildable>::build_ast
  14: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::parse
  15: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  16: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  17: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  18: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  19: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  20: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  21: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  22: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  23: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  24: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  25: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  26: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  27: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  28: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  29: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  30: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  31: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  32: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  33: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  34: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  35: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  36: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  37: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  38: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  39: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  40: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  41: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  42: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  43: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  44: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  45: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  46: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  47: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  48: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  49: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  50: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  51: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  52: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  53: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  54: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  55: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::register
  56: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  57: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  58: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::check_import
  59: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::resolve
  60: erg_compiler::build_package::GenericPackageBuilder<ASTBuilder,HIRBuilder>::build_root
  61: pylyzer_core::analyze::PythonAnalyzer::check
  62: pylyzer_core::analyze::PythonAnalyzer::analyze
  63: pylyzer_core::analyze::PythonAnalyzer::run
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
Thread panicked: Any { .. }

Environment

  • VSCode WSL Latest version
  • python 3.10.15
  • pylyzer 0.0.75

Additional context
Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant