FE: rework tests around changed progression resolve
Related to KT-54261, KT-36932, KT-49276
This commit is contained in:
committed by
Space Team
parent
5fda57fa55
commit
941446ea39
+6
@@ -5072,6 +5072,12 @@ public class DiagnosticCompilerTestFE10TestdataTestGenerated extends AbstractDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51062Error.kt")
|
||||||
|
public void testKt51062Error() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062Error.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overloadedFunction.kt")
|
@TestMetadata("overloadedFunction.kt")
|
||||||
public void testOverloadedFunction() throws Exception {
|
public void testOverloadedFunction() throws Exception {
|
||||||
|
|||||||
+6
@@ -5072,6 +5072,12 @@ public class LLFirPreresolvedReversedDiagnosticCompilerFE10TestDataTestGenerated
|
|||||||
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51062Error.kt")
|
||||||
|
public void testKt51062Error() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062Error.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overloadedFunction.kt")
|
@TestMetadata("overloadedFunction.kt")
|
||||||
public void testOverloadedFunction() throws Exception {
|
public void testOverloadedFunction() throws Exception {
|
||||||
|
|||||||
+6
@@ -5072,6 +5072,12 @@ public class FirLightTreeOldFrontendDiagnosticsTestGenerated extends AbstractFir
|
|||||||
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51062Error.kt")
|
||||||
|
public void testKt51062Error() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062Error.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overloadedFunction.kt")
|
@TestMetadata("overloadedFunction.kt")
|
||||||
public void testOverloadedFunction() throws Exception {
|
public void testOverloadedFunction() throws Exception {
|
||||||
|
|||||||
+6
@@ -5078,6 +5078,12 @@ public class FirPsiOldFrontendDiagnosticsTestGenerated extends AbstractFirPsiDia
|
|||||||
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51062Error.kt")
|
||||||
|
public void testKt51062Error() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062Error.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overloadedFunction.kt")
|
@TestMetadata("overloadedFunction.kt")
|
||||||
public void testOverloadedFunction() throws Exception {
|
public void testOverloadedFunction() throws Exception {
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
// !LANGUAGE: -ProgressionsChangingResolve -DisableCheckingChangedProgressionsResolve
|
||||||
|
// This test is not K1/K2 identical due to KT-58789 not implemented yet
|
||||||
|
|
||||||
fun <E> SmartList(x: E) {}
|
fun <E> SmartList(x: E) {}
|
||||||
fun <E> SmartList(x: Collection<E>) {}
|
fun <E> SmartList(x: Collection<E>) {}
|
||||||
|
|||||||
@@ -1,4 +1,6 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
|
// !LANGUAGE: -ProgressionsChangingResolve -DisableCheckingChangedProgressionsResolve
|
||||||
|
// This test is not K1/K2 identical due to KT-58789 not implemented yet
|
||||||
|
|
||||||
fun <E> SmartList(x: E) {}
|
fun <E> SmartList(x: E) {}
|
||||||
fun <E> SmartList(x: Collection<E>) {}
|
fun <E> SmartList(x: Collection<E>) {}
|
||||||
@@ -22,10 +24,10 @@ fun <T> takes(range: T) {}
|
|||||||
fun <T> takes(range: T) where T : Collection<*>, T: ClosedRange<*> {}
|
fun <T> takes(range: T) where T : Collection<*>, T: ClosedRange<*> {}
|
||||||
|
|
||||||
fun main() {
|
fun main() {
|
||||||
SmartList(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..2<!>) // warning
|
SmartList(<!PROGRESSIONS_CHANGING_RESOLVE_WARNING!>1..2<!>) // warning
|
||||||
SmartList<IntRange>(1..10) // no warning
|
SmartList<IntRange>(1..10) // no warning
|
||||||
|
|
||||||
append(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
append(<!PROGRESSIONS_CHANGING_RESOLVE_WARNING!>1..10<!>) // warning
|
||||||
append((1..10) as Any) // no warning
|
append((1..10) as Any) // no warning
|
||||||
append((1..10) as Iterable<Int>) // no warning
|
append((1..10) as Iterable<Int>) // no warning
|
||||||
append("a".."z") // no warning, the range is not iterable
|
append("a".."z") // no warning, the range is not iterable
|
||||||
@@ -35,9 +37,9 @@ fun main() {
|
|||||||
|
|
||||||
append3(In(1..10)) // no warning
|
append3(In(1..10)) // no warning
|
||||||
|
|
||||||
append4(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
append4(<!PROGRESSIONS_CHANGING_RESOLVE_WARNING!>1..10<!>) // warning
|
||||||
|
|
||||||
append4<IntRange>(1..10) // warning
|
append4<IntRange>(1..10) // warning
|
||||||
|
|
||||||
takes(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
takes(<!PROGRESSIONS_CHANGING_RESOLVE_WARNING!>1..10<!>) // warning
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,23 +0,0 @@
|
|||||||
package
|
|
||||||
|
|
||||||
public fun </*0*/ E> SmartList(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun </*0*/ E> SmartList(/*0*/ x: kotlin.collections.Collection<E>): kotlin.Unit
|
|
||||||
public fun append(/*0*/ x: kotlin.Any?): kotlin.Unit
|
|
||||||
public fun append(/*0*/ x: kotlin.collections.Collection<*>): kotlin.Unit
|
|
||||||
public fun append2(/*0*/ x: kotlin.collections.Collection<*>): kotlin.Unit
|
|
||||||
public fun append2(/*0*/ x: kotlin.collections.Iterable<*>): kotlin.Unit
|
|
||||||
@kotlin.jvm.JvmName(name = "append31") public fun append3(/*0*/ x: In<kotlin.Nothing>): kotlin.Unit
|
|
||||||
public fun append3(/*0*/ x: In<kotlin.collections.Collection<*>>): kotlin.Unit
|
|
||||||
public fun </*0*/ E> append4(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun </*0*/ E : kotlin.collections.Collection<*>> append4(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun main(): kotlin.Unit
|
|
||||||
public fun </*0*/ T> takes(/*0*/ range: T): kotlin.Unit
|
|
||||||
public fun </*0*/ T : kotlin.collections.Collection<*>> takes(/*0*/ range: T): kotlin.Unit where T : kotlin.ranges.ClosedRange<*>
|
|
||||||
|
|
||||||
public final class In</*0*/ in T> {
|
|
||||||
public constructor In</*0*/ in T>(/*0*/ x: T)
|
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,20 +0,0 @@
|
|||||||
package
|
|
||||||
|
|
||||||
public fun </*0*/ E> SmartList(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun </*0*/ E> SmartList(/*0*/ x: kotlin.collections.Collection<E>): kotlin.Unit
|
|
||||||
public fun append(/*0*/ x: kotlin.Any?): kotlin.Unit
|
|
||||||
public fun append(/*0*/ x: kotlin.collections.Collection<*>): kotlin.Unit
|
|
||||||
public fun append2(/*0*/ x: kotlin.collections.Collection<*>): kotlin.Unit
|
|
||||||
public fun append2(/*0*/ x: kotlin.collections.Iterable<*>): kotlin.Unit
|
|
||||||
@kotlin.jvm.JvmName(name = "append31") public fun append3(/*0*/ x: In<kotlin.Nothing>): kotlin.Unit
|
|
||||||
public fun append3(/*0*/ x: In<kotlin.collections.Collection<*>>): kotlin.Unit
|
|
||||||
public fun </*0*/ E> append4(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun </*0*/ E : kotlin.collections.Collection<*>> append4(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun main(): kotlin.Unit
|
|
||||||
|
|
||||||
public final class In</*0*/ in T> {
|
|
||||||
public constructor In</*0*/ in T>(/*0*/ x: T)
|
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// !LANGUAGE: +ProgressionsChangingResolve
|
// !LANGUAGE: +ProgressionsChangingResolve -DisableCheckingChangedProgressionsResolve
|
||||||
|
// This test is not K1/K2 identical due to KT-58789 not implemented yet
|
||||||
|
|
||||||
fun <E> SmartList(x: E) {}
|
fun <E> SmartList(x: E) {}
|
||||||
fun <E> SmartList(x: Collection<E>) {}
|
fun <E> SmartList(x: Collection<E>) {}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// !LANGUAGE: +ProgressionsChangingResolve
|
// !LANGUAGE: +ProgressionsChangingResolve -DisableCheckingChangedProgressionsResolve
|
||||||
|
// This test is not K1/K2 identical due to KT-58789 not implemented yet
|
||||||
|
|
||||||
fun <E> SmartList(x: E) {}
|
fun <E> SmartList(x: E) {}
|
||||||
fun <E> SmartList(x: Collection<E>) {}
|
fun <E> SmartList(x: Collection<E>) {}
|
||||||
|
|||||||
@@ -1,20 +0,0 @@
|
|||||||
package
|
|
||||||
|
|
||||||
public fun </*0*/ E> SmartList(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun </*0*/ E> SmartList(/*0*/ x: kotlin.collections.Collection<E>): kotlin.Unit
|
|
||||||
public fun append(/*0*/ x: kotlin.Any?): kotlin.Unit
|
|
||||||
public fun append(/*0*/ x: kotlin.collections.Collection<*>): kotlin.Unit
|
|
||||||
public fun append2(/*0*/ x: kotlin.collections.Collection<*>): kotlin.Unit
|
|
||||||
public fun append2(/*0*/ x: kotlin.collections.Iterable<*>): kotlin.Unit
|
|
||||||
@kotlin.jvm.JvmName(name = "append31") public fun append3(/*0*/ x: In<kotlin.Nothing>): kotlin.Unit
|
|
||||||
public fun append3(/*0*/ x: In<kotlin.collections.Collection<*>>): kotlin.Unit
|
|
||||||
public fun </*0*/ E> append4(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun </*0*/ E : kotlin.collections.Collection<*>> append4(/*0*/ x: E): kotlin.Unit
|
|
||||||
public fun main(): kotlin.Unit
|
|
||||||
|
|
||||||
public final class In</*0*/ in T> {
|
|
||||||
public constructor In</*0*/ in T>(/*0*/ x: T)
|
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
||||||
}
|
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// FULL_JDK
|
// FULL_JDK
|
||||||
|
// !LANGUAGE: -ProgressionsChangingResolve -DisableCheckingChangedProgressionsResolve
|
||||||
|
// This test is not K1/K2 identical due to KT-58789 not implemented yet
|
||||||
|
|
||||||
// FILE: JavaSmartList.java
|
// FILE: JavaSmartList.java
|
||||||
import kotlin.ranges.ClosedRange;
|
import kotlin.ranges.ClosedRange;
|
||||||
|
|||||||
@@ -1,5 +1,7 @@
|
|||||||
// WITH_STDLIB
|
// WITH_STDLIB
|
||||||
// FULL_JDK
|
// FULL_JDK
|
||||||
|
// !LANGUAGE: -ProgressionsChangingResolve -DisableCheckingChangedProgressionsResolve
|
||||||
|
// This test is not K1/K2 identical due to KT-58789 not implemented yet
|
||||||
|
|
||||||
// FILE: JavaSmartList.java
|
// FILE: JavaSmartList.java
|
||||||
import kotlin.ranges.ClosedRange;
|
import kotlin.ranges.ClosedRange;
|
||||||
@@ -32,10 +34,10 @@ public class JavaSmartList <E> {
|
|||||||
|
|
||||||
// FILE: main.kt
|
// FILE: main.kt
|
||||||
fun main() {
|
fun main() {
|
||||||
JavaSmartList(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..2<!>) // warning
|
JavaSmartList(<!PROGRESSIONS_CHANGING_RESOLVE_WARNING!>1..2<!>) // warning
|
||||||
JavaSmartList<IntRange>(1..10) // no warning
|
JavaSmartList<IntRange>(1..10) // no warning
|
||||||
|
|
||||||
JavaSmartList.append(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
JavaSmartList.append(<!PROGRESSIONS_CHANGING_RESOLVE_WARNING!>1..10<!>) // warning
|
||||||
JavaSmartList.append((1..10) as Any) // no warning
|
JavaSmartList.append((1..10) as Any) // no warning
|
||||||
JavaSmartList.append((1..10) as Iterable<Int>) // no warning
|
JavaSmartList.append((1..10) as Iterable<Int>) // no warning
|
||||||
JavaSmartList.append("a".."z") // no warning, the range is not iterable
|
JavaSmartList.append("a".."z") // no warning, the range is not iterable
|
||||||
@@ -45,9 +47,9 @@ fun main() {
|
|||||||
|
|
||||||
JavaSmartList.append3(JavaSmartList.In(1..10)) // no warning
|
JavaSmartList.append3(JavaSmartList.In(1..10)) // no warning
|
||||||
|
|
||||||
JavaSmartList.append4(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
JavaSmartList.append4(<!PROGRESSIONS_CHANGING_RESOLVE_WARNING!>1..10<!>) // warning
|
||||||
|
|
||||||
JavaSmartList.append4<IntRange>(1..10) // warning
|
JavaSmartList.append4<IntRange>(1..10) // warning
|
||||||
|
|
||||||
JavaSmartList.takes(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
JavaSmartList.takes(<!PROGRESSIONS_CHANGING_RESOLVE_WARNING!>1..10<!>) // warning
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,30 +0,0 @@
|
|||||||
package
|
|
||||||
|
|
||||||
public fun main(): kotlin.Unit
|
|
||||||
|
|
||||||
public open class JavaSmartList</*0*/ E : kotlin.Any!> {
|
|
||||||
public/*package*/ constructor JavaSmartList</*0*/ E : kotlin.Any!>(/*0*/ x: E!)
|
|
||||||
public/*package*/ constructor JavaSmartList</*0*/ E : kotlin.Any!>(/*0*/ x: kotlin.collections.(Mutable)Collection<E!>!)
|
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
||||||
|
|
||||||
public open class In</*0*/ T : kotlin.Any!> {
|
|
||||||
public/*package*/ constructor In</*0*/ T : kotlin.Any!>(/*0*/ x: T!)
|
|
||||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
|
||||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
|
||||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
|
||||||
}
|
|
||||||
|
|
||||||
// Static members
|
|
||||||
public/*package*/ open fun append(/*0*/ x: kotlin.Any!): kotlin.Unit
|
|
||||||
public/*package*/ open fun append(/*0*/ x: kotlin.collections.(Mutable)Collection<*>!): kotlin.Unit
|
|
||||||
public/*package*/ open fun append2(/*0*/ x: kotlin.collections.(Mutable)Collection<*>!): kotlin.Unit
|
|
||||||
public/*package*/ open fun append2(/*0*/ x: kotlin.collections.(Mutable)Iterable<*>!): kotlin.Unit
|
|
||||||
public/*package*/ open fun append3(/*0*/ x: JavaSmartList.In<*>!): kotlin.Unit
|
|
||||||
public/*package*/ open fun append3(/*0*/ x: JavaSmartList.In<kotlin.collections.(Mutable)Collection<*>!>!): kotlin.Unit
|
|
||||||
public/*package*/ open fun </*0*/ E : kotlin.Any!> append4(/*0*/ x: E!): kotlin.Unit
|
|
||||||
public/*package*/ open fun </*0*/ E : kotlin.collections.(Mutable)Collection<*>!> append4(/*0*/ x: E!): kotlin.Unit
|
|
||||||
public/*package*/ open fun </*0*/ T : kotlin.Any!> takes(/*0*/ x: T!): kotlin.Unit
|
|
||||||
public/*package*/ open fun </*0*/ T : kotlin.collections.(Mutable)Collection<*>!> takes(/*0*/ x: T!): kotlin.Unit where T : kotlin.ranges.ClosedRange<*>!
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
// FULL_JDK
|
||||||
|
// !LANGUAGE: +ProgressionsChangingResolve -DisableCheckingChangedProgressionsResolve
|
||||||
|
// This test is not K1/K2 identical due to KT-58789 not implemented yet
|
||||||
|
|
||||||
|
// FILE: JavaSmartList.java
|
||||||
|
import kotlin.ranges.ClosedRange;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public class JavaSmartList <E> {
|
||||||
|
JavaSmartList(E x) {}
|
||||||
|
JavaSmartList(Collection<E> x) {}
|
||||||
|
|
||||||
|
static void append(Object x) {}
|
||||||
|
static void append(Collection<?> x) {}
|
||||||
|
|
||||||
|
static void append2(Iterable<?> x) {}
|
||||||
|
static void append2(Collection<?> x) {}
|
||||||
|
|
||||||
|
public static class In <T> {
|
||||||
|
In(T x) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void append3(In<?> x) {}
|
||||||
|
static void append3(In<Collection<?>> x) {}
|
||||||
|
|
||||||
|
static <E> void append4(E x) {}
|
||||||
|
static <E extends Collection<?>> void append4(E x) {}
|
||||||
|
|
||||||
|
static <T> void takes(T x) {}
|
||||||
|
static <T extends Collection<?> & ClosedRange<?>> void takes(T x) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun main() {
|
||||||
|
JavaSmartList(1..2) // warning
|
||||||
|
JavaSmartList<IntRange>(1..10) // no warning
|
||||||
|
|
||||||
|
JavaSmartList.append(1..10) // warning
|
||||||
|
JavaSmartList.append((1..10) as Any) // no warning
|
||||||
|
JavaSmartList.append((1..10) as Iterable<Int>) // no warning
|
||||||
|
JavaSmartList.append("a".."z") // no warning, the range is not iterable
|
||||||
|
JavaSmartList.append(1.0..2.0)
|
||||||
|
|
||||||
|
JavaSmartList.append2(1..10) // no warning
|
||||||
|
|
||||||
|
JavaSmartList.append3(JavaSmartList.In(1..10)) // no warning
|
||||||
|
|
||||||
|
JavaSmartList.append4(1..10) // warning
|
||||||
|
|
||||||
|
JavaSmartList.append4<IntRange>(1..10) // warning
|
||||||
|
|
||||||
|
JavaSmartList.takes(1..10) // warning
|
||||||
|
}
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
// WITH_STDLIB
|
||||||
|
// FULL_JDK
|
||||||
|
// !LANGUAGE: +ProgressionsChangingResolve -DisableCheckingChangedProgressionsResolve
|
||||||
|
// This test is not K1/K2 identical due to KT-58789 not implemented yet
|
||||||
|
|
||||||
|
// FILE: JavaSmartList.java
|
||||||
|
import kotlin.ranges.ClosedRange;
|
||||||
|
|
||||||
|
import java.util.Collection;
|
||||||
|
|
||||||
|
public class JavaSmartList <E> {
|
||||||
|
JavaSmartList(E x) {}
|
||||||
|
JavaSmartList(Collection<E> x) {}
|
||||||
|
|
||||||
|
static void append(Object x) {}
|
||||||
|
static void append(Collection<?> x) {}
|
||||||
|
|
||||||
|
static void append2(Iterable<?> x) {}
|
||||||
|
static void append2(Collection<?> x) {}
|
||||||
|
|
||||||
|
public static class In <T> {
|
||||||
|
In(T x) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
static void append3(In<?> x) {}
|
||||||
|
static void append3(In<Collection<?>> x) {}
|
||||||
|
|
||||||
|
static <E> void append4(E x) {}
|
||||||
|
static <E extends Collection<?>> void append4(E x) {}
|
||||||
|
|
||||||
|
static <T> void takes(T x) {}
|
||||||
|
static <T extends Collection<?> & ClosedRange<?>> void takes(T x) {}
|
||||||
|
}
|
||||||
|
|
||||||
|
// FILE: main.kt
|
||||||
|
fun main() {
|
||||||
|
JavaSmartList(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..2<!>) // warning
|
||||||
|
JavaSmartList<IntRange>(1..10) // no warning
|
||||||
|
|
||||||
|
JavaSmartList.append(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
||||||
|
JavaSmartList.append((1..10) as Any) // no warning
|
||||||
|
JavaSmartList.append((1..10) as Iterable<Int>) // no warning
|
||||||
|
JavaSmartList.append("a".."z") // no warning, the range is not iterable
|
||||||
|
JavaSmartList.append(1.0..2.0)
|
||||||
|
|
||||||
|
JavaSmartList.append2(1..10) // no warning
|
||||||
|
|
||||||
|
JavaSmartList.append3(JavaSmartList.In(1..10)) // no warning
|
||||||
|
|
||||||
|
JavaSmartList.append4(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
||||||
|
|
||||||
|
JavaSmartList.append4<IntRange>(1..10) // warning
|
||||||
|
|
||||||
|
JavaSmartList.takes(<!PROGRESSIONS_CHANGING_RESOLVE_ERROR!>1..10<!>) // warning
|
||||||
|
}
|
||||||
Generated
+6
@@ -5078,6 +5078,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
|||||||
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062.kt");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
@TestMetadata("kt51062Error.kt")
|
||||||
|
public void testKt51062Error() throws Exception {
|
||||||
|
runTest("compiler/testData/diagnostics/tests/checkArguments/kt51062Error.kt");
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@TestMetadata("overloadedFunction.kt")
|
@TestMetadata("overloadedFunction.kt")
|
||||||
public void testOverloadedFunction() throws Exception {
|
public void testOverloadedFunction() throws Exception {
|
||||||
|
|||||||
Reference in New Issue
Block a user