-
Notifications
You must be signed in to change notification settings - Fork 1.6k
[ty] Move constraint set mdtest functions into ConstraintSet class
#21108
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
ConstraintSet classConstraintSet class
Diagnostic diff on typing conformance testsNo changes detected when running ty on typing conformance tests ✅ |
|
|
|
||
| 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)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I find always so much easier to understand. Thanks for making this change.
| Place::bound(Type::KnownBoundMethod(KnownBoundMethodType::PathOpen)).into() | ||
| } | ||
|
|
||
| Type::ClassLiteral(class) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I didn't review this part closely as it mostly seems about moving code around. I hope that's okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yep, a bunch of things that were KnownFunctions are now KnownBoundMethods.
…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)
|
This new API/DSL looks cool! |
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!