-
Notifications
You must be signed in to change notification settings - Fork 28
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
#3057. Add reachability tests for operators. Part 5. #3105
base: master
Are you sure you want to change the base?
Conversation
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 think some tests are duplicates. I also commented on a number of cases where the description is a bit harder to read than it needs to be.
C c = C(); | ||
c >>= (i = 42); | ||
} catch (_) {} | ||
i; // Not definitely unassigned |
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.
Right, and we can't strengthen this one to use int i;
and 'definitely assigned' because the constructor invocation C()
could throw (or we could have out of memory).
So that's fine!
/// @description Checks that if the static type of the expression of the form | ||
/// `E1 >>= E2` static type of `E1`is not `Never` then `after(N) = after(E2)`. |
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 think this is similar to a case we had recently:
/// @description Checks that if the static type of the expression of the form | |
/// `E1 >>= E2` static type of `E1`is not `Never` then `after(N) = after(E2)`. | |
/// @description Checks that for an expression of the form `E1 >>= E2`, | |
/// if the static type of `E1`is not `Never` then `after(N) = after(E2)`. |
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.
Thank you. Fixed here and in the other tests.
/// @description Checks that if the static type of the expression of the form | ||
/// `E1 >>>= E2` static type of `E1`is not `Never` then `after(N) = after(E2)`. |
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.
Similar to TypeSystem/flow-analysis/reachability_A20_t108.dart.
/// @description Checks that if the static type of the expression of the form | ||
/// `E1 <<= E2` static type of `E1`is not `Never` then `after(N) = after(E2)`. |
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.
Similar to TypeSystem/flow-analysis/reachability_A20_t108.dart.
/// @description Checks that if the static type of the expression of the form | ||
/// `E1 <<= E2` static type of `E1`is not `Never` then `after(N) = after(E2)`. |
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.
Similar to TypeSystem/flow-analysis/reachability_A20_t108.dart.
/// @assertion - Binary operator: All binary operators other than `==`, `&&`, | ||
/// `||`, and `??` are handled as calls to the appropriate `operator` method. | ||
/// | ||
/// @description Checks that for an expression of the form `E1 >>>= E2` |
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 think a comma would improve on the readability of this sentence:
/// @description Checks that for an expression of the form `E1 >>>= E2` | |
/// @description Checks that for an expression of the form `E1 >>>= E2`, |
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 think this occurs in 7 tests in this PR.
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.
Fixed in all tests.
/// `||`, and `??` are handled as calls to the appropriate `operator` method. | ||
/// | ||
/// @description Checks that if the static type of the expression of the form | ||
/// `E1 >>>= E2` is `Never` `after(N) = unreachable(after(E2))`. |
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.
Again, the two code snippets right after each other looks funny, but a comma or 'then' could make it flow better:
/// `E1 >>>= E2` is `Never` `after(N) = unreachable(after(E2))`. | |
/// `E1 >>>= E2` is `Never` then `after(N) = unreachable(after(E2))`. |
I think we have about 5 of these in this PR.
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.
Fixed in all tests.
@@ -0,0 +1,25 @@ | |||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file |
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.
Seems to be the same test as t119? Should perhaps be |=
?
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.
Thank you for noticing!!! Fixed.
@@ -0,0 +1,25 @@ | |||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file |
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.
Same as previous test?
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.
Yes. Fixed.
@@ -0,0 +1,25 @@ | |||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file |
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.
Same as previous test?
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.
Fixed
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.
Thank you! Fixed. PTAL.
/// @description Checks that if the static type of the expression of the form | ||
/// `E1 >>= E2` static type of `E1`is not `Never` then `after(N) = after(E2)`. |
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.
Thank you. Fixed here and in the other tests.
/// @assertion - Binary operator: All binary operators other than `==`, `&&`, | ||
/// `||`, and `??` are handled as calls to the appropriate `operator` method. | ||
/// | ||
/// @description Checks that for an expression of the form `E1 >>>= E2` |
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.
Fixed in all tests.
/// `||`, and `??` are handled as calls to the appropriate `operator` method. | ||
/// | ||
/// @description Checks that if the static type of the expression of the form | ||
/// `E1 >>>= E2` is `Never` `after(N) = unreachable(after(E2))`. |
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.
Fixed in all tests.
@@ -0,0 +1,25 @@ | |||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file |
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.
Thank you for noticing!!! Fixed.
@@ -0,0 +1,25 @@ | |||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file |
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.
Yes. Fixed.
@@ -0,0 +1,25 @@ | |||
// Copyright (c) 2025, the Dart project authors. Please see the AUTHORS file |
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.
Fixed
No description provided.