[ty] Move constraint set mdtest functions into ConstraintSet class#21108
Merged
[ty] Move constraint set mdtest functions into ConstraintSet class#21108
ConstraintSet class#21108Conversation
ConstraintSet classConstraintSet class
Contributor
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
Contributor
|
MichaReiser
approved these changes
Oct 28, 2025
|
|
||
| static_assert(not is_subtype_of(bool, str)) | ||
| static_assert(not is_subtype_of_given(True, bool, str)) | ||
| static_assert(not ConstraintSet.always().implies_subtype_of(bool, str)) |
Member
There was a problem hiding this comment.
I find always so much easier to understand. Thanks for making this change.
| Place::bound(Type::KnownBoundMethod(KnownBoundMethodType::PathOpen)).into() | ||
| } | ||
|
|
||
| Type::ClassLiteral(class) |
Member
There was a problem hiding this comment.
I didn't review this part closely as it mostly seems about moving code around. I hope that's okay
Member
Author
There was a problem hiding this comment.
Yep, a bunch of things that were KnownFunctions are now KnownBoundMethods.
dcreager
added a commit
that referenced
this pull request
Oct 28, 2025
…straint-sets * dcreager/subtype-given-typevars: better comment restructure a bit better names/comments simplify before implication two typevars! [ty] Reformat constraint set mdtests (#21111) [ty] Move constraint set mdtest functions into `ConstraintSet` class (#21108) Avoid sending an unnecessary "clear diagnostics" message for clients supporting pull diagnostics (#21105) Update Rust crate ignore to v0.4.24 (#20979)
Contributor
|
This new API/DSL looks cool! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We have several functions in
ty_extensionsfor testing our constraint set implementation. This PR refactors those functions so that they are all methods of theConstraintSetclass, rather than being standalone top-level functions. 🎩 to @sharkdp for pointing out thatKnownBoundMethodgives us what we need to implement that!