Removing usages of tuples from test data
(KT-2358 Drop tuples) #KT-2358 In progress
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
data class A(val x: Unit)
|
||||
|
||||
fun box(): String {
|
||||
val a = A(#())
|
||||
return if ("$a" == "A{x=()}") "OK" else "$a"
|
||||
val a = A(Unit.VALUE)
|
||||
return if ("$a" == "A{x=Unit.VALUE}") "OK" else "$a"
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
data class A(val x: Unit)
|
||||
|
||||
fun box(): String {
|
||||
val a = A(#())
|
||||
val a = A(Unit.VALUE)
|
||||
return if (a.component1() is Unit) "OK" else "Fail ${a.component1()}"
|
||||
}
|
||||
|
||||
@@ -1,3 +1,18 @@
|
||||
class T4(
|
||||
val c1: Boolean,
|
||||
val c2: Boolean,
|
||||
val c3: Boolean,
|
||||
val c4: String
|
||||
) {
|
||||
fun equals(o: Any?): Boolean {
|
||||
if (o !is T4) return false;
|
||||
return c1 == o.c1 &&
|
||||
c2 == o.c2 &&
|
||||
c3 == o.c3 &&
|
||||
c4 == o.c4
|
||||
}
|
||||
}
|
||||
|
||||
fun reformat(
|
||||
str : String,
|
||||
normalizeCase : Boolean = true,
|
||||
@@ -5,11 +20,11 @@ fun reformat(
|
||||
divideByCamelHumps : Boolean = true,
|
||||
wordSeparator : String = " "
|
||||
) =
|
||||
#(normalizeCase, uppercaseFirstLetter, divideByCamelHumps, wordSeparator)
|
||||
T4(normalizeCase, uppercaseFirstLetter, divideByCamelHumps, wordSeparator)
|
||||
|
||||
|
||||
fun box() : String {
|
||||
val expected = #(true, true, true, " ")
|
||||
val expected = T4(true, true, true, " ")
|
||||
if(reformat("", true, true, true, " ") != expected) return "fail"
|
||||
if(reformat("", true, true, true) != expected) return "fail"
|
||||
if(reformat("", true, true) != expected) return "fail"
|
||||
|
||||
@@ -2,17 +2,17 @@ import java.util.HashMap
|
||||
|
||||
fun parseCatalogs(hashMap: Any?) {
|
||||
val r = toHasMap(hashMap)
|
||||
if (!r._1) {
|
||||
if (!r.first) {
|
||||
return
|
||||
}
|
||||
val nodes = r._2
|
||||
val nodes = r.second
|
||||
}
|
||||
|
||||
fun toHasMap(value: Any?): #(Boolean, HashMap<String, Any?>?) {
|
||||
fun toHasMap(value: Any?): Pair<Boolean, HashMap<String, Any?>?> {
|
||||
if(value is HashMap<*, *>) {
|
||||
return #(true, value as HashMap<String, Any?>)
|
||||
return Pair(true, value as HashMap<String, Any?>)
|
||||
}
|
||||
return #(false, null as HashMap<String, Any?>?)
|
||||
return Pair(false, null as HashMap<String, Any?>?)
|
||||
}
|
||||
|
||||
fun box() : String {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fun box(): String {
|
||||
val a = if(true) {
|
||||
}
|
||||
return if (a.toString() == "()") "OK" else "fail"
|
||||
return if (a.toString() == "Unit.VALUE") "OK" else "fail"
|
||||
}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
fun main(args: Array<String>?) {
|
||||
val y: Unit = #() //do not compile
|
||||
val y: Unit = Unit.VALUE //do not compile
|
||||
A<Unit>() //do not compile
|
||||
C<Unit>(#()) //do not compile
|
||||
C<Unit>(Unit.VALUE) //do not compile
|
||||
//do not compile
|
||||
System.out?.println(fff<Unit>(#())) //do not compile
|
||||
System.out?.println(fff<Unit>(Unit.VALUE)) //do not compile
|
||||
System.out?.println(id<Unit>(y)) //do not compile
|
||||
System.out?.println(fff<Unit>(id<Unit>(y)) == id<Unit>(foreach(Array<Int>(0,{0}),{(e : Int) : Unit -> }))) //do not compile
|
||||
}
|
||||
|
||||
@@ -27,7 +27,7 @@ fun t1() : Boolean {
|
||||
x = x + "45" + y
|
||||
x = x.substring(3)
|
||||
x += "aaa"
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
foo()
|
||||
|
||||
@@ -43,7 +43,7 @@ fun t2() : Boolean {
|
||||
x = x + 5 + y
|
||||
x += 5
|
||||
x++
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
foo()
|
||||
x -= 55
|
||||
@@ -55,7 +55,7 @@ fun t3() : Boolean {
|
||||
var x = true
|
||||
val foo = {
|
||||
x = false
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
foo()
|
||||
return !x
|
||||
@@ -67,7 +67,7 @@ fun t4() : Boolean {
|
||||
val foo = {
|
||||
x = x + 200.toFloat() + y
|
||||
x += 18
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
foo()
|
||||
System.out?.println(x)
|
||||
@@ -80,7 +80,7 @@ fun t5() : Boolean {
|
||||
val foo = {
|
||||
x = x + 200.toDouble() + y
|
||||
x -= 22
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
foo()
|
||||
System.out?.println(x)
|
||||
@@ -94,7 +94,7 @@ fun t6() : Boolean {
|
||||
x = (x + 20.toByte() + y).toByte()
|
||||
x += 2
|
||||
x--
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
foo()
|
||||
System.out?.println(x)
|
||||
@@ -105,7 +105,7 @@ fun t7() : Boolean {
|
||||
var x : Char = 'a'
|
||||
val foo = {
|
||||
x = 'b'
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
foo()
|
||||
System.out?.println(x)
|
||||
@@ -117,10 +117,10 @@ fun t8() : Boolean {
|
||||
val foo = {
|
||||
val bar = {
|
||||
x = 30.toShort()
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
bar()
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
foo()
|
||||
return x == 30.toShort()
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
fun box() : String {
|
||||
val a = #(1, "2")
|
||||
if (a._1 != 1) return "Fail 1: ${a._1}"
|
||||
if (a._2 != "2") return "Fail 1: ${a._2}"
|
||||
return "OK"
|
||||
}
|
||||
@@ -18,7 +18,9 @@ package boundsWithSubstitutors
|
||||
open class A {}
|
||||
open class B<T : A>()
|
||||
|
||||
abstract class C<T : B<<!UPPER_BOUND_VIOLATED!>Int<!>>, X : (B<<!UPPER_BOUND_VIOLATED!>Char<!>>) -> #(B<<!UPPER_BOUND_VIOLATED!>Any<!>>, B<A>)>() : B<<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>Any<!>>() { // 2 errors
|
||||
class Pair<A, B>
|
||||
|
||||
abstract class C<T : B<<!UPPER_BOUND_VIOLATED!>Int<!>>, X : (B<<!UPPER_BOUND_VIOLATED!>Char<!>>) -> Pair<B<<!UPPER_BOUND_VIOLATED!>Any<!>>, B<A>>>() : B<<!UPPER_BOUND_VIOLATED, UPPER_BOUND_VIOLATED!>Any<!>>() { // 2 errors
|
||||
val a = B<<!UPPER_BOUND_VIOLATED!>Char<!>>() // error
|
||||
|
||||
abstract val x : (B<<!UPPER_BOUND_VIOLATED!>Char<!>>) -> B<<!UPPER_BOUND_VIOLATED!>Any<!>>
|
||||
|
||||
@@ -12,5 +12,5 @@ fun test() : Unit {
|
||||
y <!USELESS_CAST!>as?<!> Int : Int?
|
||||
x <!USELESS_CAST!>as?<!> Int? : Int?
|
||||
y <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as?<!> Int? : Int?
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -4,7 +4,7 @@ fun unitEmptyInfer() {}
|
||||
fun unitEmpty() : Unit {}
|
||||
fun unitEmptyReturn() : Unit {return}
|
||||
fun unitIntReturn() : Unit {return <!TYPE_MISMATCH!>1<!>}
|
||||
fun unitUnitReturn() : Unit {return #()}
|
||||
fun unitUnitReturn() : Unit {return Unit.VALUE}
|
||||
fun test1() : Any = {<!RETURN_NOT_ALLOWED, RETURN_TYPE_MISMATCH!>return<!>}
|
||||
fun test2() : Any = @a {return@a 1}
|
||||
fun test3() : Any { <!RETURN_TYPE_MISMATCH!>return<!> }
|
||||
@@ -25,7 +25,7 @@ fun foo(<!UNUSED_PARAMETER!>expr<!>: StringBuilder): Int {
|
||||
}
|
||||
|
||||
|
||||
fun unitShort() : Unit = #()
|
||||
fun unitShort() : Unit = Unit.VALUE
|
||||
fun unitShortConv() : Unit = <!TYPE_MISMATCH!>1<!>
|
||||
fun unitShortNull() : Unit = <!TYPE_MISMATCH!>null<!>
|
||||
|
||||
@@ -42,7 +42,7 @@ fun intFunctionLiteral(): Int = <!TYPE_MISMATCH!>{ 10 }<!>
|
||||
fun blockReturnUnitMismatch() : Int {<!RETURN_TYPE_MISMATCH!>return<!>}
|
||||
fun blockReturnValueTypeMismatch() : Int {return <!ERROR_COMPILE_TIME_VALUE!>3.4<!>}
|
||||
fun blockReturnValueTypeMatch() : Int {return 1}
|
||||
fun blockReturnValueTypeMismatchUnit() : Int {return <!TYPE_MISMATCH!>#()<!>}
|
||||
fun blockReturnValueTypeMismatchUnit() : Int {return <!TYPE_MISMATCH!>Unit.VALUE<!>}
|
||||
|
||||
fun blockAndAndMismatch() : Int {
|
||||
true && false
|
||||
|
||||
@@ -36,9 +36,12 @@ class D() {
|
||||
}
|
||||
}
|
||||
|
||||
fun foo(): Unit {}
|
||||
|
||||
fun cannotBe(var <!UNUSED_PARAMETER!>i<!>: Int) {
|
||||
<!UNRESOLVED_REFERENCE!>z<!> = 30;
|
||||
<!VARIABLE_EXPECTED!>#()<!> = #();
|
||||
<!VARIABLE_EXPECTED!>""<!> = "";
|
||||
<!VARIABLE_EXPECTED!>foo()<!> = Unit.VALUE;
|
||||
|
||||
(<!VARIABLE_EXPECTED!>i <!USELESS_CAST!>as<!> Int<!>) = 34
|
||||
(<!VARIABLE_EXPECTED!>i is Int<!>) = false
|
||||
|
||||
@@ -38,28 +38,28 @@ fun test() {
|
||||
out.println();
|
||||
}
|
||||
|
||||
if (out == null || out.println(0) == #()) {
|
||||
if (out == null || out.println(0) == Unit.VALUE) {
|
||||
out?.println(1)
|
||||
}
|
||||
else {
|
||||
out.println(2)
|
||||
}
|
||||
|
||||
if (out != null && out.println() == #()) {
|
||||
if (out != null && out.println() == Unit.VALUE) {
|
||||
out.println();
|
||||
}
|
||||
else {
|
||||
out?.println();
|
||||
}
|
||||
|
||||
if (out == null || out.println() == #()) {
|
||||
if (out == null || out.println() == Unit.VALUE) {
|
||||
out?.println();
|
||||
}
|
||||
else {
|
||||
out.println();
|
||||
}
|
||||
|
||||
if (1 == 2 || out != null && out.println(1) == #()) {
|
||||
if (1 == 2 || out != null && out.println(1) == Unit.VALUE) {
|
||||
out?.println(2);
|
||||
}
|
||||
else {
|
||||
@@ -94,28 +94,28 @@ fun test() {
|
||||
out.println();
|
||||
}
|
||||
|
||||
if (out == null || out.println(0) == #()) {
|
||||
if (out == null || out.println(0) == Unit.VALUE) {
|
||||
out?.println(1)
|
||||
}
|
||||
else {
|
||||
out.println(2)
|
||||
}
|
||||
|
||||
if (out != null && out.println() == #()) {
|
||||
if (out != null && out.println() == Unit.VALUE) {
|
||||
out.println();
|
||||
}
|
||||
else {
|
||||
out?.println();
|
||||
}
|
||||
|
||||
if (out == null || out.println() == #()) {
|
||||
if (out == null || out.println() == Unit.VALUE) {
|
||||
out?.println();
|
||||
}
|
||||
else {
|
||||
out.println();
|
||||
}
|
||||
|
||||
if (1 == 2 || out != null && out.println(1) == #()) {
|
||||
if (1 == 2 || out != null && out.println(1) == Unit.VALUE) {
|
||||
out?.println(2);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -34,7 +34,7 @@ class A<E>() : C(), T {
|
||||
super<<!NOT_A_SUPERTYPE!>Int<!>>.foo()
|
||||
super<<!SYNTAX!><!>>.foo()
|
||||
super<<!NOT_A_SUPERTYPE!>() -> Unit<!>>.foo()
|
||||
super<<!NOT_A_SUPERTYPE!>#()<!>>.foo()
|
||||
super<<!NOT_A_SUPERTYPE!>Unit<!>>.foo()
|
||||
super<T><!UNRESOLVED_REFERENCE!>@B<!>.foo()
|
||||
super<C><!UNRESOLVED_REFERENCE!>@B<!>.bar()
|
||||
}
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
package unresolved
|
||||
|
||||
class Pair<A, B>(val a: A, val b: B)
|
||||
|
||||
fun testGenericArgumentsCount() {
|
||||
val <!UNUSED_VARIABLE!>p1<!>: Tuple2<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int><!> = #(2, 2)
|
||||
val <!UNUSED_VARIABLE!>p2<!>: <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Tuple2<!> = #(2, 2)
|
||||
val <!UNUSED_VARIABLE!>p1<!>: Pair<!WRONG_NUMBER_OF_TYPE_ARGUMENTS!><Int><!> = Pair(2, 2)
|
||||
val <!UNUSED_VARIABLE!>p2<!>: <!WRONG_NUMBER_OF_TYPE_ARGUMENTS!>Pair<!> = Pair(2, 2)
|
||||
}
|
||||
|
||||
fun testUnresolved() {
|
||||
|
||||
@@ -41,6 +41,4 @@ fun test() {
|
||||
when (z) {
|
||||
else -> 1
|
||||
}
|
||||
}
|
||||
|
||||
val #(Int, Int).boo : #(Int, Int, Int) = #(1, 1, 1)
|
||||
}
|
||||
@@ -1,12 +1,14 @@
|
||||
//KT-657 Semantic checks for when without condition
|
||||
package kt657
|
||||
|
||||
class Pair<A, B>(a: A, b: B)
|
||||
|
||||
fun foo() =
|
||||
when {
|
||||
cond1() -> 12
|
||||
cond2() -> 2
|
||||
<!TYPE_MISMATCH_IN_CONDITION!>4<!> -> 34
|
||||
<!TYPE_MISMATCH_IN_CONDITION!>#(1, 2)<!> -> 3
|
||||
<!TYPE_MISMATCH_IN_CONDITION!>Pair(1, 2)<!> -> 3
|
||||
<!EXPECTED_CONDITION!>in 1..10<!> -> 34
|
||||
<!TYPE_MISMATCH_IN_CONDITION!>4<!> -> 38
|
||||
<!EXPECTED_CONDITION!>is Int<!> -> 33
|
||||
|
||||
@@ -3,17 +3,18 @@
|
||||
|
||||
package kt234_kt973
|
||||
|
||||
class Pair<A, B>(a: A, b: B)
|
||||
|
||||
fun test(t : #(Int, Int)) : Int {
|
||||
fun test(t : Pair<Int, Int>) : Int {
|
||||
<!NO_ELSE_IN_WHEN!>when<!> (t) {
|
||||
#(10, 10) -> return 1
|
||||
Pair(10, 10) -> return 1
|
||||
}
|
||||
return 0 // unreachable code
|
||||
}
|
||||
|
||||
fun test1(t : #(Int, Int)) : Int {
|
||||
fun test1(t : Pair<Int, Int>) : Int {
|
||||
when (t) {
|
||||
#(10, 10) -> return 1
|
||||
Pair(10, 10) -> return 1
|
||||
else -> return 2
|
||||
}
|
||||
<!UNREACHABLE_CODE!>return 0<!> // unreachable code
|
||||
|
||||
@@ -1,7 +0,0 @@
|
||||
class C(val f : Int)
|
||||
|
||||
fun test(e : Any) {
|
||||
if (e is C) {
|
||||
#(e.f)
|
||||
}
|
||||
}
|
||||
@@ -2,7 +2,7 @@
|
||||
package outer
|
||||
|
||||
fun Int?.optint() : Unit {}
|
||||
val Int?.optval : Unit = #()
|
||||
val Int?.optval : Unit = Unit.VALUE
|
||||
|
||||
fun <T, E> T.foo(<!UNUSED_PARAMETER!>x<!> : E, y : A) : T {
|
||||
y.plus(1)
|
||||
|
||||
@@ -20,7 +20,7 @@ fun f9(init : A?) {
|
||||
a?.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
a?.foo()
|
||||
}
|
||||
if (!(a is B) || a.bar() == #()) {
|
||||
if (!(a is B) || a.bar() == Unit.VALUE) {
|
||||
a?.<!UNRESOLVED_REFERENCE!>bar<!>()
|
||||
}
|
||||
if (!(a is B)) {
|
||||
@@ -102,7 +102,7 @@ fun f13(a : A?) {
|
||||
}
|
||||
|
||||
a?.foo()
|
||||
if (a is B && a.foo() == #()) {
|
||||
if (a is B && a.foo() == Unit.VALUE) {
|
||||
a.foo()
|
||||
a.bar()
|
||||
}
|
||||
@@ -153,7 +153,7 @@ fun illegalWhenBlock(a: Any): Int {
|
||||
}
|
||||
fun declarations(a: Any?) {
|
||||
if (a is String) {
|
||||
val <!UNUSED_VARIABLE!>p4<!>: #(Int, String) = #(2, a)
|
||||
val <!UNUSED_VARIABLE!>p4<!>: String = a
|
||||
}
|
||||
if (a is String?) {
|
||||
if (a != null) {
|
||||
@@ -172,25 +172,6 @@ fun vars(a: Any?) {
|
||||
b = <!UNUSED_VALUE!>a<!>
|
||||
}
|
||||
}
|
||||
fun tuples(a: Any?) {
|
||||
if (a != null) {
|
||||
val <!UNUSED_VARIABLE!>s<!>: #(Any, String) = #(a, <!TYPE_MISMATCH!>a<!>)
|
||||
}
|
||||
if (a is String) {
|
||||
val <!UNUSED_VARIABLE!>s<!>: #(Any, String) = #(a, a)
|
||||
}
|
||||
fun illegalTupleReturnType(): #(Any, String) = #(<!TYPE_MISMATCH!>a<!>, <!TYPE_MISMATCH!>a<!>)
|
||||
if (a is String) {
|
||||
fun legalTupleReturnType(): #(Any, String) = #(a, a)
|
||||
}
|
||||
val <!UNUSED_VARIABLE!>illegalFunctionLiteral<!>: Function0<Int> = <!TYPE_MISMATCH!>{ <!TYPE_MISMATCH!>a<!> }<!>
|
||||
val <!UNUSED_VARIABLE!>illegalReturnValueInFunctionLiteral<!>: Function0<Int> = { (): Int -> <!TYPE_MISMATCH!>a<!> }
|
||||
|
||||
if (a is Int) {
|
||||
val <!UNUSED_VARIABLE!>legalFunctionLiteral<!>: Function0<Int> = { a }
|
||||
val <!UNUSED_VARIABLE!>alsoLegalFunctionLiteral<!>: Function0<Int> = { (): Int -> a }
|
||||
}
|
||||
}
|
||||
fun returnFunctionLiteralBlock(a: Any?): Function0<Int> {
|
||||
if (a is Int) return { a }
|
||||
else return { 1 }
|
||||
@@ -199,8 +180,6 @@ fun returnFunctionLiteral(a: Any?): Function0<Int> =
|
||||
if (a is Int) { (): Int -> a }
|
||||
else { () -> 1 }
|
||||
|
||||
fun illegalTupleReturnType(a: Any): #(Any, String) = #(a, <!TYPE_MISMATCH!>a<!>)
|
||||
|
||||
fun mergeAutocasts(a: Any?) {
|
||||
if (a is String || a is Int) {
|
||||
a.<!UNRESOLVED_REFERENCE!>compareTo<!>("")
|
||||
|
||||
@@ -8,5 +8,5 @@ public abstract class Aaa {
|
||||
// FILE: bbb.kt
|
||||
|
||||
class Bbb() : Aaa() {
|
||||
override fun foo(vararg args: String?) = #()
|
||||
override fun foo(vararg args: String?) = Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -2,11 +2,13 @@ package a
|
||||
|
||||
//KT-2234 'period!!' has type Int?
|
||||
|
||||
class Pair<A, B>(val a: A, val b: B)
|
||||
|
||||
fun main(args : Array<String>) {
|
||||
val d : Long = 1
|
||||
val period : Int? = null
|
||||
if (period != null) #(d, period<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!> : Int) else #(d, 1)
|
||||
if (period != null) #(d, period : Int) else #(d, 1)
|
||||
if (period != null) Pair(d, period<!UNNECESSARY_NOT_NULL_ASSERTION!>!!<!> : Int) else Pair(d, 1)
|
||||
if (period != null) Pair(d, period : Int) else Pair(d, 1)
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
|
||||
@@ -4,12 +4,12 @@ trait Bar
|
||||
trait A {
|
||||
fun <T> foo()
|
||||
where T : Foo, T : Bar
|
||||
= #()
|
||||
= Unit.VALUE
|
||||
}
|
||||
|
||||
class B : A {
|
||||
override fun <T> foo()
|
||||
where T : Foo, T : Bar
|
||||
= #()
|
||||
= Unit.VALUE
|
||||
|
||||
}
|
||||
@@ -15,8 +15,8 @@ open class MyClass() : MyTrait, MyAbstractClass() {
|
||||
override fun foo() {}
|
||||
override fun bar() {}
|
||||
|
||||
override val pr : Unit = #()
|
||||
override val prr : Unit = #()
|
||||
override val pr : Unit = Unit.VALUE
|
||||
override val prr : Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
class MyChildClass() : MyClass() {}
|
||||
@@ -25,14 +25,14 @@ class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>MyIllegalClass<!> : MyTrait, MyAbstract
|
||||
|
||||
class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>MyIllegalClass2<!>() : MyTrait, MyAbstractClass() {
|
||||
override fun foo() {}
|
||||
override val pr : Unit = #()
|
||||
override val prr : Unit = #()
|
||||
override val pr : Unit = Unit.VALUE
|
||||
override val prr : Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>MyIllegalClass3<!>() : MyTrait, MyAbstractClass() {
|
||||
override fun bar() {}
|
||||
override val pr : Unit = #()
|
||||
override val prr : Unit = #()
|
||||
override val pr : Unit = Unit.VALUE
|
||||
override val prr : Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>MyIllegalClass4<!>() : MyTrait, MyAbstractClass() {
|
||||
@@ -44,7 +44,7 @@ class <!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>MyIllegalClass4<!>() : MyTrait, MyAbstr
|
||||
|
||||
class MyChildClass1() : MyClass() {
|
||||
<!VIRTUAL_MEMBER_HIDDEN!>fun foo()<!> {}
|
||||
<!VIRTUAL_MEMBER_HIDDEN!>val pr : Unit<!> = #()
|
||||
<!VIRTUAL_MEMBER_HIDDEN!>val pr : Unit<!> = Unit.VALUE
|
||||
override fun bar() {}
|
||||
override val prr : Unit = #()
|
||||
override val prr : Unit = Unit.VALUE
|
||||
}
|
||||
@@ -20,7 +20,7 @@ fun foo(a: A) {
|
||||
a.gen() // unit can be inferred
|
||||
}
|
||||
else {
|
||||
#()
|
||||
Unit.VALUE
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
import java.util.ArrayList
|
||||
|
||||
class MyListOfPairs<T> : ArrayList<#(T, T)>() { }
|
||||
class Pair<A, B>(val a: A, val b: B)
|
||||
|
||||
class MyListOfPairs<T> : ArrayList<Pair<T, T>>() { }
|
||||
|
||||
fun test() {
|
||||
MyListOfPairs<Int>() : ArrayList<#(Int, Int)>
|
||||
MyListOfPairs<Int>() : ArrayList<Pair<Int, Int>>
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
fun foo(a : #(Int, String)) {
|
||||
a._1 : Int
|
||||
a._2 : String
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public open class MethodTypePOneUpperBound() : java.lang.Object() {
|
||||
public open fun <T : Cloneable?> bar() : Unit = #()
|
||||
public open fun <T : Cloneable?> bar() : Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public class MethodWithTypeP() : java.lang.Object() {
|
||||
public fun <P> f() : Unit = #()
|
||||
public fun <P> f() : Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public class MethodWithTypePP() : java.lang.Object() {
|
||||
public fun <P, Q : P> f() : Unit = #()
|
||||
public fun <P, Q : P> f() : Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public open class MethodWithTypePRefClassP<P>() : java.lang.Object() {
|
||||
public fun <Q : P> f() : Unit = #()
|
||||
public fun <Q : P> f() : Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public final class MethosWithPRefTP() : java.lang.Object() {
|
||||
public fun <P> f(p0: P?) : Unit = #()
|
||||
public fun <P> f(p0: P?) : Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public open class VarargInt() : java.lang.Object() {
|
||||
public open fun vararg(vararg p0: Int): Unit = #()
|
||||
public open fun vararg(vararg p0: Int): Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package test
|
||||
|
||||
public open class VarargString() : java.lang.Object() {
|
||||
public open fun vararg(vararg p0: String?): Unit = #()
|
||||
public open fun vararg(vararg p0: String?): Unit = Unit.VALUE
|
||||
}
|
||||
|
||||
@@ -5,4 +5,4 @@ trait Bar
|
||||
|
||||
fun <T> foo()
|
||||
where T : Foo, T : Bar
|
||||
= #()
|
||||
= Unit.VALUE
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
package test
|
||||
|
||||
fun tuple0() = #()
|
||||
fun tuple0() = Unit.VALUE
|
||||
|
||||
@@ -2,20 +2,8 @@ var v1 : Tuple0
|
||||
var v2 : Tuple0?
|
||||
var v3 : Unit
|
||||
var v4 : Unit?
|
||||
var v5 : #()
|
||||
var v6 : #(Int)
|
||||
var v7 : #(Int)?
|
||||
var v8 : #(Int, String, String)
|
||||
var v9 : Tuple2<Int, String>
|
||||
var v10 : Tuple3<Int, Int, Int>?
|
||||
|
||||
//internal final var v1 : Unit defined in root package
|
||||
//internal final var v2 : Unit? defined in root package
|
||||
//internal final var v3 : Unit defined in root package
|
||||
//internal final var v4 : Unit? defined in root package
|
||||
//internal final var v5 : Unit defined in root package
|
||||
//internal final var v6 : #(jet.Int) defined in root package
|
||||
//internal final var v7 : #(jet.Int)? defined in root package
|
||||
//internal final var v8 : #(jet.Int, jet.String, jet.String) defined in root package
|
||||
//internal final var v9 : #(jet.Int, jet.String) defined in root package
|
||||
//internal final var v10 : #(jet.Int, jet.Int, jet.Int)? defined in root package
|
||||
|
||||
Reference in New Issue
Block a user