Add test for errors reporting of UPPER_BOUND_VIOLATED
This commit is contained in:
+6
@@ -34333,6 +34333,12 @@ public class FirOldFrontendDiagnosticsTestGenerated extends AbstractFirDiagnosti
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/java/checkEnhancedUpperBounds.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("checkEnhancedUpperBoundsWithEnabledImprovements.kt")
|
||||
public void testCheckEnhancedUpperBoundsWithEnabledImprovements() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/java/checkEnhancedUpperBoundsWithEnabledImprovements.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("concurrentHashMapContains.kt")
|
||||
public void testConcurrentHashMapContains() throws Exception {
|
||||
|
||||
-1
@@ -1,4 +1,3 @@
|
||||
// !LANGUAGE: +ProhibitUsingNullableTypeParameterAgainstNotNullAnnotated
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FULL_JDK
|
||||
|
||||
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// !LANGUAGE: +ImprovementsAroundTypeEnhancement
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FULL_JDK
|
||||
|
||||
// FILE: MapLike.java
|
||||
import java.util.Map;
|
||||
|
||||
public interface MapLike<@org.jetbrains.annotations.NotNull K, V> {
|
||||
void putAll(Map<K, V> map);
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun test0(map : MapLike<Int?, Int>) {}
|
||||
fun <K> test11(map : MapLike<K, K>) {}
|
||||
fun <K> test12(map : MapLike<K?, K>) {}
|
||||
fun <K : Any> test13(map : MapLike<K, K>) {}
|
||||
fun <K : Any> test14(map : MapLike<K?, K>) {}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// !LANGUAGE: +ImprovementsAroundTypeEnhancement
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FULL_JDK
|
||||
|
||||
// FILE: MapLike.java
|
||||
import java.util.Map;
|
||||
|
||||
public interface MapLike<@org.jetbrains.annotations.NotNull K, V> {
|
||||
void putAll(Map<K, V> map);
|
||||
}
|
||||
|
||||
// FILE: main.kt
|
||||
fun test0(map : MapLike<<!UPPER_BOUND_VIOLATED!>Int?<!>, Int>) {}
|
||||
fun <K> test11(map : MapLike<<!UPPER_BOUND_VIOLATED!>K<!>, K>) {}
|
||||
fun <K> test12(map : MapLike<<!UPPER_BOUND_VIOLATED!>K?<!>, K>) {}
|
||||
fun <K : Any> test13(map : MapLike<K, K>) {}
|
||||
fun <K : Any> test14(map : MapLike<<!UPPER_BOUND_VIOLATED!>K?<!>, K>) {}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
package
|
||||
|
||||
public fun test0(/*0*/ map: MapLike<kotlin.Int?, kotlin.Int>): kotlin.Unit
|
||||
public fun </*0*/ K> test11(/*0*/ map: MapLike<K, K>): kotlin.Unit
|
||||
public fun </*0*/ K> test12(/*0*/ map: MapLike<K?, K>): kotlin.Unit
|
||||
public fun </*0*/ K : kotlin.Any> test13(/*0*/ map: MapLike<K, K>): kotlin.Unit
|
||||
public fun </*0*/ K : kotlin.Any> test14(/*0*/ map: MapLike<K?, K>): kotlin.Unit
|
||||
|
||||
public interface MapLike</*0*/ @org.jetbrains.annotations.NotNull K : kotlin.Any, /*1*/ V : kotlin.Any!> {
|
||||
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 abstract fun putAll(/*0*/ map: kotlin.collections.(Mutable)Map<K, V!>!): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
Generated
+6
@@ -34429,6 +34429,12 @@ public class DiagnosticTestGenerated extends AbstractDiagnosticTest {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/java/checkEnhancedUpperBounds.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("checkEnhancedUpperBoundsWithEnabledImprovements.kt")
|
||||
public void testCheckEnhancedUpperBoundsWithEnabledImprovements() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/java/checkEnhancedUpperBoundsWithEnabledImprovements.kt");
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestMetadata("concurrentHashMapContains.kt")
|
||||
public void testConcurrentHashMapContains() throws Exception {
|
||||
|
||||
Reference in New Issue
Block a user