Skip to content

[red-knot] subtype_of_implies_not_disjoint_from property test is now flaky #17144

@AlexWaygood

Description

@AlexWaygood

I got this property test failure on a local PR branch:

failures:

---- types::property_tests::stable::subtype_of_implies_not_disjoint_from stdout ----

thread 'types::property_tests::stable::subtype_of_implies_not_disjoint_from' panicked at /Users/alexw/.cargo/registry/src/index.crates.io-1949cf8c6b5b557f/quickcheck-1.0.3/src/tester.rs:165:28:
[quickcheck] TEST FAILED. Arguments: (Intersection { pos: [Callable { params: List([Param { kind: PositionalOnly, name: Some(Name("n1")), annotated_ty: Some(KnownClassInstance(Object)), default_ty: None }]), returns: Some(StringLiteral("")) }, StringLiteral("")], neg: [] }, LiteralString)
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Which I minimized down to this:

from typing import Callable, Literal, LiteralString
from knot_extensions import Intersection, static_assert, is_subtype_of, is_disjoint_from

static_assert(is_subtype_of(Intersection[Callable[[], None], Literal[""]], LiteralString))
static_assert(not is_disjoint_from(Intersection[Callable[[], None], Literal[""]], LiteralString))  # This assertion fails, but should logically hold true if the first assertion passes!

And the minimal repro also reproduces on main: https://playknot.ruff.rs/8cad645a-b986-42b8-baa7-ef8b75e81b3e

cc. @dhruvmanila

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingtestingRelated to testing Ruff itselftyMulti-file analysis & type inference

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions