mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
Java: do not change too much on migrating expression type used in compound string assignment (IDEA-310441)
GitOrigin-RevId: d0c2bb8d47427f266c1b87c36bccb8e500dea366
This commit is contained in:
committed by
intellij-monorepo-bot
parent
2751538ed9
commit
d40c54bbd2
@@ -1,3 +1,4 @@
|
||||
// Copyright 2000-2023 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
|
||||
package com.intellij.refactoring;
|
||||
|
||||
import com.intellij.application.options.CodeStyle;
|
||||
@@ -39,6 +40,10 @@ public class TypeMigrationTest extends TypeMigrationTestBase {
|
||||
super.tearDown();
|
||||
}
|
||||
|
||||
public void testStringCompoundAssignment() {
|
||||
doTestFirstParamType("x", PsiTypes.longType());
|
||||
}
|
||||
|
||||
public void testT07() {
|
||||
doTestFieldType("f",
|
||||
myFactory.createTypeFromText("java.lang.Integer", null).createArrayType());
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
Types:
|
||||
PsiParameter:i : long
|
||||
PsiReferenceExpression:i : long
|
||||
|
||||
Conversions:
|
||||
|
||||
New expression type changes:
|
||||
Fails:
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
|
||||
public void x(long i) {
|
||||
String s = "";
|
||||
s += i;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
class Test {
|
||||
|
||||
public void x(int i) {
|
||||
String s = "";
|
||||
s += i;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user