Fix in BinaryExpression to allow concat on expressions typed at a type variable with String as its bound.
This construct is not allowed in Java but it is allowed in kotlin. This problem is also made more ubiquitous when the declaration variance is propagated into reference sites.
@@ -225,8 +225,8 @@ public class BinaryExpression extends Expression {
return false;
}
- if (TypeDescriptors.isJavaLangString(leftOperandType)
- || TypeDescriptors.isJavaLangString(rightOperandType)) {
+ if (TypeDescriptors.isJavaLangString(leftOperandType.toRawTypeDescriptor())
+ || TypeDescriptors.isJavaLangString(rightOperandType.toRawTypeDescriptor())) {
return true;
}
