xref: /aosp_15_r20/external/skia/resources/sksl/errors/IllegalRecursionMutual.rts (revision c8dee2aa9b3f27cf6c858bd81872bdeb2c07ed17)
1*c8dee2aaSAndroid Build Coastguard Worker// Expect 1 error
2*c8dee2aaSAndroid Build Coastguard Worker
3*c8dee2aaSAndroid Build Coastguard Worker// Straightforward mutual recursion (not allowed)
4*c8dee2aaSAndroid Build Coastguard Workerbool is_even(int n);
5*c8dee2aaSAndroid Build Coastguard Workerbool is_odd (int n) { return n == 0 ? false : is_even(n - 1); }
6*c8dee2aaSAndroid Build Coastguard Workerbool is_even(int n) { return n == 0 ? true  : is_odd (n - 1); }
7*c8dee2aaSAndroid Build Coastguard Worker
8*c8dee2aaSAndroid Build Coastguard Worker/*%%*
9*c8dee2aaSAndroid Build Coastguard Workerpotential recursion (function call cycle) not allowed:
10*c8dee2aaSAndroid Build Coastguard Worker	bool is_odd(int n)
11*c8dee2aaSAndroid Build Coastguard Worker	bool is_even(int n)
12*c8dee2aaSAndroid Build Coastguard Worker	bool is_odd(int n)
13*c8dee2aaSAndroid Build Coastguard Worker*%%*/
14