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:
@@ -48,12 +48,12 @@ fun bottlesOfBeer(count : Int) : String =
|
|||||||
* An excerpt from the Standard Library
|
* An excerpt from the Standard Library
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// From the std.io package
|
// From the kotlin.io package
|
||||||
// These are simple functions that wrap standard Java API calls
|
// These are simple functions that wrap standard Java API calls
|
||||||
fun print(message : String) { System.out?.print(message) }
|
fun print(message : String) { System.out?.print(message) }
|
||||||
fun println(message : String) { System.out?.println(message) }
|
fun println(message : String) { System.out?.println(message) }
|
||||||
|
|
||||||
// From the std package
|
// From the kotlin package
|
||||||
// This is an extension property, i.e. a property that is defined for the
|
// This is an extension property, i.e. a property that is defined for the
|
||||||
// type Array<T>, but does not sit inside the class Array
|
// type Array<T>, but does not sit inside the class Array
|
||||||
val <T> Array<T>.isEmpty : Boolean get() = size == 0
|
val <T> Array<T>.isEmpty : Boolean get() = size == 0
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ fun bottlesOfBeer(count : Int) : String =
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
// From the std package
|
// From the kotlin package
|
||||||
// This is an extension property, i.e. a property that is defined for the
|
// This is an extension property, i.e. a property that is defined for the
|
||||||
// type Array<T>, but does not sit inside the class Array
|
// type Array<T>, but does not sit inside the class Array
|
||||||
val <T> Array<T>.isEmpty : Boolean get() = size == 0
|
val <T> Array<T>.isEmpty : Boolean get() = size == 0
|
||||||
|
|||||||
@@ -153,7 +153,7 @@
|
|||||||
</target>
|
</target>
|
||||||
|
|
||||||
<target name="generateStdlib" depends="compileTestlib" description="Generates the stdlib APIs for arrays and kotlin collections">
|
<target name="generateStdlib" depends="compileTestlib" description="Generates the stdlib APIs for arrays and kotlin collections">
|
||||||
<java classname="kotlin.tools.namespace" failonerror="true" fork="true">
|
<java classname="org.jetbrains.kotlin.tools.namespace" failonerror="true" fork="true">
|
||||||
<classpath>
|
<classpath>
|
||||||
<pathelement location="${kotlin-home}/lib/kotlin-runtime.jar"/>
|
<pathelement location="${kotlin-home}/lib/kotlin-runtime.jar"/>
|
||||||
<pathelement location="${kotlin-home}/lib/kotlin-test.jar"/>
|
<pathelement location="${kotlin-home}/lib/kotlin-test.jar"/>
|
||||||
|
|||||||
@@ -182,7 +182,7 @@ public class GenerationState {
|
|||||||
final ClassFileFactory factory = getFactory();
|
final ClassFileFactory factory = getFactory();
|
||||||
List<String> files = factory.files();
|
List<String> files = factory.files();
|
||||||
for (String file : files) {
|
for (String file : files) {
|
||||||
// if (!file.startsWith("std/")) {
|
// if (!file.startsWith("kotlin/")) {
|
||||||
answer.append("@").append(file).append('\n');
|
answer.append("@").append(file).append('\n');
|
||||||
answer.append(factory.asText(file));
|
answer.append(factory.asText(file));
|
||||||
// }
|
// }
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ public class IntrinsicMethods {
|
|||||||
myProject = project;
|
myProject = project;
|
||||||
myStdLib = stdlib;
|
myStdLib = stdlib;
|
||||||
|
|
||||||
namedMethods.put("\"std.javaClass.function\"", new JavaClassFunction());
|
namedMethods.put("\"kotlin.javaClass.function\"", new JavaClassFunction());
|
||||||
|
|
||||||
List<String> primitiveCastMethods = OperatorConventions.NUMBER_CONVERSIONS.asList();
|
List<String> primitiveCastMethods = OperatorConventions.NUMBER_CONVERSIONS.asList();
|
||||||
for (String method : primitiveCastMethods) {
|
for (String method : primitiveCastMethods) {
|
||||||
|
|||||||
@@ -56,6 +56,9 @@ public class KotlinCompiler {
|
|||||||
@Argument(value = "module", description = "module to compile")
|
@Argument(value = "module", description = "module to compile")
|
||||||
public String module;
|
public String module;
|
||||||
|
|
||||||
|
@Argument(value = "classpath", description = "classpath to use when compiling")
|
||||||
|
public String classpath;
|
||||||
|
|
||||||
@Argument(value = "includeRuntime", description = "include Kotlin runtime in to resulting jar")
|
@Argument(value = "includeRuntime", description = "include Kotlin runtime in to resulting jar")
|
||||||
public boolean includeRuntime;
|
public boolean includeRuntime;
|
||||||
|
|
||||||
@@ -140,6 +143,10 @@ public class KotlinCompiler {
|
|||||||
environment.setStdlib(arguments.stdlib);
|
environment.setStdlib(arguments.stdlib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (arguments.classpath != null) {
|
||||||
|
environment.addToClasspath(arguments.classpath);
|
||||||
|
}
|
||||||
|
|
||||||
boolean ok;
|
boolean ok;
|
||||||
if (arguments.module != null) {
|
if (arguments.module != null) {
|
||||||
ok = environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
ok = environment.compileModuleScript(arguments.module, arguments.jar, arguments.outputDir, arguments.includeRuntime);
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ import org.jetbrains.jet.lang.resolve.scopes.WritableScope;
|
|||||||
* @author svtk
|
* @author svtk
|
||||||
*/
|
*/
|
||||||
public class StandardConfiguration implements Configuration {
|
public class StandardConfiguration implements Configuration {
|
||||||
public static final String[] DEFAULT_JET_IMPORTS = new String[] { "std.*", "std.io.*" };
|
public static final String[] DEFAULT_JET_IMPORTS = new String[] { "kotlin.*", "kotlin.io.*" };
|
||||||
|
|
||||||
private Project project;
|
private Project project;
|
||||||
|
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import java.util.Collection
|
|||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
import java.util.regex.Pattern
|
import java.util.regex.Pattern
|
||||||
|
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
class C{
|
class C{
|
||||||
public fun foo(){
|
public fun foo(){
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
fun box() : String {
|
fun box() : String {
|
||||||
val vector = java.util.Vector<Int>()
|
val vector = java.util.Vector<Int>()
|
||||||
|
|||||||
@@ -78,10 +78,10 @@ class Luhny() {
|
|||||||
|
|
||||||
private fun print(c : Char) {
|
private fun print(c : Char) {
|
||||||
if (c.isDigit() && toBeMasked > 0) {
|
if (c.isDigit() && toBeMasked > 0) {
|
||||||
std.io.print('X')
|
kotlin.io.print('X')
|
||||||
toBeMasked--
|
toBeMasked--
|
||||||
} else {
|
} else {
|
||||||
std.io.print(c)
|
kotlin.io.print(c)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
val test = "lala".javaClass
|
val test = "lala".javaClass
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package foo
|
|||||||
|
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
|
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
fun box() : String {
|
fun box() : String {
|
||||||
val a = ArrayList<Int>();
|
val a = ArrayList<Int>();
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.io.*
|
import java.io.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// +JDK
|
// +JDK
|
||||||
|
|
||||||
package std1
|
package kotlin1
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// +JDK
|
// +JDK
|
||||||
|
|
||||||
package std1
|
package kotlin1
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// +JDK
|
// +JDK
|
||||||
|
|
||||||
package std1
|
package kotlin1
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package StringBuilder
|
|||||||
|
|
||||||
import java.lang.StringBuilder
|
import java.lang.StringBuilder
|
||||||
|
|
||||||
//import std.io.*
|
//import kotlin.io.*
|
||||||
//import java.io.*
|
//import java.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// KT-860 ConcurrentModificationException in frontend
|
// KT-860 ConcurrentModificationException in frontend
|
||||||
// +JDK
|
// +JDK
|
||||||
|
|
||||||
package std.util
|
package kotlin.util
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
|
|||||||
@@ -3,11 +3,11 @@
|
|||||||
~B()~this(i: Int) {}
|
~B()~this(i: Int) {}
|
||||||
}
|
}
|
||||||
|
|
||||||
~foo~fun foo(~foo.a~a : `std::Char`Char) = `foo.a`a`:std::Char`
|
~foo~fun foo(~foo.a~a : `kotlin::Char`Char) = `foo.a`a`:kotlin::Char`
|
||||||
~fooB~fun fooB() = `foo`foo('1')`:std::Char`
|
~fooB~fun fooB() = `foo`foo('1')`:kotlin::Char`
|
||||||
~foo.1~fun foo() : Int = (1.`std::Int.plus(Int)`plus(1))`:std::Int`
|
~foo.1~fun foo() : Int = (1.`kotlin::Int.plus(Int)`plus(1))`:kotlin::Int`
|
||||||
~foo1~fun foo1() : `B`B = `B`B()`:B`
|
~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 {
|
~C~class C : `A`A {
|
||||||
@@ -20,16 +20,16 @@
|
|||||||
|
|
||||||
fun test() : Unit {
|
fun test() : Unit {
|
||||||
for (~i~i in 1..2) {
|
for (~i~i in 1..2) {
|
||||||
`i`i`:std::Int`
|
`i`i`:kotlin::Int`
|
||||||
}
|
}
|
||||||
for (val ~j~j in 1..2) {
|
for (val ~j~j in 1..2) {
|
||||||
`j`j`:std::Int`
|
`j`j`:kotlin::Int`
|
||||||
}
|
}
|
||||||
for (val ~k~k : Int in 1..2) {
|
for (val ~k~k : Int in 1..2) {
|
||||||
`k`k`:std::Int`
|
`k`k`:kotlin::Int`
|
||||||
}
|
}
|
||||||
for (~l~l : Int in 1..2) {
|
for (~l~l : Int in 1..2) {
|
||||||
`l`l`:std::Int`
|
`l`l`:kotlin::Int`
|
||||||
while (true) {
|
while (true) {
|
||||||
`l`l
|
`l`l
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
class C(x : `std::Int`Int) : NotFound {
|
class C(x : `kotlin::Int`Int) : NotFound {
|
||||||
val xx : `std::Int`Int
|
val xx : `kotlin::Int`Int
|
||||||
}
|
}
|
||||||
@@ -28,8 +28,8 @@ fun test() {
|
|||||||
val y = 1.`abs`abs
|
val y = 1.`abs`abs
|
||||||
}
|
}
|
||||||
~abs~val Int.abs : Int
|
~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
|
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() {
|
fun test() {
|
||||||
~va~val a = A()
|
~va~val a = A()
|
||||||
`va`a.`$a`a`:std::Int`
|
`va`a.`$a`a`:kotlin::Int`
|
||||||
a.`b`b`:std::Int`
|
a.`b`b`:kotlin::Int`
|
||||||
a.`f`f()`:std::Int`
|
a.`f`f()`:kotlin::Int`
|
||||||
}
|
}
|
||||||
|
|
||||||
package Jet65 {
|
package Jet65 {
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ fun testInOut() {
|
|||||||
(return : Inv<*>).`!`inf(1)
|
(return : Inv<*>).`!`inf(1)
|
||||||
|
|
||||||
Inv<Int>().`Inv.outf`outf()
|
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<out Int>).`Inv.outf`outf()
|
||||||
(return : Inv<*>).`Inv.outf`outf()
|
(return : Inv<*>).`Inv.outf`outf()
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import java.util.*
|
|||||||
|
|
||||||
fun f_plus(): Int {
|
fun f_plus(): Int {
|
||||||
var x: Int = 1
|
var x: Int = 1
|
||||||
x = x `std::Int.plus(Int)`+ 1
|
x = x `kotlin::Int.plus(Int)`+ 1
|
||||||
return x
|
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~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`
|
`t`t<`t.T`T>(`t.t`t)`:t.T`
|
||||||
`X`X<`t.T`T>()
|
`X`X<`t.T`T>()
|
||||||
1 `std::Int.plus(Int)`+ 1
|
1 `kotlin::Int.plus(Int)`+ 1
|
||||||
1 `std::Int.plus(Int)`+= 1
|
1 `kotlin::Int.plus(Int)`+= 1
|
||||||
X<String>() `plus`+ "1"
|
X<String>() `plus`+ "1"
|
||||||
X<String>() `plus`plus "sadfas"
|
X<String>() `plus`plus "sadfas"
|
||||||
X<String>().`plus`plus("")
|
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()`[1]) = null
|
||||||
x`java::java.util.List.set()`[null] = null
|
x`java::java.util.List.set()`[null] = null
|
||||||
(x`java::java.util.List.set()`[null, 2]) = null
|
(x`java::java.util.List.set()`[null, 2]) = null
|
||||||
(`not`!foo)[1]`:std::Char`
|
(`not`!foo)[1]`:kotlin::Char`
|
||||||
val y = Bar()
|
val y = Bar()
|
||||||
y`inc`++
|
y`inc`++
|
||||||
`inc`++y
|
`inc`++y
|
||||||
@@ -78,10 +78,10 @@ fun <T> tt(t : T) : T {
|
|||||||
y `+=`+= 1
|
y `+=`+= 1
|
||||||
`+`+y
|
`+`+y
|
||||||
`-`-y
|
`-`-y
|
||||||
1 `std::Int.compareTo(Double)`> 2.0
|
1 `kotlin::Int.compareTo(Double)`> 2.0
|
||||||
1 `std::Int.compareTo(Double)`< 2.0
|
1 `kotlin::Int.compareTo(Double)`< 2.0
|
||||||
1 `std::Int.compareTo(Double)`>= 2.0
|
1 `kotlin::Int.compareTo(Double)`>= 2.0
|
||||||
1 `std::Int.compareTo(Double)`<= 2.0
|
1 `kotlin::Int.compareTo(Double)`<= 2.0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import `java::java`java.*
|
import `java::java`java.*
|
||||||
import java.`java::java.util`util.*
|
import java.`java::java.util`util.*
|
||||||
|
|
||||||
fun foo(~a~a : `std::Array`Array<`std::Int`Int>) : `java::java.util.List`List {
|
fun foo(~a~a : `kotlin::Array`Array<`kotlin::Int`Int>) : `java::java.util.List`List {
|
||||||
`a`a.`std::Array.get(Int)`get(1)
|
`a`a.`kotlin::Array.get(Int)`get(1)
|
||||||
`a`a.`std::Array.set(Int, Int)`set(1, 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 {}
|
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()
|
`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())
|
`foo`foo(`A`A())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,6 @@ import java.`java::java.util`util.*
|
|||||||
|
|
||||||
class B : `java::java.lang.Object`Object {
|
class B : `java::java.lang.Object`Object {
|
||||||
fun bar(~o~o : `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.*
|
import java.`java::java.util`util.*
|
||||||
|
|
||||||
fun typeTransform() {
|
fun typeTransform() {
|
||||||
Integer.getInteger("", 239)`:std::Int`
|
Integer.getInteger("", 239)`:kotlin::Int`
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,8 @@ import static org.jetbrains.jet.lang.resolve.BindingContext.REFERENCE_TARGET;
|
|||||||
*/
|
*/
|
||||||
public abstract class ExpectedResolveData {
|
public abstract class ExpectedResolveData {
|
||||||
|
|
||||||
|
protected static final String STANDARD_PREFIX = "kotlin::";
|
||||||
|
|
||||||
private static class Position {
|
private static class Position {
|
||||||
private final PsiElement element;
|
private final PsiElement element;
|
||||||
|
|
||||||
@@ -212,7 +214,7 @@ public abstract class ExpectedResolveData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
JetReferenceExpression reference = getAncestorOfType(JetReferenceExpression.class, element);
|
JetReferenceExpression reference = getAncestorOfType(JetReferenceExpression.class, element);
|
||||||
if (expected == null && name.startsWith("std::")) {
|
if (expected == null && name.startsWith(STANDARD_PREFIX)) {
|
||||||
DeclarationDescriptor expectedDescriptor = nameToDescriptor.get(name);
|
DeclarationDescriptor expectedDescriptor = nameToDescriptor.get(name);
|
||||||
JetTypeReference typeReference = getAncestorOfType(JetTypeReference.class, element);
|
JetTypeReference typeReference = getAncestorOfType(JetTypeReference.class, element);
|
||||||
if (expectedDescriptor != null) {
|
if (expectedDescriptor != null) {
|
||||||
@@ -225,7 +227,7 @@ public abstract class ExpectedResolveData {
|
|||||||
|
|
||||||
JetType actualType = bindingContext.get(BindingContext.TYPE, typeReference);
|
JetType actualType = bindingContext.get(BindingContext.TYPE, typeReference);
|
||||||
assertNotNull("Type " + name + " not resolved for reference " + name, actualType);
|
assertNotNull("Type " + name + " not resolved for reference " + name, actualType);
|
||||||
ClassifierDescriptor expectedClass = lib.getLibraryScope().getClassifier(name.substring(5));
|
ClassifierDescriptor expectedClass = lib.getLibraryScope().getClassifier(name.substring(STANDARD_PREFIX.length()));
|
||||||
assertNotNull("Expected class not found: " + name);
|
assertNotNull("Expected class not found: " + name);
|
||||||
assertSame("Type resolution mismatch: ", expectedClass.getTypeConstructor(), actualType.getConstructor());
|
assertSame("Type resolution mismatch: ", expectedClass.getTypeConstructor(), actualType.getConstructor());
|
||||||
continue;
|
continue;
|
||||||
@@ -282,8 +284,9 @@ public abstract class ExpectedResolveData {
|
|||||||
|
|
||||||
JetType expressionType = bindingContext.get(BindingContext.EXPRESSION_TYPE, expression);
|
JetType expressionType = bindingContext.get(BindingContext.EXPRESSION_TYPE, expression);
|
||||||
TypeConstructor expectedTypeConstructor;
|
TypeConstructor expectedTypeConstructor;
|
||||||
if (typeName.startsWith("std::")) {
|
if (typeName.startsWith(STANDARD_PREFIX)) {
|
||||||
ClassifierDescriptor expectedClass = lib.getLibraryScope().getClassifier(typeName.substring(5));
|
String name = typeName.substring(STANDARD_PREFIX.length());
|
||||||
|
ClassifierDescriptor expectedClass = lib.getLibraryScope().getClassifier(name);
|
||||||
|
|
||||||
assertNotNull("Expected class not found: " + typeName, expectedClass);
|
assertNotNull("Expected class not found: " + typeName, expectedClass);
|
||||||
expectedTypeConstructor = expectedClass.getTypeConstructor();
|
expectedTypeConstructor = expectedClass.getTypeConstructor();
|
||||||
|
|||||||
@@ -64,13 +64,13 @@ public class JetResolveTest extends ExtensibleResolveTestCase {
|
|||||||
Project project = getProject();
|
Project project = getProject();
|
||||||
JetStandardLibrary lib = JetStandardLibrary.getInstance();
|
JetStandardLibrary lib = JetStandardLibrary.getInstance();
|
||||||
Map<String, DeclarationDescriptor> nameToDescriptor = new HashMap<String, DeclarationDescriptor>();
|
Map<String, DeclarationDescriptor> nameToDescriptor = new HashMap<String, DeclarationDescriptor>();
|
||||||
nameToDescriptor.put("std::Int.plus(Int)", standardFunction(lib.getInt(), "plus", lib.getIntType()));
|
nameToDescriptor.put("kotlin::Int.plus(Int)", standardFunction(lib.getInt(), "plus", lib.getIntType()));
|
||||||
FunctionDescriptor descriptorForGet = standardFunction(lib.getArray(), Collections.singletonList(new TypeProjection(lib.getIntType())), "get", lib.getIntType());
|
FunctionDescriptor descriptorForGet = standardFunction(lib.getArray(), Collections.singletonList(new TypeProjection(lib.getIntType())), "get", lib.getIntType());
|
||||||
nameToDescriptor.put("std::Array.get(Int)", descriptorForGet.getOriginal());
|
nameToDescriptor.put("kotlin::Array.get(Int)", descriptorForGet.getOriginal());
|
||||||
nameToDescriptor.put("std::Int.compareTo(Double)", standardFunction(lib.getInt(), "compareTo", lib.getDoubleType()));
|
nameToDescriptor.put("kotlin::Int.compareTo(Double)", standardFunction(lib.getInt(), "compareTo", lib.getDoubleType()));
|
||||||
@NotNull
|
@NotNull
|
||||||
FunctionDescriptor descriptorForSet = standardFunction(lib.getArray(), Collections.singletonList(new TypeProjection(lib.getIntType())), "set", lib.getIntType(), lib.getIntType());
|
FunctionDescriptor descriptorForSet = standardFunction(lib.getArray(), Collections.singletonList(new TypeProjection(lib.getIntType())), "set", lib.getIntType(), lib.getIntType());
|
||||||
nameToDescriptor.put("std::Array.set(Int, Int)", descriptorForSet.getOriginal());
|
nameToDescriptor.put("kotlin::Array.set(Int, Int)", descriptorForSet.getOriginal());
|
||||||
|
|
||||||
Map<String, PsiElement> nameToDeclaration = new HashMap<String, PsiElement>();
|
Map<String, PsiElement> nameToDeclaration = new HashMap<String, PsiElement>();
|
||||||
PsiClass java_util_Collections = findClass("java.util.Collections");
|
PsiClass java_util_Collections = findClass("java.util.Collections");
|
||||||
@@ -147,7 +147,7 @@ public class JetResolveTest extends ExtensibleResolveTestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
throw new IllegalArgumentException("Not found: std::" + classDescriptor.getName() + "." + name + "(" + parameterTypeList + ")");
|
throw new IllegalArgumentException("Not found: kotlin::" + classDescriptor.getName() + "." + name + "(" + parameterTypeList + ")");
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace change
|
namespace change
|
||||||
|
|
||||||
import java.math.BigDecimal
|
import java.math.BigDecimal
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
// Easy to make BigDecimals user-friendly
|
// Easy to make BigDecimals user-friendly
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace long.division
|
namespace long.division
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
// Problematic case does not compile
|
// Problematic case does not compile
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace long.division.solution
|
namespace long.division.solution
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
val MICROS_PER_DAY : Long = 24.toLong() * 60 * 60 * 1000 * 1000;
|
val MICROS_PER_DAY : Long = 24.toLong() * 60 * 60 * 1000 * 1000;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace elementary
|
namespace elementary
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
// Problematic case does not compile
|
// Problematic case does not compile
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace multicast
|
namespace multicast
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
println(-1.toByte().toChar().toInt())
|
println(-1.toByte().toChar().toInt())
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace cleverswap
|
namespace cleverswap
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
var x = 1
|
var x = 1
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace dos.equis
|
namespace dos.equis
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
// Problematic case does not compile
|
// Problematic case does not compile
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace last.laugh
|
namespace last.laugh
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
print("H" + "a")
|
print("H" + "a")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace animal.farm
|
namespace animal.farm
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
val pig = "length: 10";
|
val pig = "length: 10";
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace escape.rout
|
namespace escape.rout
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
// \u0022 is the Unicode escape for double quote (")
|
// \u0022 is the Unicode escape for double quote (")
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace hello.whirled
|
namespace hello.whirled
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generated by the IBM IDL-to-Java compiler, version 1.0
|
* Generated by the IBM IDL-to-Java compiler, version 1.0
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace line.printer
|
namespace line.printer
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
// Note: \u000A is Unicode representation of linefeed (LF)
|
// Note: \u000A is Unicode representation of linefeed (LF)
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
namespace whats.my.`class`
|
namespace whats.my.`class`
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.string.*
|
import kotlin.string.*
|
||||||
import std.jutils.*
|
import kotlin.jutils.*
|
||||||
|
|
||||||
class Me() {
|
class Me() {
|
||||||
fun main() {
|
fun main() {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
namespace whats.my.`class`.take2
|
namespace whats.my.`class`.take2
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.string.*
|
import kotlin.string.*
|
||||||
import std.jutils.*
|
import kotlin.jutils.*
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
|
||||||
class MeToo() {
|
class MeToo() {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace no.pain.no.gain
|
namespace no.pain.no.gain
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
val rnd = java.util.Random();
|
val rnd = java.util.Random();
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace big.delight.in.every.byte
|
namespace big.delight.in.every.byte
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
// for (b : Byte in Byte.MIN_VALUE..Byte.MAX_VALUE) {
|
// for (b : Byte in Byte.MIN_VALUE..Byte.MAX_VALUE) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace `in`.the.loop
|
namespace `in`.the.loop
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
val END = Integer.MAX_VALUE
|
val END = Integer.MAX_VALUE
|
||||||
val START = END - 100
|
val START = END - 100
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace ghost.of.looper
|
namespace ghost.of.looper
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
var i : Short = -1.toShort()
|
var i : Short = -1.toShort()
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace curse.of.loooper // BUG!!!
|
namespace curse.of.loooper // BUG!!!
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
class Curse<T : Comparable<T>>() {
|
class Curse<T : Comparable<T>>() {
|
||||||
fun curse(i : T, j : T) {
|
fun curse(i : T, j : T) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace down.`for`.the.count
|
namespace down.`for`.the.count
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
// Problematic code does not compile
|
// Problematic code does not compile
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace indecision
|
namespace indecision
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
println(decision())
|
println(decision())
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace unwelcome.guest
|
namespace unwelcome.guest
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
val GUEST_USER_ID = -1
|
val GUEST_USER_ID = -1
|
||||||
val USER_ID =
|
val USER_ID =
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
namespace the.reluctant.constructor
|
namespace the.reluctant.constructor
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
|
|
||||||
public class Reluctant() {
|
public class Reluctant() {
|
||||||
val internalInstance = Reluctant() // Recursion is obvious
|
val internalInstance = Reluctant() // Recursion is obvious
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace thrown.`for`.a.looop // BUG
|
namespace thrown.`for`.a.looop // BUG
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
fun iarr(vararg a : Int) = a // due to a BUG
|
fun iarr(vararg a : Int) = a // due to a BUG
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace well.dog.my.cats
|
namespace well.dog.my.cats
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
open class Counter {
|
open class Counter {
|
||||||
class object {
|
class object {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace all.i.get.`is`.static
|
namespace all.i.get.`is`.static
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
open class Dog() {
|
open class Dog() {
|
||||||
class object {
|
class object {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace `do`.your.thing
|
namespace `do`.your.thing
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
import _06_classy._53_Do_Your_Thing.Thing
|
import _06_classy._53_Do_Your_Thing.Thing
|
||||||
|
|
||||||
class MyThing(val arg : Int) : Thing(arg) {
|
class MyThing(val arg : Int) : Thing(arg) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace `null`.and.void
|
namespace `null`.and.void
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
class Null() {
|
class Null() {
|
||||||
class object {
|
class object {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace creationism
|
namespace creationism
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
|
|
||||||
class Creature() {
|
class Creature() {
|
||||||
class object {
|
class object {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace big.problem
|
namespace big.problem
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
import java.math.BigInteger
|
import java.math.BigInteger
|
||||||
|
|
||||||
fun main(args : Array<String>) {
|
fun main(args : Array<String>) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
namespace whats.the.difference
|
namespace whats.the.difference
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.*
|
import kotlin.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
fun iarray(vararg a : Int) = a // BUG
|
fun iarray(vararg a : Int) = a // BUG
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.jetbrains.jet.samples.vfs;
|
package org.jetbrains.jet.samples.vfs;
|
||||||
|
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
import java.util.concurrent.locks.ReadWriteLock;
|
import java.util.concurrent.locks.ReadWriteLock;
|
||||||
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
import java.util.concurrent.locks.ReentrantReadWriteLock;
|
||||||
import org.jetbrains.jet.samples.vfs.utils.*;
|
import org.jetbrains.jet.samples.vfs.utils.*;
|
||||||
@@ -12,7 +12,7 @@ import java.util.HashMap
|
|||||||
import java.util.Arrays
|
import java.util.Arrays
|
||||||
import java.util.Map
|
import java.util.Map
|
||||||
|
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.TimerTask
|
import java.util.TimerTask
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,8 +6,8 @@ import java.util.concurrent.locks.ReentrantLock
|
|||||||
import java.util.concurrent.LinkedBlockingQueue
|
import java.util.concurrent.LinkedBlockingQueue
|
||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
|
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
import java.util.Timer
|
import java.util.Timer
|
||||||
import java.util.TimerTask
|
import java.util.TimerTask
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package org.jetbrains.jet.samples.vfs.utils;
|
|||||||
|
|
||||||
import java.util.concurrent.locks.Lock
|
import java.util.concurrent.locks.Lock
|
||||||
import java.util.List
|
import java.util.List
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Executes task with given lock acquired.
|
* Executes task with given lock acquired.
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import java.io.FileInputStream
|
|||||||
import java.util.ArrayList
|
import java.util.ArrayList
|
||||||
import java.util.List
|
import java.util.List
|
||||||
|
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Abstract virtual file.
|
* Abstract virtual file.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.jetbrains.kotlin.examples.actors
|
package org.jetbrains.kotlin.examples.actors
|
||||||
|
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
import java.util.concurrent.*
|
import java.util.concurrent.*
|
||||||
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater
|
import java.util.concurrent.atomic.AtomicReferenceFieldUpdater
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.jetbrains.kotlin.examples.actors
|
package org.jetbrains.kotlin.examples.actors
|
||||||
|
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
import java.util.concurrent.Executor
|
import java.util.concurrent.Executor
|
||||||
import java.util.LinkedList
|
import java.util.LinkedList
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.jetbrains.kotlin.examples.actors
|
package org.jetbrains.kotlin.examples.actors
|
||||||
|
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
import org.jetbrains.kotlin.examples.actors.Actor
|
import org.jetbrains.kotlin.examples.actors.Actor
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
import java.util.LinkedList
|
import java.util.LinkedList
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.jetbrains.kotlin.examples.actors
|
package org.jetbrains.kotlin.examples.actors
|
||||||
|
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
import java.util.concurrent.Executor
|
import java.util.concurrent.Executor
|
||||||
import java.util.LinkedList
|
import java.util.LinkedList
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.jetbrains.kotlin.examples.actors
|
package org.jetbrains.kotlin.examples.actors
|
||||||
|
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
import java.util.concurrent.Executor
|
import java.util.concurrent.Executor
|
||||||
import java.util.LinkedList
|
import java.util.LinkedList
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.jetbrains.kotlin.examples.actors
|
package org.jetbrains.kotlin.examples.actors
|
||||||
|
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
import java.util.concurrent.Executor
|
import java.util.concurrent.Executor
|
||||||
import java.util.LinkedList
|
import java.util.LinkedList
|
||||||
import java.util.concurrent.Executors
|
import java.util.concurrent.Executors
|
||||||
|
|||||||
@@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
package lockperf_kotlin
|
package lockperf_kotlin
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import std.concurrent.*
|
import kotlin.concurrent.*
|
||||||
|
|
||||||
import java.util.concurrent.atomic.AtomicInteger;
|
import java.util.concurrent.atomic.AtomicInteger;
|
||||||
import java.util.concurrent.CountDownLatch;
|
import java.util.concurrent.CountDownLatch;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package luhnybin
|
package luhnybin
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import java.io.*
|
import java.io.*
|
||||||
import java.util.ArrayDeque
|
import java.util.ArrayDeque
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public class ImportClassHelperTest extends LightDaemonAnalyzerTestCase {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void testNoDefaultImport() {
|
public void testNoDefaultImport() {
|
||||||
testImportInFile("std.io.println");
|
testImportInFile("kotlin.io.println");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testImportBeforeObject() {
|
public void testImportBeforeObject() {
|
||||||
|
|||||||
@@ -124,7 +124,7 @@ public class Converter {
|
|||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
public File fileToFileWithCompatibilityImport(@NotNull PsiJavaFile javaFile) {
|
public File fileToFileWithCompatibilityImport(@NotNull PsiJavaFile javaFile) {
|
||||||
return fileToFile(javaFile, Collections.singletonList("std.compatibility.*"));
|
return fileToFile(javaFile, Collections.singletonList("kotlin.compatibility.*"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@NotNull
|
@NotNull
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
package demo
|
package demo
|
||||||
import std.compatibility.*
|
import kotlin.compatibility.*
|
||||||
open class Test() {
|
open class Test() {
|
||||||
open fun test() : Unit {
|
open fun test() : Unit {
|
||||||
var i : Int? = 10
|
var i : Int? = 10
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
package std
|
package kotlin
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import java.lang.Iterable
|
import java.lang.Iterable
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.jetbrains.kotlin.doc
|
package org.jetbrains.kotlin.doc
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
import org.jetbrains.kotlin.doc.templates.*
|
import org.jetbrains.kotlin.doc.templates.*
|
||||||
import org.jetbrains.kotlin.template.TextTemplate
|
import org.jetbrains.kotlin.template.TextTemplate
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.jetbrains.kotlin.doc
|
package org.jetbrains.kotlin.doc
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
import org.jetbrains.kotlin.doc.templates.*
|
import org.jetbrains.kotlin.doc.templates.*
|
||||||
import org.jetbrains.kotlin.template.TextTemplate
|
import org.jetbrains.kotlin.template.TextTemplate
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
import org.jetbrains.kotlin.model.KPackage
|
import org.jetbrains.kotlin.model.KPackage
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
import org.jetbrains.kotlin.model.KPackage
|
import org.jetbrains.kotlin.model.KPackage
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import org.jetbrains.kotlin.model.KClass
|
import org.jetbrains.kotlin.model.KClass
|
||||||
import org.jetbrains.kotlin.model.KAnnotation
|
import org.jetbrains.kotlin.model.KAnnotation
|
||||||
import org.jetbrains.kotlin.model.KPackage
|
import org.jetbrains.kotlin.model.KPackage
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
import org.jetbrains.kotlin.model.KPackage
|
import org.jetbrains.kotlin.model.KPackage
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
import org.jetbrains.kotlin.model.KPackage
|
import org.jetbrains.kotlin.model.KPackage
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
package org.jetbrains.kotlin.doc.templates
|
package org.jetbrains.kotlin.doc.templates
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import org.jetbrains.kotlin.model.KModel
|
import org.jetbrains.kotlin.model.KModel
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package org.jetbrains.kotlin.model
|
package org.jetbrains.kotlin.model
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
import org.jetbrains.kotlin.doc.templates.*
|
import org.jetbrains.kotlin.doc.templates.*
|
||||||
import org.jetbrains.kotlin.template.TextTemplate
|
import org.jetbrains.kotlin.template.TextTemplate
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
package org.jetbrains.kotlin.model
|
package org.jetbrains.kotlin.model
|
||||||
|
|
||||||
import java.lang.String
|
import java.lang.String
|
||||||
import std.*
|
import kotlin.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
|
|
||||||
import java.util.*
|
import java.util.*
|
||||||
import org.jetbrains.jet.lang.descriptors.ClassDescriptor
|
import org.jetbrains.jet.lang.descriptors.ClassDescriptor
|
||||||
@@ -120,7 +120,7 @@ abstract class KClassOrPackage : KAnnotated() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
class KModel(var context: BindingContext, var title: String = "Documentation", var version: String = "TODO") {
|
class KModel(var context: BindingContext, var title: String = "Documentation", var version: String = "TODO") {
|
||||||
// TODO generates java.lang.NoSuchMethodError: std.util.namespace.hashMap(Ljet/TypeInfo;Ljet/TypeInfo;)Ljava/util/HashMap;
|
// TODO generates java.lang.NoSuchMethodError: kotlin.util.namespace.hashMap(Ljet/TypeInfo;Ljet/TypeInfo;)Ljava/util/HashMap;
|
||||||
//val packages = sortedMap<String,KPackage>()
|
//val packages = sortedMap<String,KPackage>()
|
||||||
public val packageMap: SortedMap<String, KPackage> = TreeMap<String, KPackage>()
|
public val packageMap: SortedMap<String, KPackage> = TreeMap<String, KPackage>()
|
||||||
|
|
||||||
@@ -414,7 +414,7 @@ class KPackage(val model: KModel, val descriptor: NamespaceDescriptor,
|
|||||||
return if (answer.length == 0) "" else answer + "/"
|
return if (answer.length == 0) "" else answer + "/"
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO generates java.lang.NoSuchMethodError: std.util.namespace.hashMap(Ljet/TypeInfo;Ljet/TypeInfo;)Ljava/util/HashMap;
|
// TODO generates java.lang.NoSuchMethodError: kotlin.util.namespace.hashMap(Ljet/TypeInfo;Ljet/TypeInfo;)Ljava/util/HashMap;
|
||||||
//val classes = sortedMap<String,KClass>()
|
//val classes = sortedMap<String,KClass>()
|
||||||
public val classMap: SortedMap<String, KClass> = TreeMap<String, KClass>()
|
public val classMap: SortedMap<String, KClass> = TreeMap<String, KClass>()
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package org.jetbrains.kotlin.template
|
package org.jetbrains.kotlin.template
|
||||||
|
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import java.io.Writer
|
import java.io.Writer
|
||||||
import java.io.StringWriter
|
import java.io.StringWriter
|
||||||
import java.io.OutputStream
|
import java.io.OutputStream
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package test.kotlin.template
|
package test.kotlin.template
|
||||||
|
|
||||||
import std.*
|
import kotlin.*
|
||||||
import org.jetbrains.kotlin.template.*
|
import org.jetbrains.kotlin.template.*
|
||||||
import std.io.*
|
import kotlin.io.*
|
||||||
import std.util.*
|
import kotlin.util.*
|
||||||
import java.util.*
|
import java.util.*
|
||||||
|
|
||||||
import junit.framework.TestCase
|
import junit.framework.TestCase
|
||||||
|
|||||||
+10
-1
@@ -7,7 +7,16 @@
|
|||||||
</content>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="library" name="KotlinRuntime" level="project" />
|
<orderEntry type="library" exported="" name="KotlinRuntime" level="project" />
|
||||||
|
<orderEntry type="module-library" exported="">
|
||||||
|
<library>
|
||||||
|
<CLASSES>
|
||||||
|
<root url="jar://$MODULE_DIR$/lib/junit-4.9.jar!/" />
|
||||||
|
</CLASSES>
|
||||||
|
<JAVADOC />
|
||||||
|
<SOURCES />
|
||||||
|
</library>
|
||||||
|
</orderEntry>
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package org.jetbrains.kotlin.junit
|
||||||
|
|
||||||
|
import junit.framework.TestCase
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Useful base class for test cases using the old JUnit 3 naming convention of functions
|
||||||
|
* starting with "test*" as being a test case
|
||||||
|
*/
|
||||||
|
abstract class TestSupport() : TestCase() {
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package org.jetbrains.kotlin.test.junit
|
||||||
|
|
||||||
|
import kotlin.test.Asserter
|
||||||
|
import org.junit.Assert
|
||||||
|
|
||||||
|
class JUnitAsserter : Asserter {
|
||||||
|
override fun assertEquals(message : String, expected : Any?, actual : Any?) {
|
||||||
|
Assert.assertEquals(message, expected, actual)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun assertNotNull(message : String, actual : Any?) {
|
||||||
|
Assert.assertNotNull(message, actual)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun assertNull(message : String, actual : Any?) {
|
||||||
|
Assert.assertNull(message, actual)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun assertTrue(message : String, actual : Boolean) {
|
||||||
|
Assert.assertTrue(message, actual)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun fail(message : String) {
|
||||||
|
Assert.fail(message)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -10,6 +10,7 @@
|
|||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<orderEntry type="sourceFolder" forTests="false" />
|
||||||
<orderEntry type="module" module-name="stdlib" exported="" />
|
<orderEntry type="module" module-name="stdlib" exported="" />
|
||||||
<orderEntry type="module" module-name="testlib" exported="" />
|
<orderEntry type="module" module-name="testlib" exported="" />
|
||||||
|
<orderEntry type="module" module-name="kunit" exported="" />
|
||||||
</component>
|
</component>
|
||||||
</module>
|
</module>
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@
|
|||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package stdlib.testall;
|
package kotlinlib.testall;
|
||||||
|
|
||||||
import junit.framework.TestSuite;
|
import junit.framework.TestSuite;
|
||||||
import test.collections.*;
|
import test.collections.*;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user