File tree 2 files changed +34
-0
lines changed
2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ proc returnsBool() {
2
+ writeln (" evaluated" );
3
+ return true ;
4
+ }
5
+
6
+ var x : bool ;
7
+
8
+ writeln (" shouldn't short-circuit for &&= with LHS true" );
9
+ x = true ;
10
+ x & &= returnsBool();
11
+ writeln ();
12
+
13
+ writeln (" should short-circuit for &&= with LHS false" );
14
+ x = false ;
15
+ x & &= returnsBool();
16
+ writeln ();
17
+
18
+ writeln (" should short-circuit for ||= with LHS true" );
19
+ x = true ;
20
+ x | |= returnsBool();
21
+ writeln ();
22
+
23
+ writeln (" shouldn't short-circuit for ||= with LHS false" );
24
+ x = false ;
25
+ x | |= returnsBool();
Original file line number Diff line number Diff line change
1
+ shouldn't short-circuit for &&= with LHS true
2
+ evaluated
3
+
4
+ should short-circuit for &&= with LHS false
5
+
6
+ should short-circuit for ||= with LHS true
7
+
8
+ shouldn't short-circuit for ||= with LHS false
9
+ evaluated
You can’t perform that action at this time.
0 commit comments