Skip to content

Commit 7d89676

Browse files
committed
Temporarily copies few tests from previous version
1 parent 844ce9e commit 7d89676

File tree

9 files changed

+148
-4
lines changed

9 files changed

+148
-4
lines changed

kotlin-eclipse-ui-test/src/org/jetbrains/kotlin/core/tests/diagnostics/KotlinDiagnosticsTest.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -465,12 +465,12 @@ public void testRecursiveTypeInference() throws Exception {
465465

466466
@Test
467467
public void testResolveOfJavaGenerics() throws Exception {
468-
doTest("common_testData/compiler/diagnostics/tests/ResolveOfJavaGenerics.kt");
468+
doTest("testData/compiler/diagnostics/tests/ResolveOfJavaGenerics.kt");
469469
}
470470

471471
@Test
472472
public void testResolveToJava() throws Exception {
473-
doTest("common_testData/compiler/diagnostics/tests/ResolveToJava.kt");
473+
doTest("testData/compiler/diagnostics/tests/ResolveToJava.kt");
474474
}
475475

476476
@Test
@@ -521,7 +521,7 @@ public void testShiftFunctionTypes() throws Exception {
521521

522522
@Test
523523
public void testStarsInFunctionCalls() throws Exception {
524-
doTest("common_testData/compiler/diagnostics/tests/StarsInFunctionCalls.kt");
524+
doTest("testData/compiler/diagnostics/tests/StarsInFunctionCalls.kt");
525525
}
526526

527527
@Test
@@ -562,7 +562,7 @@ public void testTraitWithConstructor() throws Exception {
562562

563563
@Test
564564
public void testTypeInference() throws Exception {
565-
doTest("common_testData/compiler/diagnostics/tests/TypeInference.kt");
565+
doTest("testData/compiler/diagnostics/tests/TypeInference.kt");
566566
}
567567

568568
@Test
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
// !WITH_NEW_INFERENCE
2+
// Fixpoint generic in Java: Enum<T extends Enum<T>>
3+
fun test(<!UNUSED_PARAMETER!>a<!> : java.lang.annotation.RetentionPolicy) {
4+
5+
}
6+
7+
fun test() {
8+
java.util.Collections.<!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>()
9+
val <!UNUSED_VARIABLE!>a<!> : Collection<String>? = java.util.Collections.emptyList()
10+
}
11+
12+
fun test(<!UNUSED_PARAMETER!>a<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Comparable<Int><!>) {
13+
14+
}
15+
16+
fun test(<!UNUSED_PARAMETER!>a<!> : java.util.ArrayList<Int>) {
17+
18+
}
19+
20+
fun test(<!UNUSED_PARAMETER!>a<!> : java.lang.Class<Int>) {
21+
22+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package
2+
3+
public fun test(): kotlin.Unit
4+
public fun test(/*0*/ a: java.lang.Class<kotlin.Int>): kotlin.Unit
5+
public fun test(/*0*/ a: java.lang.Comparable<kotlin.Int>): kotlin.Unit
6+
public fun test(/*0*/ a: java.lang.annotation.RetentionPolicy): kotlin.Unit
7+
public fun test(/*0*/ a: java.util.ArrayList<kotlin.Int>): kotlin.Unit
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
// !WITH_NEW_INFERENCE
2+
// !CHECK_TYPE
3+
// JAVAC_SKIP
4+
5+
// FILE: f.kt
6+
7+
import java.*
8+
import java.util.*
9+
import <!UNRESOLVED_REFERENCE!>utils<!>.*
10+
11+
import java.io.PrintStream
12+
import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Comparable<!> as Com
13+
14+
val l : MutableList<in Int> = ArrayList<Int>()
15+
16+
fun test(<!UNUSED_PARAMETER!>l<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>) {
17+
val <!UNUSED_VARIABLE!>x<!> : java.<!UNRESOLVED_REFERENCE!>List<!>
18+
val <!UNUSED_VARIABLE!>y<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.util.List<Int><!>
19+
val <!UNUSED_VARIABLE!>b<!> : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Object<!>
20+
val <!UNUSED_VARIABLE!>z<!> : java.<!UNRESOLVED_REFERENCE!>utils<!>.<!DEBUG_INFO_MISSING_UNRESOLVED!>List<!><Int>
21+
22+
val <!UNUSED_VARIABLE!>f<!> : java.io.File? = null
23+
24+
Collections.<!FUNCTION_CALL_EXPECTED, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>
25+
Collections.<!FUNCTION_CALL_EXPECTED!>emptyList<Int><!>
26+
Collections.emptyList<Int>()
27+
Collections.<!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>()
28+
29+
checkSubtype<Set<Int>?>(Collections.singleton<Int>(1))
30+
Collections.singleton<Int>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>1.0<!>)
31+
32+
<!RESOLUTION_TO_CLASSIFIER!>List<!><Int>
33+
34+
35+
val <!UNUSED_VARIABLE!>o<!> = "sdf" as <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Object<!>
36+
37+
try {
38+
// ...
39+
}
40+
catch(e: Exception) {
41+
System.out.println(e.message)
42+
}
43+
44+
PrintStream("sdf")
45+
46+
val c : <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Com<Int><!>? = null
47+
48+
checkSubtype<<!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Comparable<Int><!>?>(c)
49+
50+
// Collections.sort<Integer>(ArrayList<Integer>())
51+
xxx.<!UNRESOLVED_REFERENCE!>Class<!>()
52+
}
53+
54+
55+
// FILE: f.kt
56+
package xxx
57+
import java.lang.Class;
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
package
2+
3+
public val l: kotlin.collections.MutableList<in kotlin.Int>
4+
public fun test(/*0*/ l: java.util.List<kotlin.Int>): kotlin.Unit
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// !WITH_NEW_INFERENCE
2+
3+
fun <T> getT() {}
4+
fun <A, B> getTT() {}
5+
fun <A, B, C> getTTT(<!UNUSED_PARAMETER!>x<!> : Any) {}
6+
fun foo(<!UNUSED_PARAMETER!>a<!> : Any?) {}
7+
8+
public fun main() {
9+
getT<<!PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT!>*<!>>()
10+
<!UNRESOLVED_REFERENCE!>ggetT<!><<!PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT!>*<!>>()
11+
getTT<<!PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT!>*<!>, <!PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT!>*<!>>()
12+
getTT<<!PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT!>*<!>, Int>()
13+
getTT<Int, <!PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT!>*<!>>()
14+
foo(getTTT<Int, <!PROJECTION_ON_NON_CLASS_TYPE_ARGUMENT!>*<!>, Int>(1))
15+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
package
2+
3+
public fun foo(/*0*/ a: kotlin.Any?): kotlin.Unit
4+
public fun </*0*/ T> getT(): kotlin.Unit
5+
public fun </*0*/ A, /*1*/ B> getTT(): kotlin.Unit
6+
public fun </*0*/ A, /*1*/ B, /*2*/ C> getTTT(/*0*/ x: kotlin.Any): kotlin.Unit
7+
public fun main(): kotlin.Unit
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
// !WITH_NEW_INFERENCE
2+
class C<T>() {
3+
fun foo() : T {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
4+
}
5+
6+
fun foo(<!UNUSED_PARAMETER!>c<!>: C<Int>) {}
7+
fun <T> bar() : C<T> {<!NO_RETURN_IN_FUNCTION_WITH_BLOCK_BODY!>}<!>
8+
9+
fun main() {
10+
val <!UNUSED_VARIABLE!>a<!> : C<Int> = C();
11+
val <!UNUSED_VARIABLE!>x<!> : C<in String> = C()
12+
val <!UNUSED_VARIABLE!>y<!> : C<out String> = C()
13+
val <!UNUSED_VARIABLE!>z<!> : C<*> = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>C<!>()
14+
15+
val <!UNUSED_VARIABLE!>ba<!> : C<Int> = bar();
16+
val <!UNUSED_VARIABLE!>bx<!> : C<in String> = bar()
17+
val <!UNUSED_VARIABLE!>by<!> : C<out String> = bar()
18+
val <!UNUSED_VARIABLE!>bz<!> : C<*> = <!OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>bar<!>()
19+
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
package
2+
3+
public fun </*0*/ T> bar(): C<T>
4+
public fun foo(/*0*/ c: C<kotlin.Int>): kotlin.Unit
5+
public fun main(): kotlin.Unit
6+
7+
public final class C</*0*/ T> {
8+
public constructor C</*0*/ T>()
9+
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
10+
public final fun foo(): T
11+
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
12+
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
13+
}

0 commit comments

Comments
 (0)