KT-597 Type inference failed

Resolution rules changed: now autocast and non-autocast candidates are judged together
This commit is contained in:
Andrey Breslav
2011-11-29 21:03:42 +03:00
parent 2849c58d47
commit 8a93421ecb
6 changed files with 31 additions and 17 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ fun declarationInsidePattern(x: (Any, Any)): String = when(x) { is (val a is Str
fun mergeAutocasts(a: Any?) {
if (a is String || a is Int) {
a.<error descr="Unresolved reference: compareTo">compareTo</error>("")
a.toString()
<info descr="Automatically cast to Any">a</info>.toString()
}
if (a is Int || a is String) {
a.<error descr="Unresolved reference: compareTo">compareTo</error>("")