refactored std.* package to be kotlin.*. Due to KT-1381 I had to move the functions from kotlin.test into the stdlib for now (I made them not depend on JUnit for now)

This commit is contained in:
James Strachan
2012-03-03 12:11:06 +00:00
parent 4a53e468fe
commit eb3aac9acb
162 changed files with 454 additions and 324 deletions
@@ -4,7 +4,7 @@ import java.util.Collection
import java.util.ArrayList
import java.util.regex.Pattern
import std.util.*
import kotlin.util.*
class C{
public fun foo(){
@@ -1,4 +1,4 @@
import std.*
import kotlin.*
fun box() : String {
val vector = java.util.Vector<Int>()
@@ -78,10 +78,10 @@ class Luhny() {
private fun print(c : Char) {
if (c.isDigit() && toBeMasked > 0) {
std.io.print('X')
kotlin.io.print('X')
toBeMasked--
} else {
std.io.print(c)
kotlin.io.print(c)
}
}
}
@@ -1,4 +1,4 @@
import std.*
import kotlin.*
val test = "lala".javaClass
@@ -2,7 +2,7 @@ package foo
import java.util.*;
import std.util.*
import kotlin.util.*
fun box() : String {
val a = ArrayList<Int>();
@@ -1,4 +1,4 @@
import std.util.*
import kotlin.util.*
import java.io.*
import java.util.*
@@ -1,6 +1,6 @@
// +JDK
package std1
package kotlin1
import java.util.*
@@ -1,6 +1,6 @@
// +JDK
package std1
package kotlin1
import java.util.*
@@ -1,6 +1,6 @@
// +JDK
package std1
package kotlin1
import java.util.*
@@ -5,7 +5,7 @@ package StringBuilder
import java.lang.StringBuilder
//import std.io.*
//import kotlin.io.*
//import java.io.*
fun main(args : Array<String>) {
@@ -1,7 +1,7 @@
// KT-860 ConcurrentModificationException in frontend
// +JDK
package std.util
package kotlin.util
import java.util.*
+8 -8
View File
@@ -3,11 +3,11 @@
~B()~this(i: Int) {}
}
~foo~fun foo(~foo.a~a : `std::Char`Char) = `foo.a`a`:std::Char`
~fooB~fun fooB() = `foo`foo('1')`:std::Char`
~foo.1~fun foo() : Int = (1.`std::Int.plus(Int)`plus(1))`:std::Int`
~foo~fun foo(~foo.a~a : `kotlin::Char`Char) = `foo.a`a`:kotlin::Char`
~fooB~fun fooB() = `foo`foo('1')`:kotlin::Char`
~foo.1~fun foo() : Int = (1.`kotlin::Int.plus(Int)`plus(1))`:kotlin::Int`
~foo1~fun foo1() : `B`B = `B`B()`:B`
~A.a~val a : `std::Int`Int
~A.a~val a : `kotlin::Int`Int
}
~C~class C : `A`A {
@@ -20,16 +20,16 @@
fun test() : Unit {
for (~i~i in 1..2) {
`i`i`:std::Int`
`i`i`:kotlin::Int`
}
for (val ~j~j in 1..2) {
`j`j`:std::Int`
`j`j`:kotlin::Int`
}
for (val ~k~k : Int in 1..2) {
`k`k`:std::Int`
`k`k`:kotlin::Int`
}
for (~l~l : Int in 1..2) {
`l`l`:std::Int`
`l`l`:kotlin::Int`
while (true) {
`l`l
}
+2 -2
View File
@@ -1,3 +1,3 @@
class C(x : `std::Int`Int) : NotFound {
val xx : `std::Int`Int
class C(x : `kotlin::Int`Int) : NotFound {
val xx : `kotlin::Int`Int
}
@@ -28,8 +28,8 @@ fun test() {
val y = 1.`abs`abs
}
~abs~val Int.abs : Int
get() = if (this`:std::Int` > 0) this else -this`:std::Int`;
get() = if (this`:kotlin::Int` > 0) this else -this`:kotlin::Int`;
val <~TT~T> `TT`T.foo : `TT`T
~foo~fun Int.foo() = this`:std::Int`
~foo~fun Int.foo() = this`:kotlin::Int`
@@ -6,9 +6,9 @@ class A(~a~val a : Int) {
fun test() {
~va~val a = A()
`va`a.`$a`a`:std::Int`
a.`b`b`:std::Int`
a.`f`f()`:std::Int`
`va`a.`$a`a`:kotlin::Int`
a.`b`b`:kotlin::Int`
a.`f`f()`:kotlin::Int`
}
package Jet65 {
+1 -1
View File
@@ -48,7 +48,7 @@ fun testInOut() {
(return : Inv<*>).`!`inf(1)
Inv<Int>().`Inv.outf`outf()
((return : Inv<in Int>).`Inv.outf`outf())`:std::Any`
((return : Inv<in Int>).`Inv.outf`outf())`:kotlin::Any`
(return : Inv<out Int>).`Inv.outf`outf()
(return : Inv<*>).`Inv.outf`outf()
@@ -3,7 +3,7 @@ import java.util.*
fun f_plus(): Int {
var x: Int = 1
x = x `std::Int.plus(Int)`+ 1
x = x `kotlin::Int.plus(Int)`+ 1
return x
}
@@ -20,11 +20,11 @@ fun f_plus(): Int {
}
~t~fun <~t.T~T> t(~t.t~t : `t.T`T) : `t.T`T {
`t`t<Int>(1)`:std::Int`
`t`t<Int>(1)`:kotlin::Int`
`t`t<`t.T`T>(`t.t`t)`:t.T`
`X`X<`t.T`T>()
1 `std::Int.plus(Int)`+ 1
1 `std::Int.plus(Int)`+= 1
1 `kotlin::Int.plus(Int)`+ 1
1 `kotlin::Int.plus(Int)`+= 1
X<String>() `plus`+ "1"
X<String>() `plus`plus "sadfas"
X<String>().`plus`plus("")
@@ -69,7 +69,7 @@ fun <T> tt(t : T) : T {
(x`java::java.util.List.set()`[1]) = null
x`java::java.util.List.set()`[null] = null
(x`java::java.util.List.set()`[null, 2]) = null
(`not`!foo)[1]`:std::Char`
(`not`!foo)[1]`:kotlin::Char`
val y = Bar()
y`inc`++
`inc`++y
@@ -78,10 +78,10 @@ fun <T> tt(t : T) : T {
y `+=`+= 1
`+`+y
`-`-y
1 `std::Int.compareTo(Double)`> 2.0
1 `std::Int.compareTo(Double)`< 2.0
1 `std::Int.compareTo(Double)`>= 2.0
1 `std::Int.compareTo(Double)`<= 2.0
1 `kotlin::Int.compareTo(Double)`> 2.0
1 `kotlin::Int.compareTo(Double)`< 2.0
1 `kotlin::Int.compareTo(Double)`>= 2.0
1 `kotlin::Int.compareTo(Double)`<= 2.0
}
+4 -4
View File
@@ -1,9 +1,9 @@
import `java::java`java.*
import java.`java::java.util`util.*
fun foo(~a~a : `std::Array`Array<`std::Int`Int>) : `java::java.util.List`List {
`a`a.`std::Array.get(Int)`get(1)
`a`a.`std::Array.set(Int, Int)`set(1, 1)
fun foo(~a~a : `kotlin::Array`Array<`kotlin::Int`Int>) : `java::java.util.List`List {
`a`a.`kotlin::Array.get(Int)`get(1)
`a`a.`kotlin::Array.set(Int, Int)`set(1, 1)
}
fun foo(o : `java::java.lang.Object`Object, l : `java::java.util`util.`java::java.util.List`List) : `java::java.util.List`List {}
@@ -27,7 +27,7 @@ class B : `java::java.lang.Object`Object {
`java::java.util.Collections`Collections.`java::java.util.Collections.emptyList()`emptyList()
}
fun barrr() : `std::Int`Int {
fun barrr() : `kotlin::Int`Int {
`foo`foo(`A`A())
}
}
+1 -1
View File
@@ -3,6 +3,6 @@ import java.`java::java.util`util.*
class B : `java::java.lang.Object`Object {
fun bar(~o~o : `java::java.lang.Object`Object) {
`java::java.lang.System`System.`java::java.lang.System.out`out.`java::java.io.PrintStream.print(Object)`print(`o`o)`:std::Unit`
`java::java.lang.System`System.`java::java.lang.System.out`out.`java::java.io.PrintStream.print(Object)`print(`o`o)`:kotlin::Unit`
}
}
@@ -2,5 +2,5 @@ import `java::java`java.*
import java.`java::java.util`util.*
fun typeTransform() {
Integer.getInteger("", 239)`:std::Int`
Integer.getInteger("", 239)`:kotlin::Int`
}