Skip to content

[panic] AST indices should never change within the same revision #2602

@MeGaGiGaGon

Description

@MeGaGiGaGon

Summary

After minimizing #2597 I decided to finally sit down and write a program that could do the minimization for me, and found a different panic. I decided to open a new issue for it since the panic is different and the source code is almost completely unrecognizable + heavily abuses ty's parser, so it may or may not be fixed by a fix for #2597.

The new panic is:

error[panic]: Panicked at crates\ty_python_semantic\src\types\function.rs:299:56 when checking `C:\ty_issues\issue.py`: `AST indices should never change within the same revision`
... Omitted for brevity
info: query stacktrace:
   0: infer_scope_types_impl(Id(1000))
             at crates\ty_python_semantic\src\types\infer.rs:192
   1: check_file_impl(Id(c00))
             at crates\ty_project\src\lib.rs:554

It still requires 3 files, so a zip is attached: new_panic.zip
https://play.ty.dev/15e9a871-aeb3-4d59-8cc3-36c4a70270a7
issue.py:

from generic DataFrameGroupBy
from groupby GroupBy
class(DataFrameGroupBy)_cython_agg_general=GroupBy._cython_agg_general

generic.py:

from groupby GroupBy""class DataFrameGroupBy(GroupBy

groupby.py:

from typing final,class GroupBy(])
 @final def _cython_agg_general

Version

ty 0.0.13 (fc1478b 2026-01-21) playground f4b84a941

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingfatala fatal error (panic or crash)fuzzerIssues surfaced by fuzzing ty

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions