-
Notifications
You must be signed in to change notification settings - Fork 354
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
Make pre- and post-conditions obey behavioral subtyping #5825
Conversation
…ns into excess-ecm-precursors
…adoc into excess-ecm-precursors
…sModified into excess-ecm-precursors
…doc into excess-ecm-precursors
…doc into excess-ecm-precursors
…rnst/checker-framework into wpiPrepareMethodForWriting-parameters
…ing-parameters into excess-ecm-precursors
…ing-parameters into excess-ecm-precursors
…ess-ecm-precursors
…ess-ecm-precursors
@smillst This is ready for your review. |
…nto excess-ecm-precursors
…LEAN into excess-ecm-2
…LEAN into excess-ecm-2
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 tried making test cases for this change, but I wasn't successful because I don't know when inference should be inferring pre/post conditions. (Can inference ever infer a precondition?) It would be helpful if this pull request contained at least one test case where a pre/post condition is inferred.
...rg/checkerframework/common/wholeprograminference/WholeProgramInferenceJavaParserStorage.java
Outdated
Show resolved
Hide resolved
.../main/java/org/checkerframework/checker/calledmethods/CalledMethodsAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
Pair<AnnotatedTypeMirror, AnnotatedTypeMirror> pair = entry.getValue(); | ||
AnnotatedTypeMirror inferredType = pair.first; | ||
AnnotatedTypeMirror declaredType = pair.second; | ||
if (otherIsSupertype ? isPrecondition : !isPrecondition) { |
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.
This can be moved outside the loop.
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.
In the common case, I expect the loop not to be entered.
.../main/java/org/checkerframework/checker/calledmethods/CalledMethodsAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
.../main/java/org/checkerframework/checker/calledmethods/CalledMethodsAnnotatedTypeFactory.java
Outdated
Show resolved
Hide resolved
@EnsuresCalledMethods
obey behavioral subtyping
@smillst I have added tests and addressed your other feedback. Could you please re-review? |
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.
Thanks for the changes. This all makes a lot more sense to me now.
No description provided.