int i = 1; float f = 1.0; // SkSL allows `float op ` and ` op float`, unlike GLSL. void f_eq_int_literal_ok() { f = 1; } void f_plus_int_literal_ok() { f + 1; } void f_minus_int_literal_ok() { f - 1; } void f_mul_int_literal_ok() { f * 1; } void f_div_int_literal_ok() { f / 1; } void int_literal_plus_f_ok() { 1 + f; } void int_literal_minus_f_ok() { 1 - f; } void int_literal_mul_f_ok() { 1 * f; } void int_literal_div_f_ok() { 1 / f; } // Other than that, mixing scalar types without a cast is disallowed. void i_eq_float_literal_disallowed() { i = 1.0; } void i_eq_f_disallowed() { i = f; } void f_eq_i_disallowed() { f = i; } void i_plus_float_literal_disallowed() { i + 1.0; } void i_minus_float_literal_disallowed() { i - 1.0; } void i_mul_float_literal_disallowed() { i * 1.0; } void i_div_float_literal_disallowed() { i / 1.0; } void float_literal_plus_i_disallowed() { 1.0 + i; } void float_literal_minus_i_disallowed() { 1.0 - i; } void float_literal_mul_i_disallowed() { 1.0 * i; } void float_literal_div_i_disallowed() { 1.0 / i; } void i_plus_f_disallowed() { i + f; } void i_minus_f_disallowed() { i - f; } void i_mul_f_disallowed() { i * f; } void i_div_f_disallowed() { i / f; } void f_plus_i_disallowed() { f + i; } void f_minus_i_disallowed() { f - i; } void f_mul_i_disallowed() { f * i; } void f_div_i_disallowed() { f / i; } void f_plus_u_disallowed() { f + u; } void f_minus_u_disallowed() { f - u; } void f_mul_u_disallowed() { f * u; } void f_div_u_disallowed() { f / u; } void i_plus_u_disallowed() { i + u; } void i_minus_u_disallowed() { i - u; } void i_mul_u_disallowed() { i * u; } void i_div_u_disallowed() { i / u; } /*%%* type mismatch: '=' cannot operate on 'int', 'float' type mismatch: '=' cannot operate on 'int', 'float' type mismatch: '=' cannot operate on 'float', 'int' type mismatch: '+' cannot operate on 'int', 'float' type mismatch: '-' cannot operate on 'int', 'float' type mismatch: '*' cannot operate on 'int', 'float' type mismatch: '/' cannot operate on 'int', 'float' type mismatch: '+' cannot operate on 'float', 'int' type mismatch: '-' cannot operate on 'float', 'int' type mismatch: '*' cannot operate on 'float', 'int' type mismatch: '/' cannot operate on 'float', 'int' type mismatch: '+' cannot operate on 'int', 'float' type mismatch: '-' cannot operate on 'int', 'float' type mismatch: '*' cannot operate on 'int', 'float' type mismatch: '/' cannot operate on 'int', 'float' type mismatch: '+' cannot operate on 'float', 'int' type mismatch: '-' cannot operate on 'float', 'int' type mismatch: '*' cannot operate on 'float', 'int' type mismatch: '/' cannot operate on 'float', 'int' *%%*/