Make builtin classes final. (#53)

This commit is contained in:
Nikolay Igotti
2016-11-11 17:35:37 +03:00
committed by GitHub
parent 4b7f67d976
commit 4a0b78f7b4
6 changed files with 11 additions and 11 deletions
+1 -1
View File
@@ -2,7 +2,7 @@ package kotlin
// TODO: remove that, as RTTI shall be per instantiation. // TODO: remove that, as RTTI shall be per instantiation.
@ExportTypeInfo("theArrayTypeInfo") @ExportTypeInfo("theArrayTypeInfo")
class Array<T> : Cloneable { public final class Array<T> : Cloneable {
// Constructors are handled with compiler magic. // Constructors are handled with compiler magic.
public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {} public constructor(@Suppress("UNUSED_PARAMETER") size: Int) {}
+1 -1
View File
@@ -4,7 +4,7 @@ package kotlin
* Represents a value which is either `true` or `false`. On the JVM, non-nullable values of this type are * Represents a value which is either `true` or `false`. On the JVM, non-nullable values of this type are
* represented as values of the primitive type `boolean`. * represented as values of the primitive type `boolean`.
*/ */
public class Boolean : Comparable<Boolean> { public final class Boolean : Comparable<Boolean> {
/** /**
* Returns the inverse of this boolean. * Returns the inverse of this boolean.
*/ */
+1 -1
View File
@@ -4,7 +4,7 @@ package kotlin
* Represents a 16-bit Unicode character. * Represents a 16-bit Unicode character.
* On the JVM, non-nullable values of this type are represented as values of the primitive type `char`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `char`.
*/ */
public class Char : Comparable<Char> { public final class Char : Comparable<Char> {
/** /**
* Compares this value with the specified value for order. * Compares this value with the specified value for order.
+1 -1
View File
@@ -4,4 +4,4 @@ package kotlin
* Nothing has no instances. You can use Nothing to represent "a value that never exists": for example, * Nothing has no instances. You can use Nothing to represent "a value that never exists": for example,
* if a function has the return type of Nothing, it means that it never returns (always throws an exception). * if a function has the return type of Nothing, it means that it never returns (always throws an exception).
*/ */
public class Nothing private constructor() {} public final class Nothing private constructor() {}
+6 -6
View File
@@ -4,7 +4,7 @@ package kotlin
* Represents a 8-bit signed integer. * Represents a 8-bit signed integer.
* On the JVM, non-nullable values of this type are represented as values of the primitive type `byte`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `byte`.
*/ */
public class Byte : Number(), Comparable<Byte> { public final class Byte : Number(), Comparable<Byte> {
companion object { companion object {
/** /**
* A constant holding the minimum value an instance of Byte can have. * A constant holding the minimum value an instance of Byte can have.
@@ -201,7 +201,7 @@ public class Byte : Number(), Comparable<Byte> {
* Represents a 16-bit signed integer. * Represents a 16-bit signed integer.
* On the JVM, non-nullable values of this type are represented as values of the primitive type `short`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `short`.
*/ */
public class Short : Number(), Comparable<Short> { public final class Short : Number(), Comparable<Short> {
companion object { companion object {
/** /**
* A constant holding the minimum value an instance of Short can have. * A constant holding the minimum value an instance of Short can have.
@@ -398,7 +398,7 @@ public class Short : Number(), Comparable<Short> {
* Represents a 32-bit signed integer. * Represents a 32-bit signed integer.
* On the JVM, non-nullable values of this type are represented as values of the primitive type `int`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `int`.
*/ */
public class Int : Number(), Comparable<Int> { public final class Int : Number(), Comparable<Int> {
companion object { companion object {
/** /**
* A constant holding the minimum value an instance of Int can have. * A constant holding the minimum value an instance of Int can have.
@@ -617,7 +617,7 @@ public class Int : Number(), Comparable<Int> {
* Represents a 64-bit signed integer. * Represents a 64-bit signed integer.
* On the JVM, non-nullable values of this type are represented as values of the primitive type `long`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `long`.
*/ */
public class Long : Number(), Comparable<Long> { public final class Long : Number(), Comparable<Long> {
companion object { companion object {
/** /**
* A constant holding the minimum value an instance of Long can have. * A constant holding the minimum value an instance of Long can have.
@@ -836,7 +836,7 @@ public class Long : Number(), Comparable<Long> {
* Represents a single-precision 32-bit IEEE 754 floating point number. * Represents a single-precision 32-bit IEEE 754 floating point number.
* On the JVM, non-nullable values of this type are represented as values of the primitive type `float`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `float`.
*/ */
public class Float : Number(), Comparable<Float> { public final class Float : Number(), Comparable<Float> {
companion object { companion object {
/** /**
* A constant holding the smallest *positive* nonzero value of Float. * A constant holding the smallest *positive* nonzero value of Float.
@@ -1040,7 +1040,7 @@ public class Float : Number(), Comparable<Float> {
* Represents a double-precision 64-bit IEEE 754 floating point number. * Represents a double-precision 64-bit IEEE 754 floating point number.
* On the JVM, non-nullable values of this type are represented as values of the primitive type `double`. * On the JVM, non-nullable values of this type are represented as values of the primitive type `double`.
*/ */
public class Double : Number(), Comparable<Double> { public final class Double : Number(), Comparable<Double> {
companion object { companion object {
/** /**
* A constant holding the smallest *positive* nonzero value of Double. * A constant holding the smallest *positive* nonzero value of Double.
+1 -1
View File
@@ -4,7 +4,7 @@ package kotlin
external fun fromUtf8Array(array: ByteArray) : String external fun fromUtf8Array(array: ByteArray) : String
@ExportTypeInfo("theStringTypeInfo") @ExportTypeInfo("theStringTypeInfo")
class String : Comparable<String>, CharSequence { public final class String : Comparable<String>, CharSequence {
@SymbolName("Kotlin_String_hashCode") @SymbolName("Kotlin_String_hashCode")
external public override fun hashCode(): Int external public override fun hashCode(): Int