From 7250aed3b51bbe06ae689bedc4559063380010ce Mon Sep 17 00:00:00 2001 From: Dmitriy Novozhilov Date: Wed, 21 Jul 2021 16:41:39 +0300 Subject: [PATCH] [FE 1.0] Fix some diagnostic tests --- .../diagnostics/tests/SafeCallOnFakePackage.kt | 2 +- .../diagnostics/tests/java8Overrides/kt45508.kt | 4 ++-- .../tests/nullableTypes/safeCallOperators.kt | 16 ++++++++-------- .../tests/operatorRem/numberRemConversions.kt | 6 +++--- ...signedToUnsignedConversionWithExpectedType.kt | 6 +++--- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/compiler/testData/diagnostics/tests/SafeCallOnFakePackage.kt b/compiler/testData/diagnostics/tests/SafeCallOnFakePackage.kt index 3e2a82a1317..e4d456dc634 100644 --- a/compiler/testData/diagnostics/tests/SafeCallOnFakePackage.kt +++ b/compiler/testData/diagnostics/tests/SafeCallOnFakePackage.kt @@ -12,5 +12,5 @@ val s: String = "test" fun ff() { val a = Test?.FOO val b = foo?.s - System?.out.println(a + b) + System?.out.println(a + b) } diff --git a/compiler/testData/diagnostics/tests/java8Overrides/kt45508.kt b/compiler/testData/diagnostics/tests/java8Overrides/kt45508.kt index 71b664fd4ff..74799931c57 100644 --- a/compiler/testData/diagnostics/tests/java8Overrides/kt45508.kt +++ b/compiler/testData/diagnostics/tests/java8Overrides/kt45508.kt @@ -8,11 +8,11 @@ interface B { open class D: B -open class C: D(), A +open class C: D(), A // ------------ -class Test: Impl(), CProvider +class Test: Impl(), CProvider open class CC diff --git a/compiler/testData/diagnostics/tests/nullableTypes/safeCallOperators.kt b/compiler/testData/diagnostics/tests/nullableTypes/safeCallOperators.kt index 2de57b312cc..03c2bfb7453 100644 --- a/compiler/testData/diagnostics/tests/nullableTypes/safeCallOperators.kt +++ b/compiler/testData/diagnostics/tests/nullableTypes/safeCallOperators.kt @@ -52,19 +52,19 @@ fun foo(a: A?) { a?.w.inc() if (a != null) { - a?.l += 1 - a?.l[0] - a?.l[0]++ - a?.l[0] = 1 + a?.l += 1 + a?.l[0] + a?.l[0]++ + a?.l[0] = 1 - a?.ll[0][0] - a?.ll[0][0]++ - a?.ll[0][0] = 1 + a?.ll[0][0] + a?.ll[0][0]++ + a?.ll[0][0] = 1 // No warning is reported because // 1. All kinds of green code with safe+call + invoke we identified fails with CCE if `a != null`, anyway // 2. In case of null value, the behavior is intended (no call performed) a?.q() - a?.w++ + a?.w++ (a?.l) += 1 (a?.l)[0] diff --git a/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.kt b/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.kt index 6ea95abe126..5b6d85a56b9 100644 --- a/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.kt +++ b/compiler/testData/diagnostics/tests/operatorRem/numberRemConversions.kt @@ -7,9 +7,9 @@ fun fooShort(p: Short) = p fun test() { fooInt(1 % 1) - fooByte(1 % 1) - fooLong(1 % 1) - fooShort(1 % 1) + fooByte(1 % 1) + fooLong(1 % 1) + fooShort(1 % 1) } public operator fun Int.rem(other: Int): Int = 0 diff --git a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt index bf30f8146d0..91b7d7006a6 100644 --- a/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt +++ b/compiler/testData/diagnostics/tests/unsignedTypes/conversions/signedToUnsignedConversionWithExpectedType.kt @@ -10,8 +10,8 @@ fun takeUBytes(vararg u: UByte) {} fun takeNullableUInt(u: UInt?) {} fun test() { - takeUInt(1 + 2) - takeUInt(1.plus(2)) + takeUInt(1 + 2) + takeUInt(1.plus(2)) takeNullableUInt(4) takeUInt(Int.MAX_VALUE * 2L) @@ -33,7 +33,7 @@ fun test() { takeUInt(Int.MAX_VALUE * 2) takeUInt(4294967294) - takeUBytes(1, 2, 255, 256, 0, -1, 40 + 2) + takeUBytes(1, 2, 255, 256, 0, -1, 40 + 2) takeUInt(1.myPlus(2))