Constraint priorities integrated
This commit is contained in:
committed by
Nikolay Krasko
parent
3cf7a44840
commit
0a2108d4d0
@@ -42,7 +42,7 @@ fun main(args : Array<String>) {
|
||||
|
||||
val b = fooT2<Int>()(1)
|
||||
b : Int
|
||||
fooT2()(1) // : Any?
|
||||
<!TYPE_INFERENCE_FAILED!>fooT2()<!>(1) // : Any?
|
||||
|
||||
<!CALLEE_NOT_A_FUNCTION!>1<!>()
|
||||
<!CALLEE_NOT_A_FUNCTION!>1<!>{}
|
||||
|
||||
@@ -6,7 +6,8 @@ fun test(<!UNUSED_PARAMETER!>a<!> : annotation.RetentionPolicy) {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
java.util.Collections.emptyList()
|
||||
java.util.Collections.<!TYPE_INFERENCE_FAILED!>emptyList()<!>
|
||||
val <!UNUSED_VARIABLE!>a<!> : java.util.Collection<String>? = java.util.Collections.emptyList()
|
||||
}
|
||||
|
||||
fun test(<!UNUSED_PARAMETER!>a<!> : java.lang.Comparable<Int>) {
|
||||
|
||||
@@ -21,7 +21,7 @@ fun test(<!UNUSED_PARAMETER!>l<!> : java.util.List<Int>) {
|
||||
Collections.<!UNRESOLVED_REFERENCE!>emptyList<!>
|
||||
Collections.emptyList<Int>
|
||||
Collections.emptyList<Int>()
|
||||
Collections.emptyList()
|
||||
Collections.<!TYPE_INFERENCE_FAILED!>emptyList()<!>
|
||||
|
||||
Collections.singleton<Int>(1) : Set<Int>?
|
||||
Collections.singleton<Int>(<!ERROR_COMPILE_TIME_VALUE!>1.0<!>)
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
fun fooT2<T>() : fun(t : T) : T {
|
||||
return {it}
|
||||
}
|
||||
|
||||
val n : Nothing = null.sure()
|
||||
|
||||
fun test() {
|
||||
<!TYPE_INFERENCE_FAILED!>fooT2()<!>(1)
|
||||
}
|
||||
@@ -9,15 +9,15 @@ fun foo(a: A) {
|
||||
a.gen() //it works: Unit is derived
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>u<!>: Unit = a.gen() //type mismatch, but Unit can be derived
|
||||
val <!UNUSED_VARIABLE!>u<!>: Unit = a.gen() // Unit should be inferred
|
||||
|
||||
if (true) {
|
||||
a.gen() //it works: Unit is derived
|
||||
a.<!TYPE_INFERENCE_FAILED!>gen()<!> // Shouldn't work: no info for inference
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>b<!> : fun() : Unit = {
|
||||
if (true) {
|
||||
a.gen() //type mismatch, but Unit can be derived
|
||||
a.gen() // unit can be inferred
|
||||
}
|
||||
else {
|
||||
()
|
||||
@@ -28,5 +28,5 @@ fun foo(a: A) {
|
||||
a.gen() //type mismatch, but Int can be derived
|
||||
}
|
||||
|
||||
a.gen() //it works: Unit is derived
|
||||
a.<!TYPE_INFERENCE_FAILED!>gen()<!> // Shouldn't work: no info for inference
|
||||
}
|
||||
Reference in New Issue
Block a user