Removing usages of tuples from test data
(KT-2358 Drop tuples) #KT-2358 In progress
This commit is contained in:
@@ -19,7 +19,7 @@ fun f9(a : A?) {
|
||||
a<info>?.</info><error descr="[UNRESOLVED_REFERENCE] Unresolved reference: bar">bar</error>()
|
||||
a<info>?.</info>foo()
|
||||
}
|
||||
if (!(a is B) || <info descr="Automatically cast to B">a</info>.bar() == #()) {
|
||||
if (!(a is B) || <info descr="Automatically cast to B">a</info>.bar() == Unit.VALUE) {
|
||||
a<info>?.</info><error descr="[UNRESOLVED_REFERENCE] Unresolved reference: bar">bar</error>()
|
||||
}
|
||||
if (!(a is B)) {
|
||||
@@ -97,7 +97,7 @@ fun f13(a : A?) {
|
||||
}
|
||||
|
||||
a<info>?.</info>foo()
|
||||
if (a is B && <info descr="Automatically cast to B">a</info>.foo() == #()) {
|
||||
if (a is B && <info descr="Automatically cast to B">a</info>.foo() == Unit.VALUE) {
|
||||
<info descr="Automatically cast to B">a</info>.foo()
|
||||
<info descr="Automatically cast to B">a</info>.bar()
|
||||
}
|
||||
@@ -149,7 +149,7 @@ fun illegalWhenBlock(a: Any): Int {
|
||||
}
|
||||
fun declarations(a: Any?) {
|
||||
if (a is String) {
|
||||
val <warning>p4</warning>: #(Int, String) = #(2, <info descr="Automatically cast to jet.String">a</info>)
|
||||
val <warning>p4</warning>: String = <info descr="Automatically cast to jet.String">a</info>
|
||||
}
|
||||
if (a is String?) {
|
||||
if (a != null) {
|
||||
@@ -168,25 +168,6 @@ fun vars(a: Any?) {
|
||||
b = <info descr="Automatically cast to jet.Int"><warning>a</warning></info>
|
||||
}
|
||||
}
|
||||
fun tuples(<info>a</info>: Any?) {
|
||||
if (<info>a</info> != null) {
|
||||
val <warning>s</warning>: #(Any, String) = #(<info descr="Automatically cast to jet.Any"><info>a</info></info>, <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is jet.Any? but jet.String was expected">a</error>)
|
||||
}
|
||||
if (<info>a</info> is String) {
|
||||
val <warning>s</warning>: #(Any, String) = #(<info descr="Automatically cast to jet.Any"><info>a</info></info>, <info descr="Automatically cast to jet.String"><info>a</info></info>)
|
||||
}
|
||||
fun illegalTupleReturnType(): #(Any, String) = #(<error descr="[TYPE_MISMATCH] Type mismatch: inferred type is jet.Any? but jet.Any was expected">a</error>, <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is jet.Any? but jet.String was expected">a</error>)
|
||||
if (<info>a</info> is String) {
|
||||
fun legalTupleReturnType(): #(Any, String) = #(<info descr="Automatically cast to jet.Any"><info>a</info></info>, <info descr="Automatically cast to jet.String"><info>a</info></info>)
|
||||
}
|
||||
val <warning>illegalFunctionLiteral</warning>: Function0<Int> = <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is () -> jet.Any? but () -> jet.Int was expected">{ <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is jet.Any? but jet.Int was expected">a</error> }</error>
|
||||
val <warning>illegalReturnValueInFunctionLiteral</warning>: Function0<Int> = { (): Int -> <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is jet.Any? but jet.Int was expected">a</error> }
|
||||
|
||||
if (<info>a</info> is Int) {
|
||||
val <warning>legalFunctionLiteral</warning>: Function0<Int> = { <info><info descr="Automatically cast to jet.Int">a</info></info> }
|
||||
val <warning>alsoLegalFunctionLiteral</warning>: Function0<Int> = { (): Int -> <info descr="Automatically cast to jet.Int"><info>a</info></info> }
|
||||
}
|
||||
}
|
||||
fun returnFunctionLiteralBlock(<info>a</info>: Any?): Function0<Int> {
|
||||
if (<info>a</info> is Int) return { <info><info descr="Automatically cast to jet.Int">a</info></info> }
|
||||
else return { 1 }
|
||||
@@ -195,8 +176,6 @@ fun returnFunctionLiteral(<info>a</info>: Any?): Function0<Int> =
|
||||
if (<info>a</info> is Int) { (): Int -> <info descr="Automatically cast to jet.Int"><info>a</info></info> }
|
||||
else { () -> 1 }
|
||||
|
||||
fun illegalTupleReturnType(a: Any): #(Any, String) = #(a, <error descr="[TYPE_MISMATCH] Type mismatch: inferred type is jet.Any but jet.String was expected">a</error>)
|
||||
|
||||
fun mergeAutocasts(a: Any?) {
|
||||
if (a is String || a is Int) {
|
||||
a.<error descr="[UNRESOLVED_REFERENCE] Unresolved reference: compareTo">compareTo</error>("")
|
||||
|
||||
Reference in New Issue
Block a user