[NI] Avoid constraints from expected type for effectively empty system
Expression will be checked against expected type later. Theoretically, this is not very good, but it aligns with the old inference, plus it helps avoiding multiple type mismatch diagnostics.
This commit is contained in:
+2
-2
@@ -27,7 +27,7 @@ fun foo() {
|
||||
z = 34
|
||||
}
|
||||
}
|
||||
val <!UNUSED_VARIABLE!>f<!>: ()-> Int = <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>r<!>
|
||||
val <!UNUSED_VARIABLE!>f<!>: ()-> Int = <!TYPE_MISMATCH!>r<!>
|
||||
val <!UNUSED_VARIABLE!>g<!>: ()-> Any = r
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ fun testCoercionToUnit() {
|
||||
45
|
||||
}
|
||||
}
|
||||
val <!UNUSED_VARIABLE!>f<!> : () -> String = <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>checkType<!>
|
||||
val <!UNUSED_VARIABLE!>f<!> : () -> String = <!TYPE_MISMATCH!>checkType<!>
|
||||
}
|
||||
|
||||
fun doSmth(<!UNUSED_PARAMETER!>i<!>: Int) {}
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ public class J {
|
||||
val testImplicitExclExcl1: String = J.s
|
||||
val testImplicitExclExcl2: String? = J.s
|
||||
|
||||
val testImplicitExclExcl3: String = <!NI;TYPE_MISMATCH, TYPE_MISMATCH!>J.m[""]<!>
|
||||
val testImplicitExclExcl3: String = <!TYPE_MISMATCH!>J.m[""]<!>
|
||||
val testImplicitExclExcl4: String? = J.m[""]
|
||||
|
||||
val testExclExcl1: String = J.s!!
|
||||
|
||||
Reference in New Issue
Block a user