Skip to content

panic: dependency graph cycle when querying function_known_decorators #3593

@correctmost

Description

@correctmost

Summary

ty crashes when checking this fuzzed code:

from typing import Self, overload, reveal_type

class C:
    a: D

C.a
reveal_type(C().a)

class D:
    @overload
    def __get__() -> Self:
        pass
error[panic]: Panicked at /home/user/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/salsa-0.26.2/src/function/fetch.rs:178:21 when checking `/home/user/crash.py`: `dependency graph cycle when querying function_known_decorators(Id(1405)), set cycle_fn/cycle_initial to fixpoint iterate.
Query stack:
[
    check_file_impl(Id(c00)),
    infer_scope_types_impl(Id(1000)),
    Type < 'db >::member_lookup_with_policy_(Id(2c07)),
    Type < 'db >::try_call_dunder_get_(Id(8400)),
    Type < 'db >::class_member_with_policy_(Id(8800)),
    place_by_id(Id(340f)),
    infer_definition_types(Id(1405)),
    function_known_decorators(Id(1405)),
    infer_expression_type_impl(Id(1802)),
    infer_expression_types_impl(Id(1802)),
    Type < 'db >::member_lookup_with_policy_(Id(2c0d)),
    Type < 'db >::try_call_dunder_get_(Id(8402)),
    FunctionType < 'db >::signature_(Id(3c07)),
    infer_deferred_types(Id(1405)),
    Type < 'db >::apply_specialization_(Id(5807)),
    Type < 'db >::member_lookup_with_policy_(Id(2c0c)),
    place_by_id(Id(3414)),
    infer_definition_types(Id(48a1)),
    place_by_id(Id(3404)),
    infer_definition_types(Id(4916)),
    file_to_module(Id(c0e)),
    source_text(Id(c0e)),
]

https://play.ty.dev/c02b885e-0b43-469a-a39a-f001ecf7e5fb

Version

astral-sh/ruff@5a6c81150

Metadata

Metadata

Assignees

Labels

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

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions