[NI] Improvements for "not enough information" diagnostic
#KT-30590 Fixed
This commit is contained in:
+2
-4
@@ -1,11 +1,9 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
// !LANGUAGE: +NewInference
|
||||
// Issue: KT-30590
|
||||
// NI_EXPECTED_FILE
|
||||
|
||||
interface A
|
||||
fun <T: A, R: T> emptyStrangeMap(): Map<T, R> = TODO()
|
||||
fun test7() : Map<A, A> = emptyStrangeMap()
|
||||
|
||||
fun test() = emptyStrangeMap()
|
||||
|
||||
fun test() = <!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>emptyStrangeMap<!>()
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T : A, /*1*/ R : T> emptyStrangeMap(): kotlin.collections.Map<T, R>
|
||||
public fun test(): kotlin.collections.Map<???, ???>
|
||||
public fun test7(): kotlin.collections.Map<A, A>
|
||||
|
||||
public interface A {
|
||||
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
|
||||
}
|
||||
@@ -1,6 +1,7 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ T : A, /*1*/ R : T> emptyStrangeMap(): kotlin.collections.Map<T, R>
|
||||
public fun test(): [ERROR : Error function type]
|
||||
public fun test7(): kotlin.collections.Map<A, A>
|
||||
|
||||
public interface A {
|
||||
|
||||
+6
-2
@@ -2,8 +2,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun <K> id2(x: K, s: String): K = x
|
||||
fun <K> ret(s: String): K = TODO()
|
||||
|
||||
fun test() {
|
||||
<!NI;IMPLICIT_NOTHING_AS_TYPE_PARAMETER, NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>id2<!>(<!UNRESOLVED_REFERENCE!>unresolved<!>, "foo")
|
||||
<!NI;UNREACHABLE_CODE!><!NI;IMPLICIT_NOTHING_AS_TYPE_PARAMETER, NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>id2<!>(<!UNRESOLVED_REFERENCE!>unresolved<!>, <!CONSTANT_EXPECTED_TYPE_MISMATCH!>42<!>)<!>
|
||||
id2(<!UNRESOLVED_REFERENCE!>unresolved<!>, "foo")
|
||||
id2(<!UNRESOLVED_REFERENCE!>unresolved<!>, <!CONSTANT_EXPECTED_TYPE_MISMATCH!>42<!>)
|
||||
|
||||
<!NI;NEW_INFERENCE_NO_INFORMATION_FOR_PARAMETER, OI;TYPE_INFERENCE_NO_INFORMATION_FOR_PARAMETER!>ret<!>("foo")
|
||||
<!OI;TYPE_INFERENCE_PARAMETER_CONSTRAINT_ERROR!>ret<!>(<!CONSTANT_EXPECTED_TYPE_MISMATCH!>42<!>)
|
||||
}
|
||||
+1
@@ -1,4 +1,5 @@
|
||||
package
|
||||
|
||||
public fun </*0*/ K> id2(/*0*/ x: K, /*1*/ s: kotlin.String): K
|
||||
public fun </*0*/ K> ret(/*0*/ s: kotlin.String): K
|
||||
public fun test(): kotlin.Unit
|
||||
|
||||
Reference in New Issue
Block a user