NI: Add flexible Nothing to trivial constraints to filter it

This commit is contained in:
victor.petukhov
2019-12-11 16:56:12 +03:00
parent 2d5a05466d
commit 71cb65c064
7 changed files with 31 additions and 2 deletions
@@ -20,7 +20,7 @@ public class Foo {
// FILE: test.kt
fun test(e: <!UNRESOLVED_REFERENCE!>ErrorType<!>) {
Foo.foo {
Foo.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!> {
Sam.Result.create(<!DEBUG_INFO_ELEMENT_WITH_ERROR_TYPE!>e<!>)
}
}
@@ -0,0 +1,11 @@
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNCHECKED_CAST -UNUSED_PARAMETER
// !LANGUAGE: +NewInference
// SKIP_TXT
import java.util.*
fun <T> foo (f: () -> List<T>): T = null as T
fun main() {
val x = <!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>foo<!> { Collections.<!NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyList<!>() }
}