e6b5cb5216
Update includes:
- Changing syntax of `OI/`NI` tags from `<!NI;TAG!>` to `<!TAG{NI}!>`
- Fix some incorrect directives
- Change order of diagnostics in some places
- Remove ignored diagnostics from FIR test data (previously `DIAGNOSTICS` didn't work)
- Update FIR dumps in some places and add `FIR_IDENTICAL` if needed
- Replace all JAVAC_SKIP with SKIP_JAVAC directive
32 lines
1.4 KiB
Kotlin
Vendored
32 lines
1.4 KiB
Kotlin
Vendored
// !WITH_NEW_INFERENCE
|
|
// !CHECK_TYPE
|
|
// !DIAGNOSTICS: -UNUSED_PARAMETER, -UNUSED_VARIABLE
|
|
|
|
class Wrapper
|
|
|
|
fun <R, S> Wrapper.foo(x: R): S = TODO()
|
|
fun Wrapper.fooIntString(x: Int): String = ""
|
|
fun <T> Wrapper.fooReturnString(x: T): String = ""
|
|
fun <T> Wrapper.fooTakeInt(x: Int): T = TODO()
|
|
|
|
fun <T, R, S> bar(f: T.(R) -> S): Tripple<T, R, S> = TODO()
|
|
fun <T, R, S> baz(x: T, y: R, z: S, f: T.(R) -> S): Tripple<T, R, S> = TODO()
|
|
|
|
class Tripple<A, B, C>(val a: A, val b: B, val c: C)
|
|
|
|
fun test1() {
|
|
val x: Wrapper.(String) -> Boolean = Wrapper::foo
|
|
bar<Wrapper, Double, Float>(Wrapper::foo).checkType { _<Tripple<Wrapper, Double, Float>>() }
|
|
bar(Wrapper::fooIntString).checkType { _<Tripple<Wrapper, Int, String>>() }
|
|
}
|
|
|
|
fun <T> test2() {
|
|
bar<Wrapper, Int, String>(Wrapper::fooReturnString).checkType { _<Tripple<Wrapper, Int, String>>() }
|
|
bar<Wrapper, T, String>(Wrapper::fooReturnString).checkType { _<Tripple<Wrapper, T, String>>() }
|
|
bar<Wrapper, T, T>(<!TYPE_MISMATCH{NI}!>Wrapper::<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH{OI}!>fooReturnString<!><!>)
|
|
bar<Wrapper, Int, Int>(<!TYPE_MISMATCH{NI}!>Wrapper::<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH{OI}!>fooReturnString<!><!>)
|
|
|
|
bar<Wrapper, Int, T>(Wrapper::fooTakeInt).checkType { _<Tripple<Wrapper, Int, T>>() }
|
|
bar<Wrapper, Int, String>(Wrapper::fooTakeInt).checkType { _<Tripple<Wrapper, Int, String>>() }
|
|
}
|