[red-knot] Property tests: account non-fully-static types (#14897)

## Summary

Add a `is_fully_static` premise to the equivalence on subtyping property tests.

## Test Plan

```
cargo test -p red_knot_python_semantic -- --ignored types::property_tests::stable
```
This commit is contained in:
David Peter 2024-12-10 20:55:45 +01:00 committed by GitHub
parent 2ecd164adb
commit 1a3c311ac5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -163,13 +163,13 @@ mod stable {
// `T` is equivalent to itself.
type_property_test!(
equivalent_to_is_reflexive, db,
forall types t. t.is_equivalent_to(db, t)
forall types t. t.is_fully_static(db) => t.is_equivalent_to(db, t)
);
// `T` is a subtype of itself.
type_property_test!(
subtype_of_is_reflexive, db,
forall types t. t.is_subtype_of(db, t)
forall types t. t.is_fully_static(db) => t.is_subtype_of(db, t)
);
// `S <: T` and `T <: U` implies that `S <: U`.
@ -214,6 +214,12 @@ mod stable {
forall types t. t.is_singleton(db) => t.is_single_valued(db)
);
// If `T` contains a gradual form, it should not participate in equivalence
type_property_test!(
non_fully_static_types_do_not_participate_in_equivalence, db,
forall types s, t. !s.is_fully_static(db) => !s.is_equivalent_to(db, t) && !t.is_equivalent_to(db, s)
);
// If `T` contains a gradual form, it should not participate in subtyping
type_property_test!(
non_fully_static_types_do_not_participate_in_subtyping, db,