Files
kotlin-fork/compiler/testData/diagnostics/testsWithStdLib/when/kt10807.txt
T
Dmitry Petrov 9db3440e72 Fix type inference issues for 'if' and 'when'.
Use 'expectedType' (when present) as an explicit type argument for a special construct call.
Unfortunately, this approach can't be used for elvis due to other elvis-related inference hacks.
Fixes KT-10807, KT-10811.
This also affects KT-6189: now we can infer proper type for 'if'.

If type inference for special call failed, and we found no type errors in sub-expressions,
report TYPE_INFERENCE_FAILED_ON_SPECIAL_CONSTRUCT error.
This (and the hack above) fixes KT-10809: code no longer compiles.
2016-01-27 17:07:20 +03:00

14 lines
545 B
Plaintext
Vendored

package
public fun getComp(): java.util.Comparator<Foo?>
public fun getCompInverted(): java.util.Comparator<Foo?>
public final class Foo {
public constructor Foo(/*0*/ a: kotlin.String, /*1*/ b: kotlin.Int)
public final val a: kotlin.String
public final val b: kotlin.Int
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
}