Merge remote-tracking branch 'origin/master'

This commit is contained in:
svtk
2011-12-13 19:43:31 +04:00
88 changed files with 2524 additions and 498 deletions
@@ -1,3 +1,4 @@
import std.*
import std.io.*
import java.io.*
@@ -1,4 +1,5 @@
class A() {}
open class B<T>() {
fun isT (a : Any?) : Boolean {
return a is T
@@ -167,7 +168,6 @@ fun t26 () : Boolean {
}
fun box() : String {
/*
if(!t1()) {
return "t1 failed"
}
@@ -243,7 +243,6 @@ fun box() : String {
if(!t25()) {
return "t25 failed"
}
*/
if(!t26()) {
return "t26 failed"
}
@@ -0,0 +1,13 @@
class A() {
var x : Int = 0
var z = { () =>
x++
}
}
fun box() : String {
val a = A()
a.z() //problem is here
return if (a.x == 1) "OK" else "fail"
}
@@ -0,0 +1,8 @@
fun <T> Array<T>?.get(i : Int?) = this.sure().get(i.sure())
fun <T> array(vararg t : T) : Array<T> = t
fun box() : String {
val a : Array<String>? = array<String>("Str", "Str2")
val i : Int? = 1
return if(a[i] == "Str2") "OK" else "fail"
}
@@ -1,4 +1,4 @@
open class A<T> () {
open class A<out T> () {
fun plus(e: T) = B<T> (e)
}
@@ -6,4 +6,6 @@ class B<T> (val e: T) : A<T>() {
fun add() = B<T> (e)
}
fun box() = if( A<String>().plus("239").add().e == "239" ) "OK" else "fail"
fun box() : String {
return if(A<String>().plus("239").add().e == "239" ) "OK" else "fail"
}
@@ -4,7 +4,6 @@ class Box<T>() {
}
class Inner2() : Inner() {
}
fun inner() = Inner2()
@@ -0,0 +1,6 @@
class ExtendsAbstractListT {
{
Mine<String> mine = null;
java.util.List<String> list = mine;
}
}
@@ -0,0 +1 @@
abstract class Mine<T>() : java.util.AbstractList<T>()
@@ -0,0 +1,7 @@
class PlainExtendsListString {
{
Mine mine = null;
java.util.List<String> list = mine;
}
}
@@ -0,0 +1 @@
abstract class Mine : java.util.List<String>
@@ -0,0 +1,7 @@
class ImplementsMapPP {
{
Mine<String, Integer> mine = null;
java.util.Map<Integer, String> map = mine;
}
}
@@ -0,0 +1 @@
abstract class Mine<P1, P2> : java.util.Map<P2, P1>
@@ -0,0 +1,8 @@
class Question {
// id2 is to prevent java type parameter type inference
static <T> T id2(T p) { return p; }
{
java.util.List<String> s = id2(namespace.id((jet.typeinfo.TypeInfo) null, null));
}
}
@@ -0,0 +1,3 @@
import java.util.List
fun <P1 : List<String>> id(p: P1) = p
@@ -0,0 +1,8 @@
class Question {
// id2 is to prevent java type parameter type inference
static <T> T id2(T p) { return p; }
{
String s = id2(namespace.id((jet.typeinfo.TypeInfo) null, null));
}
}
@@ -0,0 +1 @@
fun <T : String> id(p: T) = p