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