[kotlin] Port NumberConversionFix to K2

^KTIJ-29579

GitOrigin-RevId: 404328c92e5b71a8a2f67b2a7995127462cac91a
This commit is contained in:
Andrey Cherkasov
2024-06-10 23:59:42 +00:00
committed by intellij-monorepo-bot
parent d2208e036e
commit e4932e2641
86 changed files with 570 additions and 93 deletions
@@ -26,6 +26,7 @@ import org.jetbrains.kotlin.idea.codeinsight.api.classic.quickfixes.KotlinQuickF
import org.jetbrains.kotlin.idea.codeinsights.impl.base.CallableReturnTypeUpdaterUtils
import org.jetbrains.kotlin.idea.codeinsights.impl.base.CallableReturnTypeUpdaterUtils.updateType
import org.jetbrains.kotlin.idea.quickfix.ChangeTypeFixUtils
import org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
import org.jetbrains.kotlin.idea.references.mainReference
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.*
@@ -205,8 +206,16 @@ object ChangeTypeQuickFixFactories {
val actualType = getActualType(diagnostic.actualType)
val expectedType = diagnostic.expectedType
buildList {
var primitiveLiteralData: PrimitiveLiteralData? = null
if (expression is KtConstantExpression && expectedType.isNumberOrUNumberType() && actualType.isNumberOrUNumberType()) {
add(WrongPrimitiveLiteralFix(expression, preparePrimitiveLiteral(expression, expectedType)))
primitiveLiteralData = preparePrimitiveLiteral(expression, expectedType)
add(WrongPrimitiveLiteralFix(expression, primitiveLiteralData))
}
if (expectedType.isNumberOrCharType() && actualType.isNumberOrCharType()) {
if (primitiveLiteralData == null || !WrongPrimitiveLiteralFix.isAvailable(primitiveLiteralData)) {
val elementContext = prepareNumberConversionElementContext(actualType, expectedType)
add(NumberConversionFix(expression as KtExpression, elementContext).asIntention())
}
}
}
}
@@ -112,6 +112,7 @@ class KotlinK2QuickFixRegistrar : KotlinQuickFixRegistrar() {
registerFactory(MoveTypeAliasToTopLevelFixFactory.moveTypeAliasToTopLevelFixFactory)
registerPsiQuickFixes(KaFirDiagnostic.InvalidIfAsExpression::class, AddIfElseBranchFix)
registerFactory(RemoveSupertypeFixFactory.removeSupertypeFixFactory)
registerFactory(NumberConversionFixFactory.numberConversionFixFactory)
}
private val addAbstract = KtQuickFixesListBuilder.registerPsiQuickFix {
@@ -0,0 +1,68 @@
// Copyright 2000-2024 JetBrains s.r.o. and contributors. Use of this source code is governed by the Apache 2.0 license.
package org.jetbrains.kotlin.idea.k2.codeinsight.fixes
import org.jetbrains.kotlin.analysis.api.KaSession
import org.jetbrains.kotlin.analysis.api.fir.diagnostics.KaFirDiagnostic
import org.jetbrains.kotlin.analysis.api.renderer.types.impl.KaTypeRendererForSource
import org.jetbrains.kotlin.analysis.api.types.KaType
import org.jetbrains.kotlin.analysis.api.types.KaTypeNullability
import org.jetbrains.kotlin.idea.codeinsight.api.applicators.fixes.KotlinQuickFixFactory
import org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
import org.jetbrains.kotlin.types.Variance
internal object NumberConversionFixFactory {
val numberConversionFixFactory = KotlinQuickFixFactory.ModCommandBased { diagnostic: KaFirDiagnostic.EqualityNotApplicable ->
val binaryExpr = diagnostic.psi
val left = binaryExpr.left ?: return@ModCommandBased emptyList()
val right = binaryExpr.right ?: return@ModCommandBased emptyList()
val leftType = diagnostic.leftType
val rightType = diagnostic.rightType
if (!leftType.isNumberOrCharType() || !rightType.isNumberOrCharType()) return@ModCommandBased emptyList()
buildList {
if (isNumberConversionAvailable(leftType, rightType)) {
val elementContext = prepareNumberConversionElementContext(leftType, rightType)
add(NumberConversionFix(left, elementContext, NumberConversionFix.ConversionType.LEFT_HAND_SIDE))
}
if (isNumberConversionAvailable(leftType, rightType)) {
val elementContext = prepareNumberConversionElementContext(rightType, leftType)
add(NumberConversionFix(right, elementContext, NumberConversionFix.ConversionType.RIGHT_HAND_SIDE))
}
}
}
}
context(KaSession)
internal fun prepareNumberConversionElementContext(
fromType: KaType,
toType: KaType,
): NumberConversionFix.ElementContext {
return NumberConversionFix.ElementContext(
typePresentation = toType.withNullability(KaTypeNullability.NON_NULLABLE).render(
renderer = KaTypeRendererForSource.WITH_SHORT_NAMES,
position = Variance.INVARIANT,
),
fromInt = fromType.isInt,
fromChar = fromType.isChar,
fromFloatOrDouble = fromType.isFloat || fromType.isDouble,
fromNullable = fromType.nullability.isNullable,
toChar = toType.isChar,
toInt = toType.isInt,
toByteOrShort = toType.isByte || toType.isShort,
)
}
context(KaSession)
internal fun isNumberConversionAvailable(
fromType: KaType,
toType: KaType,
): Boolean = fromType != toType && fromType.isNumberOrCharType() && toType.isNumberOrCharType()
context(KaSession)
internal fun KaType.isNumberOrCharType(): Boolean {
return with(withNullability(KaTypeNullability.NON_NULLABLE)) {
isNumberOrUNumberType() || isChar
}
}
@@ -81,22 +81,26 @@ private fun toLong(constValue: Any?): Long? = when (constValue) {
class WrongPrimitiveLiteralFix(element: KtExpression, private val primitiveLiteral: PrimitiveLiteralData) : KotlinQuickFixAction<KtExpression>(element) {
override fun isAvailable(project: Project, editor: Editor?, file: KtFile): Boolean {
with(primitiveLiteral) {
if (constValue == null) return false
val longValue = toLong(constValue) ?: return false
if (expectedTypeIsFloat || expectedTypeIsDouble || expectedTypeIsUnsigned) return true
companion object {
internal fun isAvailable(primitiveLiteral: PrimitiveLiteralData): Boolean {
with(primitiveLiteral) {
if (constValue == null) return false
val longValue = toLong(constValue) ?: return false
if (expectedTypeIsFloat || expectedTypeIsDouble || expectedTypeIsUnsigned) return true
if (constValue is Float || constValue is Double) {
val value = (constValue as? Float)?.toDouble() ?: constValue as Double
if (value != floor(value)) return false
if (value !in Long.MIN_VALUE.toDouble()..Long.MAX_VALUE.toDouble()) return false
if (constValue is Float || constValue is Double) {
val value = (constValue as? Float)?.toDouble() ?: constValue as Double
if (value != floor(value)) return false
if (value !in Long.MIN_VALUE.toDouble()..Long.MAX_VALUE.toDouble()) return false
}
return longValue in (valueRanges[typeName] ?: return false)
}
return longValue in (valueRanges[typeName] ?: return false)
}
}
override fun isAvailable(project: Project, editor: Editor?, file: KtFile): Boolean = isAvailable(primitiveLiteral)
override fun getFamilyName() = KotlinBundle.message("change.to.correct.primitive.type")
override fun getText() = KotlinBundle.message("change.to.0", primitiveLiteral.fixedExpression)
@@ -3797,6 +3797,235 @@ public abstract class HighLevelQuickFixTestGenerated extends AbstractHighLevelQu
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion")
public abstract static class NumberConversion extends AbstractHighLevelQuickFixTest {
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar")
public static class FromChar extends AbstractHighLevelQuickFixTest {
@java.lang.Override
@org.jetbrains.annotations.NotNull
public final KotlinPluginMode getPluginMode() {
return KotlinPluginMode.K2;
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("byte.kt")
public void testByte() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/byte.kt");
}
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/double.kt");
}
@TestMetadata("float.kt")
public void testFloat() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/float.kt");
}
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/int.kt");
}
@TestMetadata("intFromCharLiteral.kt")
public void testIntFromCharLiteral() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/intFromCharLiteral.kt");
}
@TestMetadata("long.kt")
public void testLong() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/long.kt");
}
@TestMetadata("longFromCharLiteral.kt")
public void testLongFromCharLiteral() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/longFromCharLiteral.kt");
}
@TestMetadata("short.kt")
public void testShort() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/short.kt");
}
@TestMetadata("shortWithVer1_4.kt")
public void testShortWithVer1_4() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/fromChar/shortWithVer1_4.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toByte")
public static class ToByte extends AbstractHighLevelQuickFixTest {
@java.lang.Override
@org.jetbrains.annotations.NotNull
public final KotlinPluginMode getPluginMode() {
return KotlinPluginMode.K2;
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toByte/double.kt");
}
@TestMetadata("float.kt")
public void testFloat() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toByte/float.kt");
}
@TestMetadata("floatWithVer1_2.kt")
public void testFloatWithVer1_2() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toByte/floatWithVer1_2.kt");
}
@TestMetadata("long.kt")
public void testLong() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toByte/long.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar")
public static class ToChar extends AbstractHighLevelQuickFixTest {
@java.lang.Override
@org.jetbrains.annotations.NotNull
public final KotlinPluginMode getPluginMode() {
return KotlinPluginMode.K2;
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("byte.kt")
public void testByte() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/byte.kt");
}
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/double.kt");
}
@TestMetadata("doubleLiteral.kt")
public void testDoubleLiteral() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/doubleLiteral.kt");
}
@TestMetadata("float.kt")
public void testFloat() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/float.kt");
}
@TestMetadata("floatLiteral.kt")
public void testFloatLiteral() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/floatLiteral.kt");
}
@TestMetadata("int.kt")
public void testInt() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/int.kt");
}
@TestMetadata("long.kt")
public void testLong() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/long.kt");
}
@TestMetadata("longLiteral.kt")
public void testLongLiteral() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/longLiteral.kt");
}
@TestMetadata("short.kt")
public void testShort() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/short.kt");
}
@TestMetadata("shortWithVer1_4.kt")
public void testShortWithVer1_4() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toChar/shortWithVer1_4.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toShort")
public static class ToShort extends AbstractHighLevelQuickFixTest {
@java.lang.Override
@org.jetbrains.annotations.NotNull
public final KotlinPluginMode getPluginMode() {
return KotlinPluginMode.K2;
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("double.kt")
public void testDouble() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toShort/double.kt");
}
@TestMetadata("float.kt")
public void testFloat() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toShort/float.kt");
}
@TestMetadata("floatWithVer1_2.kt")
public void testFloatWithVer1_2() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toShort/floatWithVer1_2.kt");
}
@TestMetadata("long.kt")
public void testLong() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/toShort/long.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion")
public static class Uncategorized extends AbstractHighLevelQuickFixTest {
@java.lang.Override
@org.jetbrains.annotations.NotNull
public final KotlinPluginMode getPluginMode() {
return KotlinPluginMode.K2;
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("convertBinaryExpression.kt")
public void testConvertBinaryExpression() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/convertBinaryExpression.kt");
}
@TestMetadata("convertExpression.kt")
public void testConvertExpression() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/convertExpression.kt");
}
@TestMetadata("convertToSigned.kt")
public void testConvertToSigned() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/convertToSigned.kt");
}
@TestMetadata("convertToUnsigned.kt")
public void testConvertToUnsigned() throws Exception {
runTest("../../../idea/tests/testData/quickfix/typeMismatch/numberConversion/convertToUnsigned.kt");
}
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/typeMismatch/parameterTypeMismatch")
public static class ParameterTypeMismatch extends AbstractHighLevelQuickFixTest {
@@ -5975,7 +6204,92 @@ public abstract class HighLevelQuickFixTestGenerated extends AbstractHighLevelQu
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/equalityNotApplicable")
public abstract static class EqualityNotApplicable extends AbstractHighLevelQuickFixTest {
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/equalityNotApplicable/charLiteralConversion")
public static class CharLiteralConversion extends AbstractHighLevelQuickFixTest {
@java.lang.Override
@org.jetbrains.annotations.NotNull
public final KotlinPluginMode getPluginMode() {
return KotlinPluginMode.K2;
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("charEqString.kt")
public void testCharEqString() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/charLiteralConversion/charEqString.kt");
}
@TestMetadata("charEqString2.kt")
public void testCharEqString2() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/charLiteralConversion/charEqString2.kt");
}
@TestMetadata("charEqString3.kt")
public void testCharEqString3() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/charLiteralConversion/charEqString3.kt");
}
@TestMetadata("charEqString4.kt")
public void testCharEqString4() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/charLiteralConversion/charEqString4.kt");
}
@TestMetadata("charEqStringDoubleQuote.kt")
public void testCharEqStringDoubleQuote() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/charLiteralConversion/charEqStringDoubleQuote.kt");
}
@TestMetadata("charEqStringSingleQuote.kt")
public void testCharEqStringSingleQuote() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/charLiteralConversion/charEqStringSingleQuote.kt");
}
@TestMetadata("interpolation.kt")
public void testInterpolation() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/charLiteralConversion/interpolation.kt");
}
}
@RunWith(JUnit3RunnerWithInners.class)
@TestMetadata("../../../idea/tests/testData/quickfix/equalityNotApplicable/numberConversion")
public static class NumberConversion extends AbstractHighLevelQuickFixTest {
@java.lang.Override
@org.jetbrains.annotations.NotNull
public final KotlinPluginMode getPluginMode() {
return KotlinPluginMode.K2;
}
private void runTest(String testDataFilePath) throws Exception {
KotlinTestUtils.runTest(this::doTest, this, testDataFilePath);
}
@TestMetadata("left.kt")
public void testLeft() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/numberConversion/left.kt");
}
@TestMetadata("nullableLeft.kt")
public void testNullableLeft() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/numberConversion/nullableLeft.kt");
}
@TestMetadata("nullableRight.kt")
public void testNullableRight() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/numberConversion/nullableRight.kt");
}
@TestMetadata("right.kt")
public void testRight() throws Exception {
runTest("../../../idea/tests/testData/quickfix/equalityNotApplicable/numberConversion/right.kt");
}
}
}
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return <caret>c == "a"
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return c == 'a'
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return <caret>"\t" == c
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return '\t' == c
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return <caret>c == """a"""
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return c == 'a'
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return <caret>c == "\""
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return <caret>c == '"'
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return <caret>c == "'"
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(c: Char): Boolean {
return c == '\''
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.ConvertStringToCharLiteralFix
/* IGNORE_K2 */
@@ -2,4 +2,5 @@
fun test(b: Byte, i: Int): Boolean {
return <caret>b == i
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -2,4 +2,5 @@
fun test(b: Byte, i: Int): Boolean {
return b.toInt() == i
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -2,4 +2,5 @@
fun test(s: Short?, l: Long?): Boolean {
return <caret>s == l
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -2,4 +2,5 @@
fun test(s: Short?, l: Long?): Boolean {
return s?.toLong() == l
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -2,4 +2,5 @@
fun test(s: Short?, l: Long?): Boolean {
return <caret>s == l
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -2,4 +2,5 @@
fun test(s: Short?, l: Long?): Boolean {
return s == l?.toShort()
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -2,4 +2,5 @@
fun test(b: Byte, i: Int): Boolean {
return <caret>b == i
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -2,4 +2,5 @@
fun test(b: Byte, i: Int): Boolean {
return b == i.toByte()
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun foo() {
fun bar(l: Float) {
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun foo() {
fun bar(l: Float) {
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -6,4 +6,5 @@ fun foo() {
fun bar(l: Int) {
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -6,4 +6,5 @@ fun foo() {
fun bar(l: Int) {
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun foo(param: Int) {}
fun test(expr: UInt) {
foo(<caret>expr)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun foo(param: Int) {}
fun test(expr: UInt) {
foo(expr.toInt())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun foo(param: UInt) {}
fun test(expr: Int) {
foo(<caret>expr)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun foo(param: UInt) {}
fun test(expr: Int) {
foo(expr.toUInt())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun byte(x: Byte) {}
fun test(c: Char) {
byte(<caret>c)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun byte(x: Byte) {}
fun test(c: Char) {
byte(c.code.toByte())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun double(x: Double) {}
fun test(c: Char) {
double(<caret>c)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun double(x: Double) {}
fun test(c: Char) {
double(c.code.toDouble())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun float(x: Float) {}
fun test(c: Char) {
float(<caret>c)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun float(x: Float) {}
fun test(c: Char) {
float(c.code.toFloat())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun int(x: Int) {}
fun test(c: Char) {
int(<caret>c)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun int(x: Int) {}
fun test(c: Char) {
int(c.code)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun int(x: Int) {}
fun test(c: Char) {
int(<caret>'c')
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun int(x: Int) {}
fun test(c: Char) {
int('c'.code)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun long(x: Long) {}
fun test(c: Char) {
long(<caret>c)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun long(x: Long) {}
fun test(c: Char) {
long(c.code.toLong())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun long(x: Long) {}
fun test(c: Char) {
long(<caret>'c')
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun long(x: Long) {}
fun test(c: Char) {
long('c'.code.toLong())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun short(x: Short) {}
fun test(c: Char) {
short(<caret>c)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun short(x: Short) {}
fun test(c: Char) {
short(c.code.toShort())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun short(x: Short) {}
fun test(c: Char) {
short(<caret>c)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun short(x: Short) {}
fun test(c: Char) {
short(c.toShort())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun byte(x: Byte) {}
fun test(d: Double) {
byte(<caret>d)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun byte(x: Byte) {}
fun test(d: Double) {
byte(d.toInt().toByte())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun byte(x: Byte) {}
fun test(f: Float) {
byte(<caret>f)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun byte(x: Byte) {}
fun test(f: Float) {
byte(f.toInt().toByte())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun byte(x: Byte) {}
fun test(f: Float) {
byte(<caret>f)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun byte(x: Byte) {}
fun test(f: Float) {
byte(f.toByte())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun byte(x: Byte) {}
fun test(l: Long) {
byte(<caret>l)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun byte(x: Byte) {}
fun test(l: Long) {
byte(l.toByte())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(b: Byte) {
char(<caret>b)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(b: Byte) {
char(b.toInt().toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(d: Double) {
char(<caret>d)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(d: Double) {
char(d.toInt().toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test() {
char(<caret>1.0)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test() {
char(1.0.toInt().toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(f: Float) {
char(<caret>f)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(f: Float) {
char(f.toInt().toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test() {
char(<caret>1.0f)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test() {
char(1.0f.toInt().toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test() {
char(<caret>1)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test() {
char(1.toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(l: Long) {
char(<caret>l)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(l: Long) {
char(l.toInt().toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test() {
char(<caret>1L)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test() {
char(1L.toInt().toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(s: Short) {
char(<caret>s)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun test(s: Short) {
char(s.toInt().toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -6,4 +6,5 @@ fun test(s: Short) {
char(<caret>s)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -6,4 +6,5 @@ fun test(s: Short) {
char(s.toChar())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun short(x: Short) {}
fun test(d: Double) {
short(<caret>d)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun short(x: Short) {}
fun test(d: Double) {
short(d.toInt().toShort())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun short(x: Short) {}
fun test(f: Float) {
short(<caret>f)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun short(x: Short) {}
fun test(f: Float) {
short(f.toInt().toShort())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun short(x: Short) {}
fun test(f: Float) {
short(<caret>f)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -5,4 +5,5 @@ fun short(x: Short) {}
fun test(f: Float) {
short(f.toShort())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun short(x: Short) {}
fun test(l: Long) {
short(<caret>l)
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -4,4 +4,5 @@ fun short(x: Short) {}
fun test(l: Long) {
short(l.toShort())
}
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
// FUS_K2_QUICKFIX_NAME: org.jetbrains.kotlin.idea.quickfix.NumberConversionFix
@@ -46,6 +46,7 @@ internal fun MutableTWorkspace.generateK2FixTests() {
model("$idea/quickfix/typeAddition", pattern = pattern)
model("$idea/quickfix/typeMismatch/casts", pattern = pattern)
model("$idea/quickfix/typeMismatch/componentFunctionReturnTypeMismatch", pattern = pattern)
model("$idea/quickfix/typeMismatch/numberConversion", pattern = pattern)
model("$idea/quickfix/typeMismatch/parameterTypeMismatch", pattern = pattern)
model("$idea/quickfix/typeMismatch/typeMismatchOnReturnedExpression", pattern = pattern)
model("$idea/quickfix/typeMismatch/wrongPrimitive", pattern = pattern)
@@ -114,7 +115,7 @@ internal fun MutableTWorkspace.generateK2FixTests() {
model("$idea/quickfix/decreaseVisibility", pattern = pattern, isIgnored = true)
model("$idea/quickfix/deprecatedJavaAnnotation", pattern = pattern, isIgnored = true)
model("$idea/quickfix/deprecatedSymbolUsage", pattern = pattern, isIgnored = true)
model("$idea/quickfix/equalityNotApplicable", pattern = pattern, isIgnored = true)
model("$idea/quickfix/equalityNotApplicable", pattern = pattern)
model("$idea/quickfix/final", pattern = pattern, isIgnored = true)
model("$idea/quickfix/foldTryCatch", pattern = pattern, isIgnored = true)
model("$idea/quickfix/functionWithLambdaExpressionBody", pattern = pattern, isIgnored = true)