Merge remote branch 'origin/master'

This commit is contained in:
Andrey Breslav
2011-11-23 20:27:51 +03:00
43 changed files with 297 additions and 48 deletions
@@ -1,3 +1,5 @@
// -JDK
fun test() : Unit {
var x : Int? = 0
var y : Int = 0
@@ -13,4 +15,4 @@ fun test() : Unit {
x <!USELESS_CAST!>as?<!> Int? : Int?
y <!USELESS_CAST_STATIC_ASSERT_IS_FINE!>as?<!> Int? : Int?
()
}
}
@@ -5,15 +5,15 @@ namespace a {
}
namespace b {
fun foo() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bar()<!>
fun foo() = bar()
fun bar() = foo()
fun bar() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>foo()<!>
}
namespace c {
fun bazz() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bar()<!>
fun bazz() = bar()
fun foo() = bazz()
fun foo() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bazz()<!>
fun bar() = foo()
}
@@ -39,4 +39,4 @@ namespace ok {
fun bar() = foo()
}
}
}
@@ -0,0 +1,4 @@
import java.util.List;
import java.util.Collection;
fun ff(c: Collection<String>) = c <!CAST_NEVER_SUCCEEDS!>as<!> List<Int>
@@ -0,0 +1,4 @@
import java.util.List;
import java.util.Collection;
fun ff(c: Collection<String>) = c as List<String>
@@ -0,0 +1,4 @@
import java.util.List;
fun ff(l: Any) = l as List<*>
@@ -0,0 +1,3 @@
import java.util.List;
fun ff(a: Any) = <!UNCHECKED_CAST!>a as List<String><!>
@@ -0,0 +1,5 @@
import java.util.Collection;
import java.util.List;
fun ff(l: Collection<String>) = l is List<String>
@@ -0,0 +1,9 @@
import java.util.Collection;
import java.util.List;
open class A
class B : A
fun ff(l: Collection<B>) = l is List<out A>
@@ -0,0 +1,3 @@
import java.util.List;
fun ff(l: Any) = l is <!CANNOT_CHECK_FOR_ERASED!>List<String><!>
@@ -0,0 +1,5 @@
import java.util.List;
import java.util.Collection;
fun ff(l: Collection<Int>) = l is <!INCOMPATIBLE_TYPES!>List<String><!>
@@ -0,0 +1,3 @@
import java.util.List;
fun ff(l: Any) = l is List<*>
@@ -0,0 +1,3 @@
class MyList<T>
fun ff(a: Any) = a is MyList<String>
@@ -0,0 +1,3 @@
class MyList<A>
fun ff(l: MyList<String>) = l is <!INCOMPATIBLE_TYPES!>MyList<Int><!>
@@ -0,0 +1,4 @@
trait Aaa
trait Bbb
fun f(a: Aaa) = a is Bbb
@@ -0,0 +1,6 @@
import java.util.List;
fun ff(l: Any) = when(l) {
is <!CANNOT_CHECK_FOR_ERASED!>List<String><!> => 1
else 2
}
@@ -0,0 +1,3 @@
fun bar() = {
<!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bar()<!>
}
@@ -0,0 +1,3 @@
fun bar() = {
fun foo() = <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bar()<!>
}
@@ -0,0 +1,7 @@
// http://youtrack.jetbrains.net/issue/KT-329
fun block(f : fun() : Unit) = f()
fun bar() = block{ <!UNRESOLVED_REFERENCE!>foo<!>() // <-- missing closing curly bracket
fun foo() = block{ <!TYPECHECKER_HAS_RUN_INTO_RECURSIVE_PROBLEM!>bar()<!> }
@@ -1,6 +1,6 @@
fun typeName(a: Any?) : String {
return when(a) {
is java.util.ArrayList<Int> => "array list"
is java.util.ArrayList<*> => "array list"
else => "no idea"
}
}
@@ -8,4 +8,4 @@ fun typeName(a: Any?) : String {
fun box() : String {
if(typeName(java.util.ArrayList<Int> ()) != "array list") return "array list failed"
return "OK"
}
}