diff --git a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/JavaToKotlinMethodMapGenerated.java b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/JavaToKotlinMethodMapGenerated.java index 1567fba6e8c..8257081a3e1 100644 --- a/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/JavaToKotlinMethodMapGenerated.java +++ b/compiler/frontend.java/src/org/jetbrains/jet/lang/resolve/java/kotlinSignature/JavaToKotlinMethodMapGenerated.java @@ -35,7 +35,7 @@ class JavaToKotlinMethodMapGenerated { ); put(b, "java.lang.String", "String", - pair("compareTo(java.lang.String)", "fun compareTo(that: kotlin.String): kotlin.Int"), + pair("compareTo(java.lang.String)", "fun compareTo(other: kotlin.String): kotlin.Int"), pair("equals(java.lang.Object)", "fun equals(other: kotlin.Any?): kotlin.Boolean"), pair("hashCode()", "fun hashCode(): kotlin.Int"), pair("toString()", "fun toString(): kotlin.String") diff --git a/compiler/testData/builtin-classes.txt b/compiler/testData/builtin-classes.txt index 08d744bdd40..9c78e90364a 100644 --- a/compiler/testData/builtin-classes.txt +++ b/compiler/testData/builtin-classes.txt @@ -1663,7 +1663,7 @@ public final class String : kotlin.Comparable, kotlin.CharSequenc /*primary*/ public constructor String() public open override /*1*/ val length: kotlin.Int public open override /*1*/ fun (): kotlin.Int - public open override /*1*/ fun compareTo(/*0*/ that: kotlin.String): kotlin.Int + public open override /*1*/ fun compareTo(/*0*/ other: kotlin.String): kotlin.Int public open override /*1*/ fun get(/*0*/ index: kotlin.Int): kotlin.Char public final fun plus(/*0*/ other: kotlin.Any?): kotlin.String } diff --git a/core/builtins/native/kotlin/Annotation.kt b/core/builtins/native/kotlin/Annotation.kt new file mode 100644 index 00000000000..51ddbaa2c50 --- /dev/null +++ b/core/builtins/native/kotlin/Annotation.kt @@ -0,0 +1,3 @@ +package kotlin + +public trait Annotation diff --git a/core/builtins/native/kotlin/Boolean.kt b/core/builtins/native/kotlin/Boolean.kt new file mode 100644 index 00000000000..3fb93f85bfa --- /dev/null +++ b/core/builtins/native/kotlin/Boolean.kt @@ -0,0 +1,13 @@ +package kotlin + +public class Boolean private () : Comparable { + public fun not(): Boolean + + public fun and(other: Boolean): Boolean + + public fun or(other: Boolean): Boolean + + public fun xor(other: Boolean): Boolean + + public override fun compareTo(other: Boolean): Int +} diff --git a/core/builtins/native/kotlin/CharSequence.kt b/core/builtins/native/kotlin/CharSequence.kt new file mode 100644 index 00000000000..fb074e27049 --- /dev/null +++ b/core/builtins/native/kotlin/CharSequence.kt @@ -0,0 +1,7 @@ +package kotlin + +public trait CharSequence { + public fun get(index: Int): Char + + public val length: Int +} diff --git a/core/builtins/native/kotlin/Comparable.kt b/core/builtins/native/kotlin/Comparable.kt new file mode 100644 index 00000000000..8c8229700ee --- /dev/null +++ b/core/builtins/native/kotlin/Comparable.kt @@ -0,0 +1,5 @@ +package kotlin + +public trait Comparable { + public fun compareTo(other: T): Int +} diff --git a/core/builtins/native/kotlin/Library.kt b/core/builtins/native/kotlin/Library.kt index e651761b0fc..bc49ecefc07 100644 --- a/core/builtins/native/kotlin/Library.kt +++ b/core/builtins/native/kotlin/Library.kt @@ -1,7 +1,5 @@ package kotlin -public trait Annotation - public fun Any?.identityEquals(other: Any?): Boolean // = this === other public fun Any?.equals(other: Any?): Boolean @@ -10,39 +8,3 @@ public fun Any?.equals(other: Any?): Boolean public fun Any?.toString(): String public fun String?.plus(other: Any?): String - -public trait Comparable { - public fun compareTo(other : T) : Int -} - -public class Boolean private () : Comparable { - public fun not() : Boolean - - public fun and(other : Boolean) : Boolean - - public fun or(other : Boolean) : Boolean - - public fun xor(other : Boolean) : Boolean - - public override fun compareTo(other : Boolean) : Int -} - -public trait CharSequence { - public fun get(index : Int) : Char - - public val length : Int -} - -public class String() : Comparable, CharSequence { - public fun plus(other : Any?) : String - - public override fun compareTo(that : String) : Int - public override fun get(index : Int) : Char - public override val length: Int -} - -public open class Throwable(message : String? = null, cause: Throwable? = null) { - public fun getMessage() : String? - public fun getCause() : Throwable? - public fun printStackTrace() : Unit -} diff --git a/core/builtins/native/kotlin/String.kt b/core/builtins/native/kotlin/String.kt new file mode 100644 index 00000000000..5400cd8e634 --- /dev/null +++ b/core/builtins/native/kotlin/String.kt @@ -0,0 +1,9 @@ +package kotlin + +public class String : Comparable, CharSequence { + public fun plus(other: Any?): String + + public override fun compareTo(other: String): Int + public override fun get(index: Int): Char + public override val length: Int +} diff --git a/core/builtins/native/kotlin/Throwable.kt b/core/builtins/native/kotlin/Throwable.kt new file mode 100644 index 00000000000..b6d5d744e21 --- /dev/null +++ b/core/builtins/native/kotlin/Throwable.kt @@ -0,0 +1,9 @@ +package kotlin + +public open class Throwable(message: String? = null, cause: Throwable? = null) { + public fun getMessage(): String? + + public fun getCause(): Throwable? + + public fun printStackTrace(): Unit +}