diff --git a/core/builtins/native/kotlin/Annotation.kt b/core/builtins/native/kotlin/Annotation.kt index 1f6db4aaeed..5557fddb15f 100644 --- a/core/builtins/native/kotlin/Annotation.kt +++ b/core/builtins/native/kotlin/Annotation.kt @@ -17,8 +17,8 @@ package kotlin /** - * Base trait implicitly implemented by all annotation interfaces. + * Base interface implicitly implemented by all annotation interfaces. * See [Kotlin language documentation](http://kotlinlang.org/docs/reference/annotations.html) for more information * on annotations. */ -public trait Annotation +public interface Annotation diff --git a/core/builtins/native/kotlin/CharSequence.kt b/core/builtins/native/kotlin/CharSequence.kt index a251e3b7064..e3ebc00c84f 100644 --- a/core/builtins/native/kotlin/CharSequence.kt +++ b/core/builtins/native/kotlin/CharSequence.kt @@ -19,7 +19,7 @@ package kotlin /** * Represents a readable sequence of [Char] values. */ -public trait CharSequence { +public interface CharSequence { /** * Returns the length of this character sequence. */ diff --git a/core/builtins/native/kotlin/Cloneable.kt b/core/builtins/native/kotlin/Cloneable.kt index 42d1837f548..7588573eae8 100644 --- a/core/builtins/native/kotlin/Cloneable.kt +++ b/core/builtins/native/kotlin/Cloneable.kt @@ -17,9 +17,9 @@ package kotlin /** - * Classes that inherit from this trait support creating field-by-field copies of their instances. + * Classes that inherit from this interface support creating field-by-field copies of their instances. */ -public trait Cloneable { +public interface Cloneable { /** * Creates and returns a field-by-field copy of this object. */ diff --git a/core/builtins/native/kotlin/Collections.kt b/core/builtins/native/kotlin/Collections.kt index d8bf8d4bd19..884cb0a2ad8 100644 --- a/core/builtins/native/kotlin/Collections.kt +++ b/core/builtins/native/kotlin/Collections.kt @@ -17,11 +17,11 @@ package kotlin /** - * Classes that inherit from this trait can be represented as a sequence of elements that can + * Classes that inherit from this interface can be represented as a sequence of elements that can * be iterated over. * @param T the type of element being iterated over. */ -public trait Iterable { +public interface Iterable { /** * Returns an iterator over the elements of this object. */ @@ -29,10 +29,10 @@ public trait Iterable { } /** - * Classes that inherit from this trait can be represented as a sequence of elements that can + * Classes that inherit from this interface can be represented as a sequence of elements that can * be iterated over and that supports removing elements during iteration. */ -public trait MutableIterable : Iterable { +public interface MutableIterable : Iterable { /** * Returns an iterator over the elementrs of this sequence that supports removing elements during iteration. */ @@ -40,11 +40,11 @@ public trait MutableIterable : Iterable { } /** - * A generic collection of elements. Methods in this trait support only read-only access to the collection; - * read/write access is supported through the [MutableCollection] trait. + * A generic collection of elements. Methods in this interface support only read-only access to the collection; + * read/write access is supported through the [MutableCollection] interface. * @param E the type of elements contained in the collection. */ -public trait Collection : Iterable { +public interface Collection : Iterable { // Query Operations /** * Returns the size of the collection. @@ -72,7 +72,7 @@ public trait Collection : Iterable { /** * A generic collection of elements that supports adding and removing elements. */ -public trait MutableCollection : Collection, MutableIterable { +public interface MutableCollection : Collection, MutableIterable { // Query Operations override fun iterator(): MutableIterator @@ -121,11 +121,11 @@ public trait MutableCollection : Collection, MutableIterable { } /** - * A generic ordered collection of elements. Methods in this trait support only read-only access to the list; - * read/write access is supported through the [MutableList] trait. + * A generic ordered collection of elements. Methods in this interface support only read-only access to the list; + * read/write access is supported through the [MutableList] interface. * @param E the type of elements contained in the list. */ -public trait List : Collection { +public interface List : Collection { // Query Operations override fun size(): Int override fun isEmpty(): Boolean @@ -177,7 +177,7 @@ public trait List : Collection { * A generic ordered collection of elements that supports adding and removing elements. * @param E the type of elements contained in the list. */ -public trait MutableList : List, MutableCollection { +public interface MutableList : List, MutableCollection { // Modification Operations override fun add(e: E): Boolean override fun remove(o: Any?): Boolean @@ -225,11 +225,11 @@ public trait MutableList : List, MutableCollection { /** * A generic unordered collection of elements that does not support duplicate elements. - * Methods in this trait support only read-only access to the set; - * read/write access is supported through the [MutableSet] trait. + * Methods in this interface support only read-only access to the set; + * read/write access is supported through the [MutableSet] interface. * @param E the type of elements contained in the set. */ -public trait Set : Collection { +public interface Set : Collection { // Query Operations override fun size(): Int override fun isEmpty(): Boolean @@ -245,7 +245,7 @@ public trait Set : Collection { * adding and removing elements. * @param E the type of elements contained in the set. */ -public trait MutableSet : Set, MutableCollection { +public interface MutableSet : Set, MutableCollection { // Query Operations override fun iterator(): MutableIterator @@ -263,12 +263,12 @@ public trait MutableSet : Set, MutableCollection { /** * A collection that holds pairs of objects (keys and values) and supports efficiently retrieving * the value corresponding to each key. Map keys are unique; the map holds only one value for each key. - * Methods in this trait support only read-only access to the map; read-write access is supported through - * the [MutableMap] trait. + * Methods in this interface support only read-only access to the map; read-write access is supported through + * the [MutableMap] interface. * @param K the type of map keys. * @param V the type of map values. */ -public trait Map { +public interface Map { // Query Operations /** * Returns the number of key/value pairs in the map. @@ -314,7 +314,7 @@ public trait Map { /** * Represents a key/value pair held by a [Map]. */ - public trait Entry { + public interface Entry { /** * Returns the key of this key/value pair. */ @@ -333,7 +333,7 @@ public trait Map { * @param K the type of map keys. * @param V the type of map values. */ -public trait MutableMap : Map { +public interface MutableMap : Map { // Modification Operations /** * Associates the specified [value] with the specified [key] in the map. @@ -368,7 +368,7 @@ public trait MutableMap : Map { /** * Represents a key/value pair held by a [MutableMap]. */ - public trait MutableEntry: Map.Entry { + public interface MutableEntry: Map.Entry { /** * Changes the value associated with the key of this entry. * diff --git a/core/builtins/native/kotlin/Comparable.kt b/core/builtins/native/kotlin/Comparable.kt index 19873815c9a..0fffb68bc14 100644 --- a/core/builtins/native/kotlin/Comparable.kt +++ b/core/builtins/native/kotlin/Comparable.kt @@ -17,9 +17,9 @@ package kotlin /** - * Classes which inherit from this trait have a defined total ordering between their instances. + * Classes which inherit from this interface have a defined total ordering between their instances. */ -public trait Comparable { +public interface Comparable { /** * Compares this object with the specified object for order. Returns zero if this object is equal * to the specified [other] object, a negative number if it's less than [other], or a positive number diff --git a/core/builtins/native/kotlin/Iterator.kt b/core/builtins/native/kotlin/Iterator.kt index c85b955f561..8f6d2f0662c 100644 --- a/core/builtins/native/kotlin/Iterator.kt +++ b/core/builtins/native/kotlin/Iterator.kt @@ -20,7 +20,7 @@ package kotlin * An iterator over a collection or another entity that can be represented as a sequence of elements. * Allows to sequentially access the elements. */ -public trait Iterator { +public interface Iterator { /** * Returns the next element in the iteration. */ @@ -36,7 +36,7 @@ public trait Iterator { * An iterator over a mutable collection. Provides the ability to remove elements while iterating. * @see MutableCollection.iterator */ -public trait MutableIterator : Iterator { +public interface MutableIterator : Iterator { /** * Removes from the underlying collection the last element returned by this iterator. */ @@ -47,7 +47,7 @@ public trait MutableIterator : Iterator { * An iterator over a collection that supports indexed access. * @see List.listIterator */ -public trait ListIterator : Iterator { +public interface ListIterator : Iterator { // Query Operations override fun next(): T override fun hasNext(): Boolean @@ -77,7 +77,7 @@ public trait ListIterator : Iterator { * An iterator over a mutable collection that supports indexed access. Provides the ability * to add, modify and remove elements while iterating. */ -public trait MutableListIterator : ListIterator, MutableIterator { +public interface MutableListIterator : ListIterator, MutableIterator { // Query Operations override fun next(): T override fun hasNext(): Boolean diff --git a/core/builtins/src/kotlin/ExtensionFunctions.kt b/core/builtins/src/kotlin/ExtensionFunctions.kt index 330650d6eed..1b4f7edb90e 100644 --- a/core/builtins/src/kotlin/ExtensionFunctions.kt +++ b/core/builtins/src/kotlin/ExtensionFunctions.kt @@ -19,117 +19,117 @@ package kotlin /** An extension function that takes 0 arguments. */ -public trait ExtensionFunction0 { +public interface ExtensionFunction0 { /** Invokes the function. */ public fun T.invoke(): R } /** An extension function that takes 1 argument. */ -public trait ExtensionFunction1 { +public interface ExtensionFunction1 { /** Invokes the function with the specified argument. */ public fun T.invoke(p1: P1): R } /** An extension function that takes 2 arguments. */ -public trait ExtensionFunction2 { +public interface ExtensionFunction2 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2): R } /** An extension function that takes 3 arguments. */ -public trait ExtensionFunction3 { +public interface ExtensionFunction3 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3): R } /** An extension function that takes 4 arguments. */ -public trait ExtensionFunction4 { +public interface ExtensionFunction4 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4): R } /** An extension function that takes 5 arguments. */ -public trait ExtensionFunction5 { +public interface ExtensionFunction5 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): R } /** An extension function that takes 6 arguments. */ -public trait ExtensionFunction6 { +public interface ExtensionFunction6 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): R } /** An extension function that takes 7 arguments. */ -public trait ExtensionFunction7 { +public interface ExtensionFunction7 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): R } /** An extension function that takes 8 arguments. */ -public trait ExtensionFunction8 { +public interface ExtensionFunction8 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): R } /** An extension function that takes 9 arguments. */ -public trait ExtensionFunction9 { +public interface ExtensionFunction9 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): R } /** An extension function that takes 10 arguments. */ -public trait ExtensionFunction10 { +public interface ExtensionFunction10 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10): R } /** An extension function that takes 11 arguments. */ -public trait ExtensionFunction11 { +public interface ExtensionFunction11 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11): R } /** An extension function that takes 12 arguments. */ -public trait ExtensionFunction12 { +public interface ExtensionFunction12 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12): R } /** An extension function that takes 13 arguments. */ -public trait ExtensionFunction13 { +public interface ExtensionFunction13 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13): R } /** An extension function that takes 14 arguments. */ -public trait ExtensionFunction14 { +public interface ExtensionFunction14 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14): R } /** An extension function that takes 15 arguments. */ -public trait ExtensionFunction15 { +public interface ExtensionFunction15 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15): R } /** An extension function that takes 16 arguments. */ -public trait ExtensionFunction16 { +public interface ExtensionFunction16 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16): R } /** An extension function that takes 17 arguments. */ -public trait ExtensionFunction17 { +public interface ExtensionFunction17 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17): R } /** An extension function that takes 18 arguments. */ -public trait ExtensionFunction18 { +public interface ExtensionFunction18 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18): R } /** An extension function that takes 19 arguments. */ -public trait ExtensionFunction19 { +public interface ExtensionFunction19 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19): R } /** An extension function that takes 20 arguments. */ -public trait ExtensionFunction20 { +public interface ExtensionFunction20 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20): R } /** An extension function that takes 21 arguments. */ -public trait ExtensionFunction21 { +public interface ExtensionFunction21 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21): R } /** An extension function that takes 22 arguments. */ -public trait ExtensionFunction22 { +public interface ExtensionFunction22 { /** Invokes the function with the specified arguments. */ public fun T.invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21, p22: P22): R } diff --git a/core/builtins/src/kotlin/FloatingPointConstants.kt b/core/builtins/src/kotlin/FloatingPointConstants.kt index dfe93baed24..c9990d96486 100644 --- a/core/builtins/src/kotlin/FloatingPointConstants.kt +++ b/core/builtins/src/kotlin/FloatingPointConstants.kt @@ -19,7 +19,7 @@ package kotlin /** * Holder for special values of floating point types. */ -public trait FloatingPointConstants { +public interface FloatingPointConstants { /** * A constant holding the positive infinity value. */ diff --git a/core/builtins/src/kotlin/Functions.kt b/core/builtins/src/kotlin/Functions.kt index 18a16c56e1c..81ac8c558bc 100644 --- a/core/builtins/src/kotlin/Functions.kt +++ b/core/builtins/src/kotlin/Functions.kt @@ -19,117 +19,117 @@ package kotlin /** A function that takes 0 arguments. */ -public trait Function0 { +public interface Function0 { /** Invokes the function. */ public fun invoke(): R } /** A function that takes 1 argument. */ -public trait Function1 { +public interface Function1 { /** Invokes the function with the specified argument. */ public fun invoke(p1: P1): R } /** A function that takes 2 arguments. */ -public trait Function2 { +public interface Function2 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2): R } /** A function that takes 3 arguments. */ -public trait Function3 { +public interface Function3 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3): R } /** A function that takes 4 arguments. */ -public trait Function4 { +public interface Function4 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4): R } /** A function that takes 5 arguments. */ -public trait Function5 { +public interface Function5 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5): R } /** A function that takes 6 arguments. */ -public trait Function6 { +public interface Function6 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6): R } /** A function that takes 7 arguments. */ -public trait Function7 { +public interface Function7 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7): R } /** A function that takes 8 arguments. */ -public trait Function8 { +public interface Function8 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8): R } /** A function that takes 9 arguments. */ -public trait Function9 { +public interface Function9 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9): R } /** A function that takes 10 arguments. */ -public trait Function10 { +public interface Function10 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10): R } /** A function that takes 11 arguments. */ -public trait Function11 { +public interface Function11 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11): R } /** A function that takes 12 arguments. */ -public trait Function12 { +public interface Function12 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12): R } /** A function that takes 13 arguments. */ -public trait Function13 { +public interface Function13 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13): R } /** A function that takes 14 arguments. */ -public trait Function14 { +public interface Function14 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14): R } /** A function that takes 15 arguments. */ -public trait Function15 { +public interface Function15 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15): R } /** A function that takes 16 arguments. */ -public trait Function16 { +public interface Function16 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16): R } /** A function that takes 17 arguments. */ -public trait Function17 { +public interface Function17 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17): R } /** A function that takes 18 arguments. */ -public trait Function18 { +public interface Function18 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18): R } /** A function that takes 19 arguments. */ -public trait Function19 { +public interface Function19 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19): R } /** A function that takes 20 arguments. */ -public trait Function20 { +public interface Function20 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20): R } /** A function that takes 21 arguments. */ -public trait Function21 { +public interface Function21 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21): R } /** A function that takes 22 arguments. */ -public trait Function22 { +public interface Function22 { /** Invokes the function with the specified arguments. */ public fun invoke(p1: P1, p2: P2, p3: P3, p4: P4, p5: P5, p6: P6, p7: P7, p8: P8, p9: P9, p10: P10, p11: P11, p12: P12, p13: P13, p14: P14, p15: P15, p16: P16, p17: P17, p18: P18, p19: P19, p20: P20, p21: P21, p22: P22): R } diff --git a/core/builtins/src/kotlin/Progression.kt b/core/builtins/src/kotlin/Progression.kt index f912d4ddd48..9f245a43ac5 100644 --- a/core/builtins/src/kotlin/Progression.kt +++ b/core/builtins/src/kotlin/Progression.kt @@ -22,7 +22,7 @@ package kotlin * bytecode generation for it. Progressions with a step of -1 can be created through the * `downTo` method on classes representing primitive types. */ -public trait Progression : Iterable { +public interface Progression : Iterable { /** * The start value of the progression. */ diff --git a/core/builtins/src/kotlin/PropertyMetadata.kt b/core/builtins/src/kotlin/PropertyMetadata.kt index f7c473a280d..48b7c957de4 100644 --- a/core/builtins/src/kotlin/PropertyMetadata.kt +++ b/core/builtins/src/kotlin/PropertyMetadata.kt @@ -19,7 +19,7 @@ package kotlin /** * Represents a property in a Kotlin class. */ -public trait PropertyMetadata { +public interface PropertyMetadata { /** * The name of the property. */ diff --git a/core/builtins/src/kotlin/Range.kt b/core/builtins/src/kotlin/Range.kt index fad08d53c6d..aeff20cfaa3 100644 --- a/core/builtins/src/kotlin/Range.kt +++ b/core/builtins/src/kotlin/Range.kt @@ -20,7 +20,7 @@ package kotlin * Represents a range of values (for example, numbers or characters). * See the [Kotlin language documentation](http://kotlinlang.org/docs/reference/ranges.html) for more information. */ -public trait Range> { +public interface Range> { /** * The minimum value in the range. */ diff --git a/core/builtins/src/kotlin/reflect/KCallable.kt b/core/builtins/src/kotlin/reflect/KCallable.kt index 0f59c90242c..554d3d46fbb 100644 --- a/core/builtins/src/kotlin/reflect/KCallable.kt +++ b/core/builtins/src/kotlin/reflect/KCallable.kt @@ -21,7 +21,7 @@ package kotlin.reflect * * @param R return type of the callable. */ -public trait KCallable { +public interface KCallable { /** * The name of this callable as it was declared in the source code. */ diff --git a/core/builtins/src/kotlin/reflect/KClass.kt b/core/builtins/src/kotlin/reflect/KClass.kt index 552b7e68d8f..3a89c246fdb 100644 --- a/core/builtins/src/kotlin/reflect/KClass.kt +++ b/core/builtins/src/kotlin/reflect/KClass.kt @@ -24,7 +24,7 @@ package kotlin.reflect * * @param T the type of the class. */ -public trait KClass { +public interface KClass { /** * The simple name of the class as it was declared in the source code, * or `null` if the class has no name (e.g. anonymous object literals). diff --git a/core/builtins/src/kotlin/reflect/KExtensionFunctions.kt b/core/builtins/src/kotlin/reflect/KExtensionFunctions.kt index 3ea1b55e5a4..615644126e1 100644 --- a/core/builtins/src/kotlin/reflect/KExtensionFunctions.kt +++ b/core/builtins/src/kotlin/reflect/KExtensionFunctions.kt @@ -19,48 +19,48 @@ package kotlin.reflect /** An extension function with introspection capabilities that takes 0 arguments. */ -public trait KExtensionFunction0 : ExtensionFunction0 +public interface KExtensionFunction0 : ExtensionFunction0 /** An extension function with introspection capabilities that takes 1 argument. */ -public trait KExtensionFunction1 : ExtensionFunction1 +public interface KExtensionFunction1 : ExtensionFunction1 /** An extension function with introspection capabilities that takes 2 arguments. */ -public trait KExtensionFunction2 : ExtensionFunction2 +public interface KExtensionFunction2 : ExtensionFunction2 /** An extension function with introspection capabilities that takes 3 arguments. */ -public trait KExtensionFunction3 : ExtensionFunction3 +public interface KExtensionFunction3 : ExtensionFunction3 /** An extension function with introspection capabilities that takes 4 arguments. */ -public trait KExtensionFunction4 : ExtensionFunction4 +public interface KExtensionFunction4 : ExtensionFunction4 /** An extension function with introspection capabilities that takes 5 arguments. */ -public trait KExtensionFunction5 : ExtensionFunction5 +public interface KExtensionFunction5 : ExtensionFunction5 /** An extension function with introspection capabilities that takes 6 arguments. */ -public trait KExtensionFunction6 : ExtensionFunction6 +public interface KExtensionFunction6 : ExtensionFunction6 /** An extension function with introspection capabilities that takes 7 arguments. */ -public trait KExtensionFunction7 : ExtensionFunction7 +public interface KExtensionFunction7 : ExtensionFunction7 /** An extension function with introspection capabilities that takes 8 arguments. */ -public trait KExtensionFunction8 : ExtensionFunction8 +public interface KExtensionFunction8 : ExtensionFunction8 /** An extension function with introspection capabilities that takes 9 arguments. */ -public trait KExtensionFunction9 : ExtensionFunction9 +public interface KExtensionFunction9 : ExtensionFunction9 /** An extension function with introspection capabilities that takes 10 arguments. */ -public trait KExtensionFunction10 : ExtensionFunction10 +public interface KExtensionFunction10 : ExtensionFunction10 /** An extension function with introspection capabilities that takes 11 arguments. */ -public trait KExtensionFunction11 : ExtensionFunction11 +public interface KExtensionFunction11 : ExtensionFunction11 /** An extension function with introspection capabilities that takes 12 arguments. */ -public trait KExtensionFunction12 : ExtensionFunction12 +public interface KExtensionFunction12 : ExtensionFunction12 /** An extension function with introspection capabilities that takes 13 arguments. */ -public trait KExtensionFunction13 : ExtensionFunction13 +public interface KExtensionFunction13 : ExtensionFunction13 /** An extension function with introspection capabilities that takes 14 arguments. */ -public trait KExtensionFunction14 : ExtensionFunction14 +public interface KExtensionFunction14 : ExtensionFunction14 /** An extension function with introspection capabilities that takes 15 arguments. */ -public trait KExtensionFunction15 : ExtensionFunction15 +public interface KExtensionFunction15 : ExtensionFunction15 /** An extension function with introspection capabilities that takes 16 arguments. */ -public trait KExtensionFunction16 : ExtensionFunction16 +public interface KExtensionFunction16 : ExtensionFunction16 /** An extension function with introspection capabilities that takes 17 arguments. */ -public trait KExtensionFunction17 : ExtensionFunction17 +public interface KExtensionFunction17 : ExtensionFunction17 /** An extension function with introspection capabilities that takes 18 arguments. */ -public trait KExtensionFunction18 : ExtensionFunction18 +public interface KExtensionFunction18 : ExtensionFunction18 /** An extension function with introspection capabilities that takes 19 arguments. */ -public trait KExtensionFunction19 : ExtensionFunction19 +public interface KExtensionFunction19 : ExtensionFunction19 /** An extension function with introspection capabilities that takes 20 arguments. */ -public trait KExtensionFunction20 : ExtensionFunction20 +public interface KExtensionFunction20 : ExtensionFunction20 /** An extension function with introspection capabilities that takes 21 arguments. */ -public trait KExtensionFunction21 : ExtensionFunction21 +public interface KExtensionFunction21 : ExtensionFunction21 /** An extension function with introspection capabilities that takes 22 arguments. */ -public trait KExtensionFunction22 : ExtensionFunction22 +public interface KExtensionFunction22 : ExtensionFunction22 diff --git a/core/builtins/src/kotlin/reflect/KExtensionProperty.kt b/core/builtins/src/kotlin/reflect/KExtensionProperty.kt index 4cefea1afa3..817e1c3c216 100644 --- a/core/builtins/src/kotlin/reflect/KExtensionProperty.kt +++ b/core/builtins/src/kotlin/reflect/KExtensionProperty.kt @@ -24,7 +24,7 @@ package kotlin.reflect * @param E the type of the extension receiver. * @param R the type of the property. */ -public trait KExtensionProperty : KProperty { +public interface KExtensionProperty : KProperty { /** * Returns the current value of the property. * @@ -36,7 +36,7 @@ public trait KExtensionProperty : KProperty { /** * Represents an extension property declared as a `var`. */ -public trait KMutableExtensionProperty : KExtensionProperty, KMutableProperty { +public interface KMutableExtensionProperty : KExtensionProperty, KMutableProperty { /** * Modifies the value of the property. * diff --git a/core/builtins/src/kotlin/reflect/KFunctions.kt b/core/builtins/src/kotlin/reflect/KFunctions.kt index c5397f68eb8..f79c41ae2b4 100644 --- a/core/builtins/src/kotlin/reflect/KFunctions.kt +++ b/core/builtins/src/kotlin/reflect/KFunctions.kt @@ -19,48 +19,48 @@ package kotlin.reflect /** A function with introspection capabilities that takes 0 arguments. */ -public trait KFunction0 : Function0 +public interface KFunction0 : Function0 /** A function with introspection capabilities that takes 1 argument. */ -public trait KFunction1 : Function1 +public interface KFunction1 : Function1 /** A function with introspection capabilities that takes 2 arguments. */ -public trait KFunction2 : Function2 +public interface KFunction2 : Function2 /** A function with introspection capabilities that takes 3 arguments. */ -public trait KFunction3 : Function3 +public interface KFunction3 : Function3 /** A function with introspection capabilities that takes 4 arguments. */ -public trait KFunction4 : Function4 +public interface KFunction4 : Function4 /** A function with introspection capabilities that takes 5 arguments. */ -public trait KFunction5 : Function5 +public interface KFunction5 : Function5 /** A function with introspection capabilities that takes 6 arguments. */ -public trait KFunction6 : Function6 +public interface KFunction6 : Function6 /** A function with introspection capabilities that takes 7 arguments. */ -public trait KFunction7 : Function7 +public interface KFunction7 : Function7 /** A function with introspection capabilities that takes 8 arguments. */ -public trait KFunction8 : Function8 +public interface KFunction8 : Function8 /** A function with introspection capabilities that takes 9 arguments. */ -public trait KFunction9 : Function9 +public interface KFunction9 : Function9 /** A function with introspection capabilities that takes 10 arguments. */ -public trait KFunction10 : Function10 +public interface KFunction10 : Function10 /** A function with introspection capabilities that takes 11 arguments. */ -public trait KFunction11 : Function11 +public interface KFunction11 : Function11 /** A function with introspection capabilities that takes 12 arguments. */ -public trait KFunction12 : Function12 +public interface KFunction12 : Function12 /** A function with introspection capabilities that takes 13 arguments. */ -public trait KFunction13 : Function13 +public interface KFunction13 : Function13 /** A function with introspection capabilities that takes 14 arguments. */ -public trait KFunction14 : Function14 +public interface KFunction14 : Function14 /** A function with introspection capabilities that takes 15 arguments. */ -public trait KFunction15 : Function15 +public interface KFunction15 : Function15 /** A function with introspection capabilities that takes 16 arguments. */ -public trait KFunction16 : Function16 +public interface KFunction16 : Function16 /** A function with introspection capabilities that takes 17 arguments. */ -public trait KFunction17 : Function17 +public interface KFunction17 : Function17 /** A function with introspection capabilities that takes 18 arguments. */ -public trait KFunction18 : Function18 +public interface KFunction18 : Function18 /** A function with introspection capabilities that takes 19 arguments. */ -public trait KFunction19 : Function19 +public interface KFunction19 : Function19 /** A function with introspection capabilities that takes 20 arguments. */ -public trait KFunction20 : Function20 +public interface KFunction20 : Function20 /** A function with introspection capabilities that takes 21 arguments. */ -public trait KFunction21 : Function21 +public interface KFunction21 : Function21 /** A function with introspection capabilities that takes 22 arguments. */ -public trait KFunction22 : Function22 +public interface KFunction22 : Function22 diff --git a/core/builtins/src/kotlin/reflect/KMemberExtensionProperty.kt b/core/builtins/src/kotlin/reflect/KMemberExtensionProperty.kt index 1841d37a7d5..a99c19a4f9f 100644 --- a/core/builtins/src/kotlin/reflect/KMemberExtensionProperty.kt +++ b/core/builtins/src/kotlin/reflect/KMemberExtensionProperty.kt @@ -26,7 +26,7 @@ package kotlin.reflect * @param E the type of the extension receiver. * @param R the type of the property. */ -public trait KMemberExtensionProperty : KProperty { +public interface KMemberExtensionProperty : KProperty { /** * Returns the current value of the property. * @@ -39,7 +39,7 @@ public trait KMemberExtensionProperty : KProperty { /** * Represents a `var` extension property declared in a class. */ -public trait KMutableMemberExtensionProperty : KMemberExtensionProperty, KMutableProperty { +public interface KMutableMemberExtensionProperty : KMemberExtensionProperty, KMutableProperty { /** * Modifies the value of the property. * diff --git a/core/builtins/src/kotlin/reflect/KMemberFunctions.kt b/core/builtins/src/kotlin/reflect/KMemberFunctions.kt index f1676ca4be5..57f7e141423 100644 --- a/core/builtins/src/kotlin/reflect/KMemberFunctions.kt +++ b/core/builtins/src/kotlin/reflect/KMemberFunctions.kt @@ -19,48 +19,48 @@ package kotlin.reflect /** A member function with introspection capabilities that takes 0 arguments. */ -public trait KMemberFunction0 : ExtensionFunction0 +public interface KMemberFunction0 : ExtensionFunction0 /** A member function with introspection capabilities that takes 1 argument. */ -public trait KMemberFunction1 : ExtensionFunction1 +public interface KMemberFunction1 : ExtensionFunction1 /** A member function with introspection capabilities that takes 2 arguments. */ -public trait KMemberFunction2 : ExtensionFunction2 +public interface KMemberFunction2 : ExtensionFunction2 /** A member function with introspection capabilities that takes 3 arguments. */ -public trait KMemberFunction3 : ExtensionFunction3 +public interface KMemberFunction3 : ExtensionFunction3 /** A member function with introspection capabilities that takes 4 arguments. */ -public trait KMemberFunction4 : ExtensionFunction4 +public interface KMemberFunction4 : ExtensionFunction4 /** A member function with introspection capabilities that takes 5 arguments. */ -public trait KMemberFunction5 : ExtensionFunction5 +public interface KMemberFunction5 : ExtensionFunction5 /** A member function with introspection capabilities that takes 6 arguments. */ -public trait KMemberFunction6 : ExtensionFunction6 +public interface KMemberFunction6 : ExtensionFunction6 /** A member function with introspection capabilities that takes 7 arguments. */ -public trait KMemberFunction7 : ExtensionFunction7 +public interface KMemberFunction7 : ExtensionFunction7 /** A member function with introspection capabilities that takes 8 arguments. */ -public trait KMemberFunction8 : ExtensionFunction8 +public interface KMemberFunction8 : ExtensionFunction8 /** A member function with introspection capabilities that takes 9 arguments. */ -public trait KMemberFunction9 : ExtensionFunction9 +public interface KMemberFunction9 : ExtensionFunction9 /** A member function with introspection capabilities that takes 10 arguments. */ -public trait KMemberFunction10 : ExtensionFunction10 +public interface KMemberFunction10 : ExtensionFunction10 /** A member function with introspection capabilities that takes 11 arguments. */ -public trait KMemberFunction11 : ExtensionFunction11 +public interface KMemberFunction11 : ExtensionFunction11 /** A member function with introspection capabilities that takes 12 arguments. */ -public trait KMemberFunction12 : ExtensionFunction12 +public interface KMemberFunction12 : ExtensionFunction12 /** A member function with introspection capabilities that takes 13 arguments. */ -public trait KMemberFunction13 : ExtensionFunction13 +public interface KMemberFunction13 : ExtensionFunction13 /** A member function with introspection capabilities that takes 14 arguments. */ -public trait KMemberFunction14 : ExtensionFunction14 +public interface KMemberFunction14 : ExtensionFunction14 /** A member function with introspection capabilities that takes 15 arguments. */ -public trait KMemberFunction15 : ExtensionFunction15 +public interface KMemberFunction15 : ExtensionFunction15 /** A member function with introspection capabilities that takes 16 arguments. */ -public trait KMemberFunction16 : ExtensionFunction16 +public interface KMemberFunction16 : ExtensionFunction16 /** A member function with introspection capabilities that takes 17 arguments. */ -public trait KMemberFunction17 : ExtensionFunction17 +public interface KMemberFunction17 : ExtensionFunction17 /** A member function with introspection capabilities that takes 18 arguments. */ -public trait KMemberFunction18 : ExtensionFunction18 +public interface KMemberFunction18 : ExtensionFunction18 /** A member function with introspection capabilities that takes 19 arguments. */ -public trait KMemberFunction19 : ExtensionFunction19 +public interface KMemberFunction19 : ExtensionFunction19 /** A member function with introspection capabilities that takes 20 arguments. */ -public trait KMemberFunction20 : ExtensionFunction20 +public interface KMemberFunction20 : ExtensionFunction20 /** A member function with introspection capabilities that takes 21 arguments. */ -public trait KMemberFunction21 : ExtensionFunction21 +public interface KMemberFunction21 : ExtensionFunction21 /** A member function with introspection capabilities that takes 22 arguments. */ -public trait KMemberFunction22 : ExtensionFunction22 +public interface KMemberFunction22 : ExtensionFunction22 diff --git a/core/builtins/src/kotlin/reflect/KMemberProperty.kt b/core/builtins/src/kotlin/reflect/KMemberProperty.kt index c0a517ea10b..58c4d9f2ab1 100644 --- a/core/builtins/src/kotlin/reflect/KMemberProperty.kt +++ b/core/builtins/src/kotlin/reflect/KMemberProperty.kt @@ -23,7 +23,7 @@ package kotlin.reflect * Must be derived either from a class declaring this property, or any subclass of that class. * @param R the type of the property. */ -public trait KMemberProperty : KProperty { +public interface KMemberProperty : KProperty { /** * Returns the current value of the property. * @@ -35,7 +35,7 @@ public trait KMemberProperty : KProperty { /** * Represents a `var` property declared in a class. */ -public trait KMutableMemberProperty : KMemberProperty, KMutableProperty { +public interface KMutableMemberProperty : KMemberProperty, KMutableProperty { /** * Modifies the value of the property. * diff --git a/core/builtins/src/kotlin/reflect/KPackage.kt b/core/builtins/src/kotlin/reflect/KPackage.kt index b0161bded0d..1f26a51565b 100644 --- a/core/builtins/src/kotlin/reflect/KPackage.kt +++ b/core/builtins/src/kotlin/reflect/KPackage.kt @@ -19,4 +19,4 @@ package kotlin.reflect /** * Represents a package and provides introspection capabilities. */ -public trait KPackage +public interface KPackage diff --git a/core/builtins/src/kotlin/reflect/KProperty.kt b/core/builtins/src/kotlin/reflect/KProperty.kt index 311409a0a10..10f4a3508a2 100644 --- a/core/builtins/src/kotlin/reflect/KProperty.kt +++ b/core/builtins/src/kotlin/reflect/KProperty.kt @@ -24,9 +24,9 @@ package kotlin.reflect * * @param R the type of the property. */ -public trait KProperty : KCallable +public interface KProperty : KCallable /** * Represents a property declared as a `var`. */ -public trait KMutableProperty : KProperty +public interface KMutableProperty : KProperty diff --git a/core/builtins/src/kotlin/reflect/KTopLevelExtensionProperty.kt b/core/builtins/src/kotlin/reflect/KTopLevelExtensionProperty.kt index 229c915942b..3381b037182 100644 --- a/core/builtins/src/kotlin/reflect/KTopLevelExtensionProperty.kt +++ b/core/builtins/src/kotlin/reflect/KTopLevelExtensionProperty.kt @@ -19,9 +19,9 @@ package kotlin.reflect /** * Represents an extension property declared in a package. */ -public trait KTopLevelExtensionProperty : KExtensionProperty, KTopLevelProperty +public interface KTopLevelExtensionProperty : KExtensionProperty, KTopLevelProperty /** * Represents a package extension property declared as a `var`. */ -public trait KMutableTopLevelExtensionProperty : KTopLevelExtensionProperty, KMutableExtensionProperty, KMutableTopLevelProperty +public interface KMutableTopLevelExtensionProperty : KTopLevelExtensionProperty, KMutableExtensionProperty, KMutableTopLevelProperty diff --git a/core/builtins/src/kotlin/reflect/KTopLevelProperty.kt b/core/builtins/src/kotlin/reflect/KTopLevelProperty.kt index 49f4ad5281e..597e831325f 100644 --- a/core/builtins/src/kotlin/reflect/KTopLevelProperty.kt +++ b/core/builtins/src/kotlin/reflect/KTopLevelProperty.kt @@ -19,9 +19,9 @@ package kotlin.reflect /** * Represents a property declared in a package. */ -public trait KTopLevelProperty : KProperty +public interface KTopLevelProperty : KProperty /** * Represents a package property declared as a `var`. */ -public trait KMutableTopLevelProperty : KTopLevelProperty, KMutableProperty +public interface KMutableTopLevelProperty : KTopLevelProperty, KMutableProperty diff --git a/core/builtins/src/kotlin/reflect/KTopLevelVariable.kt b/core/builtins/src/kotlin/reflect/KTopLevelVariable.kt index 9df6e519008..39b8856ac66 100644 --- a/core/builtins/src/kotlin/reflect/KTopLevelVariable.kt +++ b/core/builtins/src/kotlin/reflect/KTopLevelVariable.kt @@ -19,9 +19,9 @@ package kotlin.reflect /** * Represents a variable declared in a package. */ -public trait KTopLevelVariable : KVariable, KTopLevelProperty +public interface KTopLevelVariable : KVariable, KTopLevelProperty /** * Represents a package variable declared as a `var`. */ -public trait KMutableTopLevelVariable : KTopLevelVariable, KMutableVariable, KMutableTopLevelProperty +public interface KMutableTopLevelVariable : KTopLevelVariable, KMutableVariable, KMutableTopLevelProperty diff --git a/core/builtins/src/kotlin/reflect/KVariable.kt b/core/builtins/src/kotlin/reflect/KVariable.kt index ff1fec7a4b2..100e149a5c0 100644 --- a/core/builtins/src/kotlin/reflect/KVariable.kt +++ b/core/builtins/src/kotlin/reflect/KVariable.kt @@ -21,7 +21,7 @@ package kotlin.reflect * Such property is either originally declared in a receiverless context such as a package, * or has the receiver bound to it. */ -public trait KVariable : KProperty { +public interface KVariable : KProperty { /** * Returns the current value of the variable. */ @@ -31,7 +31,7 @@ public trait KVariable : KProperty { /** * Represents a variable declared as a `var`. */ -public trait KMutableVariable : KVariable, KMutableProperty { +public interface KMutableVariable : KVariable, KMutableProperty { /** * Modifies the value of the variable. * diff --git a/generators/src/org/jetbrains/kotlin/generators/builtins/functions.kt b/generators/src/org/jetbrains/kotlin/generators/builtins/functions.kt index 0378588c559..04557ad057a 100644 --- a/generators/src/org/jetbrains/kotlin/generators/builtins/functions.kt +++ b/generators/src/org/jetbrains/kotlin/generators/builtins/functions.kt @@ -65,7 +65,7 @@ class GenerateFunctions(out: PrintWriter, val kind: FunctionKind) : BuiltInsSour override fun generateBody() { for (i in 0..MAX_PARAM_COUNT) { generateDocumentation(i) - out.print("public trait " + kind.getClassName(i)) + out.print("public interface " + kind.getClassName(i)) generateTypeParameters(i, true) generateSuperClass(i) generateFunctionClassBody(i) diff --git a/libraries/stdlib/src/kotlin/collections/Sequence.kt b/libraries/stdlib/src/kotlin/collections/Sequence.kt index 581564795c2..40a28a7cfcf 100644 --- a/libraries/stdlib/src/kotlin/collections/Sequence.kt +++ b/libraries/stdlib/src/kotlin/collections/Sequence.kt @@ -4,7 +4,7 @@ import java.util.Enumeration import java.util.NoSuchElementException deprecated("Use Sequence instead.") -public trait Stream { +public interface Stream { /** * Returns an iterator that returns the values from the sequence. */ @@ -17,7 +17,7 @@ public trait Stream { * * @param T the type of elements in the sequence. */ -public trait Sequence : Stream +public interface Sequence : Stream public fun Stream.toSequence(): Sequence = object : Sequence { override fun iterator(): Iterator = this@toSequence.iterator() diff --git a/libraries/stdlib/src/kotlin/io/Console.kt b/libraries/stdlib/src/kotlin/io/Console.kt index 099daab0b6f..261d8ca271a 100644 --- a/libraries/stdlib/src/kotlin/io/Console.kt +++ b/libraries/stdlib/src/kotlin/io/Console.kt @@ -126,7 +126,7 @@ public fun println() { // Since System.in can change its value on the course of program running, // we should always delegate to current value and cannot just pass it to InputStreamReader constructor. -// We could use "by" implementation, but we can only use "by" with traits and InputStream is abstract class. +// We could use "by" implementation, but we can only use "by" with interfaces and InputStream is abstract class. private val stdin: BufferedReader = BufferedReader(InputStreamReader(object : InputStream() { public override fun read(): Int { return System.`in`.read() diff --git a/libraries/stdlib/src/kotlin/properties/Delegation.kt b/libraries/stdlib/src/kotlin/properties/Delegation.kt index 6f22c7ef4f9..5a0191cc585 100644 --- a/libraries/stdlib/src/kotlin/properties/Delegation.kt +++ b/libraries/stdlib/src/kotlin/properties/Delegation.kt @@ -1,13 +1,13 @@ package kotlin.properties /** - * Base trait that can be used for implementing property delegates of read-only properties. This is provided only for - * convenience; you don't have to extend this trait as long as your property delegate has methods with the same + * Base interface that can be used for implementing property delegates of read-only properties. This is provided only for + * convenience; you don't have to extend this interface as long as your property delegate has methods with the same * signatures. * @param R the type of object which owns the delegated property. * @param T the type of the property value. */ -public trait ReadOnlyProperty { +public interface ReadOnlyProperty { /** * Returns the value of the property for the given object. * @param thisRef the object for which the value is requested. @@ -18,13 +18,13 @@ public trait ReadOnlyProperty { } /** - * Base trait that can be used for implementing property delegates of read-only properties. This is provided only for - * convenience; you don't have to extend this trait as long as your property delegate has methods with the same + * Base interface that can be used for implementing property delegates of read-only properties. This is provided only for + * convenience; you don't have to extend this interface as long as your property delegate has methods with the same * signatures. * @param R the type of object which owns the delegated property. * @param T the type of the property value. */ -public trait ReadWriteProperty { +public interface ReadWriteProperty { /** * Returns the value of the property for the given object. * @param thisRef the object for which the value is requested. diff --git a/libraries/stdlib/src/kotlin/properties/Properties.kt b/libraries/stdlib/src/kotlin/properties/Properties.kt index 8a22e37bb9c..d93c08243ed 100644 --- a/libraries/stdlib/src/kotlin/properties/Properties.kt +++ b/libraries/stdlib/src/kotlin/properties/Properties.kt @@ -14,7 +14,7 @@ public class ChangeEvent( } deprecated("This class is part of an old, incomplete and suboptimal design of change notifications and is going to be removed") -public trait ChangeListener { +public interface ChangeListener { public fun onPropertyChange(event: ChangeEvent): Unit } diff --git a/libraries/stdlib/src/kotlin/template/Templates.kt b/libraries/stdlib/src/kotlin/template/Templates.kt index b8820b645f7..7505d956b19 100644 --- a/libraries/stdlib/src/kotlin/template/Templates.kt +++ b/libraries/stdlib/src/kotlin/template/Templates.kt @@ -86,8 +86,8 @@ public fun StringTemplate.toHtml(formatter: HtmlFormatter = HtmlFormatter()): St * how to format values for a particular [[Locale]] such as with the [[LocaleFormatter]] or * to escape particular characters in different output formats such as [[HtmlFormatter] */ -deprecated("This trait is part of an experimental implementation of string templates and is going to be removed") -public trait Formatter { +deprecated("This interface is part of an experimental implementation of string templates and is going to be removed") +public interface Formatter { public fun format(buffer: Appendable, value: Any?): Unit } diff --git a/libraries/stdlib/src/kotlin/test/Test.kt b/libraries/stdlib/src/kotlin/test/Test.kt index 2807497b414..d0f4e757ea6 100644 --- a/libraries/stdlib/src/kotlin/test/Test.kt +++ b/libraries/stdlib/src/kotlin/test/Test.kt @@ -92,7 +92,7 @@ public fun fails(block: () -> Unit): Throwable? { * Abstracts the logic for performing assertions. Specific implementations of [Asserter] can use JUnit * or TestNG assertion facilities. */ -public trait Asserter { +public interface Asserter { /** * Asserts that the specified value is true. * diff --git a/libraries/stdlib/src/kotlin/text/regex/Regex.kt b/libraries/stdlib/src/kotlin/text/regex/Regex.kt index 8c534788024..34329761b9f 100644 --- a/libraries/stdlib/src/kotlin/text/regex/Regex.kt +++ b/libraries/stdlib/src/kotlin/text/regex/Regex.kt @@ -17,7 +17,7 @@ package kotlin.text /** Represents a collection of captured groups in a single match. */ -public trait MatchGroupCollection : Collection { +public interface MatchGroupCollection : Collection { /** Returns a group with the specified [index] * @@ -34,7 +34,7 @@ public trait MatchGroupCollection : Collection { /** * Represents the results from a single regular expression match. */ -public trait MatchResult { +public interface MatchResult { /** The range of indices in the original string where match was captured. */ public val range: IntRange /** The substring from the input string captured by this match. */ diff --git a/libraries/stdlib/src/kotlin/text/regex/RegexJVM.kt b/libraries/stdlib/src/kotlin/text/regex/RegexJVM.kt index f0edff887ee..70d28c97c4f 100644 --- a/libraries/stdlib/src/kotlin/text/regex/RegexJVM.kt +++ b/libraries/stdlib/src/kotlin/text/regex/RegexJVM.kt @@ -19,7 +19,7 @@ package kotlin.text import java.util.regex.Pattern import java.util.regex.Matcher -private trait FlagEnum { +private interface FlagEnum { public val value: Int public val mask: Int } diff --git a/libraries/stdlib/test/properties/delegation/DelegationTest.kt b/libraries/stdlib/test/properties/delegation/DelegationTest.kt index 157f668e3df..4f78f3647c6 100644 --- a/libraries/stdlib/test/properties/delegation/DelegationTest.kt +++ b/libraries/stdlib/test/properties/delegation/DelegationTest.kt @@ -4,7 +4,7 @@ import org.junit.Test as test import kotlin.test.* import kotlin.properties.* -trait WithBox { +interface WithBox { fun box(): String } diff --git a/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinGradleSubplugin.kt b/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinGradleSubplugin.kt index 971b4a75215..fda340afdef 100644 --- a/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinGradleSubplugin.kt +++ b/libraries/tools/kotlin-gradle-plugin-api/src/main/kotlin/org/jetbrains/kotlin/gradle/plugin/KotlinGradleSubplugin.kt @@ -21,7 +21,7 @@ import org.gradle.api.tasks.compile.AbstractCompile public class SubpluginOption(val key: String, val value: String) -public trait KotlinGradleSubplugin { +public interface KotlinGradleSubplugin { public fun getExtraArguments(project: Project, task: AbstractCompile): List? public fun getPluginName(): String public fun getGroupName(): String diff --git a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/KotlinSourceSet.kt b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/KotlinSourceSet.kt index eb385c68c68..79c74d31a5b 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/KotlinSourceSet.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/main/kotlin/org/jetbrains/kotlin/gradle/internal/KotlinSourceSet.kt @@ -6,7 +6,7 @@ import org.gradle.api.internal.file.FileResolver import org.gradle.api.internal.file.DefaultSourceDirectorySet import org.gradle.util.ConfigureUtil -trait KotlinSourceSet { +interface KotlinSourceSet { fun getKotlin(): SourceDirectorySet fun kotlin(configureClosure: Closure?): KotlinSourceSet diff --git a/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/suppressWarningsAndVersion/src/helloWorld.kt b/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/suppressWarningsAndVersion/src/helloWorld.kt index b97b1e74260..46efcd61cca 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/suppressWarningsAndVersion/src/helloWorld.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/test/resources/testProject/suppressWarningsAndVersion/src/helloWorld.kt @@ -7,7 +7,7 @@ fun foo(p: Int??) { } -trait T { +interface T { abstract fun foo() } diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-suppressWarnings/src/main/kotlin/org/jetbrains/HelloWorld.kt b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-suppressWarnings/src/main/kotlin/org/jetbrains/HelloWorld.kt index a2dabbd8903..5f51a3cc290 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-suppressWarnings/src/main/kotlin/org/jetbrains/HelloWorld.kt +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-js-suppressWarnings/src/main/kotlin/org/jetbrains/HelloWorld.kt @@ -7,7 +7,7 @@ fun foo(p: Int??) { } -trait T { +interface T { abstract fun foo() } diff --git a/libraries/tools/kotlin-maven-plugin-test/src/it/test-suppressWarnings/src/main/kotlin/org/jetbrains/HelloWorld.kt b/libraries/tools/kotlin-maven-plugin-test/src/it/test-suppressWarnings/src/main/kotlin/org/jetbrains/HelloWorld.kt index 1db88783020..50eaad2ed93 100644 --- a/libraries/tools/kotlin-maven-plugin-test/src/it/test-suppressWarnings/src/main/kotlin/org/jetbrains/HelloWorld.kt +++ b/libraries/tools/kotlin-maven-plugin-test/src/it/test-suppressWarnings/src/main/kotlin/org/jetbrains/HelloWorld.kt @@ -7,7 +7,7 @@ fun foo(p: Int??) { } -trait T { +interface T { abstract fun foo() } diff --git a/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt b/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt index 2819c3d9b9d..3791a285b5c 100644 --- a/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt +++ b/libraries/tools/kotlin-stdlib-gen/src/generators/GenerateJavaScriptStubs.kt @@ -87,7 +87,7 @@ $imports val interfaces = klass.getInterfaces() val extends = if (interfaces != null && interfaces.size == 1) ": ${interfaces[0]?.getSimpleName()}" else "" - println("native public trait ${klass.getSimpleName()}$extends {") + println("native public interface ${klass.getSimpleName()}$extends {") val methods = klass.getDeclaredMethods().sortBy { it.getName()!! } if (methods != null) {