mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-06 05:10:22 +07:00
compound assignment: allow assignment to string super types (IDEA-238812)
GitOrigin-RevId: 56d7dd94bc8e1b728aef2c59a54bee76ad43df74
This commit is contained in:
committed by
intellij-monorepo-bot
parent
00a0067a26
commit
09d57e4993
@@ -551,8 +551,10 @@ public class TypeConversionUtil {
|
||||
resultTypeRank = STRING_RANK;
|
||||
}
|
||||
else if (rtype.equalsToText(JAVA_LANG_STRING)) {
|
||||
isApplicable = !isVoidType(ltype);
|
||||
resultTypeRank = STRING_RANK;
|
||||
if (isVoidType(ltype)) {
|
||||
return false;
|
||||
}
|
||||
return !strict || ltype.isAssignableFrom(rtype);
|
||||
}
|
||||
else if (isPrimitiveAndNotNullOrWrapper(ltype) && isPrimitiveAndNotNullOrWrapper(rtype)) {
|
||||
resultTypeRank = Math.max(ltypeRank, rtypeRank);
|
||||
|
||||
@@ -3,5 +3,9 @@ class Test {
|
||||
Object o = "";
|
||||
<warning descr="Operator '+' cannot be applied to 'java.lang.Object', 'java.lang.String'">o += ""</warning>;
|
||||
System.out.println(o);
|
||||
|
||||
CharSequence c = "";
|
||||
c += "";
|
||||
System.out.println(c);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user