File tree 1 file changed +24
-0
lines changed
1 file changed +24
-0
lines changed Original file line number Diff line number Diff line change @@ -1730,6 +1730,29 @@ static void test27() {
1730
1730
assert (guard.realizeErrors () == 0 );
1731
1731
}
1732
1732
1733
+ // Test resolving logical AND/OR compound assignment operators
1734
+ static void test28 () {
1735
+ Context* context = buildStdContext ();
1736
+ ErrorGuard guard (context);
1737
+
1738
+ std::string prog =
1739
+ R"""(
1740
+ proc baz() {
1741
+ var ok = true;
1742
+ ok &&= false;
1743
+ ok ||= true;
1744
+ return ok;
1745
+ }
1746
+ var x = baz();
1747
+ )""" ;
1748
+
1749
+ auto t = resolveTypeOfXInit (context, prog);
1750
+ CHPL_ASSERT (!t.isUnknownOrErroneous ());
1751
+ CHPL_ASSERT (t.type ()->isBoolType ());
1752
+
1753
+ assert (guard.realizeErrors () == 0 );
1754
+ }
1755
+
1733
1756
// This bug is hard to replicate with queries alone, but does seem to show
1734
1757
// up in some cases of the query system.
1735
1758
static void testInfiniteCycleBug () {
@@ -2128,6 +2151,7 @@ int main() {
2128
2151
test25 ();
2129
2152
test26 ();
2130
2153
test27 ();
2154
+ test28 ();
2131
2155
2132
2156
testInfiniteCycleBug ();
2133
2157
You can’t perform that action at this time.
0 commit comments