remove support for 'trait' keyword

This commit is contained in:
Dmitry Jemerov
2015-09-18 16:17:02 +02:00
parent 86833c1a74
commit 4ca434da54
217 changed files with 705 additions and 821 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
package kotlin.js
// https://developer.mozilla.org/en/DOM/console
@native public trait Console {
@native public interface Console {
@native public fun dir(o: Any): Unit = noImpl
@native public fun error(vararg o: Any?): Unit = noImpl
@native public fun info(vararg o: Any?): Unit = noImpl
+1 -1
View File
@@ -1,6 +1,6 @@
package org.w3c.dom.views
@Deprecated("Use declarations from org.w3c.dom instead")
@native public trait AbstractView {
@native public interface AbstractView {
}
+70 -70
View File
@@ -11,15 +11,15 @@ public val window: Window = noImpl
public var document: HTMLDocument = noImpl
@Deprecated("Do not use it")
public @native trait Object {
public @native interface Object {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait Image : HTMLImageElement {
public @native interface Image : HTMLImageElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait Navigator {
public @native interface Navigator {
public @native var userAgent: String
public @native var product: String
public @native var appVersion: String
@@ -35,7 +35,7 @@ public @native trait Navigator {
public @native fun preference(prefName: String): String
}
public @native trait Screen {
public @native interface Screen {
public @native var width: Double
public @native var height: Double
public @native var availHeight: Double
@@ -45,7 +45,7 @@ public @native trait Screen {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait Option {
public @native interface Option {
public @native var defaultSelected: Boolean
public @native var selected: Boolean
public @native var text: String
@@ -53,7 +53,7 @@ public @native trait Option {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait Location {
public @native interface Location {
public @native var href: String
public @native var hash: String
public @native var port: String
@@ -68,7 +68,7 @@ public @native trait Location {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait Event {
public @native interface Event {
public @native var data: Array<Any>
public @native var height: Double
public @native var screenX: Double
@@ -89,31 +89,31 @@ public @native trait Event {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait Selection {
public @native interface Selection {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait CSSRule {
public @native interface CSSRule {
public @native var selectorText: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait Stylesheet {
public @native interface Stylesheet {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait History {
public @native interface History {
public @native fun back(): Unit
public @native fun forward(): Unit
public @native fun go(count: Number): Unit
}
public @native trait Console {
public @native interface Console {
public @native fun log(message: Any): Unit
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait Window {
public @native interface Window {
public @native val document: HTMLDocument
public @native val event: Event
public @native val navigator: Navigator
@@ -164,7 +164,7 @@ public @native trait Window {
public @native var onunload: () -> Unit
}
public @native trait Global {
public @native interface Global {
public @native val window: Window
public @native fun escape(str: String): Unit
public @native fun escape(): Unit
@@ -173,14 +173,14 @@ public @native trait Global {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLCollection {
public @native interface HTMLCollection {
public @native val length: Double
public @native fun item(index: Number): Node?
public @native fun namedItem(name: String): Node?
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLOptionsCollection {
public @native interface HTMLOptionsCollection {
public @native val length: Double
public @native fun item(index: Number): Node?
public @native fun namedItem(name: String): Node?
@@ -195,7 +195,7 @@ public @native class HTMLDocument : Document() {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLElement : Element {
public @native interface HTMLElement : Element {
public @native var title: String
public @native var lang: String
public @native var dir: String
@@ -221,7 +221,7 @@ public @native trait HTMLElement : Element {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait CSSStyleDeclaration {
public @native interface CSSStyleDeclaration {
public @native var cssText: String
public @native var length: Double
public @native var parentRule: CSSRule
@@ -233,17 +233,17 @@ public @native trait CSSStyleDeclaration {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLHtmlElement : HTMLElement {
public @native interface HTMLHtmlElement : HTMLElement {
public @native var version: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLHeadElement : HTMLElement {
public @native interface HTMLHeadElement : HTMLElement {
public @native var profile: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLLinkElement : HTMLElement {
public @native interface HTMLLinkElement : HTMLElement {
public @native var disabled: Boolean
public @native var charset: String
public @native var href: String
@@ -256,12 +256,12 @@ public @native trait HTMLLinkElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLTitleElement : HTMLElement {
public @native interface HTMLTitleElement : HTMLElement {
public @native var text: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLMetaElement : HTMLElement {
public @native interface HTMLMetaElement : HTMLElement {
public @native var content: String
public @native var httpEquiv: String
public @native var name: String
@@ -269,26 +269,26 @@ public @native trait HTMLMetaElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLBaseElement : HTMLElement {
public @native interface HTMLBaseElement : HTMLElement {
public @native var href: String
public @native var target: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLIsIndexElement : HTMLElement {
public @native interface HTMLIsIndexElement : HTMLElement {
public @native val form: HTMLFormElement
public @native var prompt: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLStyleElement : HTMLElement {
public @native interface HTMLStyleElement : HTMLElement {
public @native var disabled: Boolean
public @native var media: String
public @native var type: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLBodyElement : HTMLElement {
public @native interface HTMLBodyElement : HTMLElement {
public @native var aLink: String
public @native var background: String
public @native var bgColor: String
@@ -300,7 +300,7 @@ public @native trait HTMLBodyElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLFormElement {
public @native interface HTMLFormElement {
public @native val elements: HTMLCollection
public @native val length: Double
public @native var name: String
@@ -314,7 +314,7 @@ public @native trait HTMLFormElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLSelectElement : HTMLElement {
public @native interface HTMLSelectElement : HTMLElement {
public @native val type: String
public @native var selectedIndex: Double
public @native var value: String
@@ -333,13 +333,13 @@ public @native trait HTMLSelectElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLOptGroupElement : HTMLElement {
public @native interface HTMLOptGroupElement : HTMLElement {
public @native var disabled: Boolean
public @native var label: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLOptionElement : HTMLElement {
public @native interface HTMLOptionElement : HTMLElement {
public @native val form: HTMLFormElement
public @native var defaultSelected: Boolean
public @native var text: String
@@ -351,7 +351,7 @@ public @native trait HTMLOptionElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLInputElement : HTMLElement {
public @native interface HTMLInputElement : HTMLElement {
public @native var defaultValue: String
public @native var defaultChecked: Boolean
public @native val form: HTMLFormElement
@@ -379,7 +379,7 @@ public @native trait HTMLInputElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLTextAreaElement : HTMLElement {
public @native interface HTMLTextAreaElement : HTMLElement {
public @native var defaultValue: String
public @native val form: HTMLFormElement
public @native var accessKey: String
@@ -397,7 +397,7 @@ public @native trait HTMLTextAreaElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLButtonElement : HTMLElement {
public @native interface HTMLButtonElement : HTMLElement {
public @native val form: HTMLFormElement
public @native var accessKey: String
public @native var disabled: Boolean
@@ -408,104 +408,104 @@ public @native trait HTMLButtonElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLLabelElement : HTMLElement {
public @native interface HTMLLabelElement : HTMLElement {
public @native val form: HTMLFormElement
public @native var accessKey: String
public @native var htmlFor: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLFieldSetElement : HTMLElement {
public @native interface HTMLFieldSetElement : HTMLElement {
public @native val form: HTMLFormElement
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLLegendElement : HTMLElement {
public @native interface HTMLLegendElement : HTMLElement {
public @native val form: HTMLFormElement
public @native var accessKey: String
public @native var align: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLUListElement : HTMLElement {
public @native interface HTMLUListElement : HTMLElement {
public @native var compact: Boolean
public @native var type: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLOListElement : HTMLElement {
public @native interface HTMLOListElement : HTMLElement {
public @native var compact: Boolean
public @native var start: Double
public @native var type: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLDListElement : HTMLElement {
public @native interface HTMLDListElement : HTMLElement {
public @native var compact: Boolean
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLDirectoryElement : HTMLElement {
public @native interface HTMLDirectoryElement : HTMLElement {
public @native var compact: Boolean
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLMenuElement : HTMLElement {
public @native interface HTMLMenuElement : HTMLElement {
public @native var compact: Boolean
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLLIElement : HTMLElement {
public @native interface HTMLLIElement : HTMLElement {
public @native var type: String
public @native var value: Double
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLDivElement : HTMLElement {
public @native interface HTMLDivElement : HTMLElement {
public @native var align: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLParagraphElement : HTMLElement {
public @native interface HTMLParagraphElement : HTMLElement {
public @native var align: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLHeadingElement : HTMLElement {
public @native interface HTMLHeadingElement : HTMLElement {
public @native var align: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLQuoteElement : HTMLElement {
public @native interface HTMLQuoteElement : HTMLElement {
public @native var cite: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLPreElement : HTMLElement {
public @native interface HTMLPreElement : HTMLElement {
public @native var width: Double
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLBRElement : HTMLElement {
public @native interface HTMLBRElement : HTMLElement {
public @native var clear: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLBaseFontElement : HTMLElement {
public @native interface HTMLBaseFontElement : HTMLElement {
public @native var color: String
public @native var face: String
public @native var size: Double
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLFontElement : HTMLElement {
public @native interface HTMLFontElement : HTMLElement {
public @native var color: String
public @native var face: String
public @native var size: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLHRElement : HTMLElement {
public @native interface HTMLHRElement : HTMLElement {
public @native var align: String
public @native var noShade: Boolean
public @native var size: String
@@ -513,13 +513,13 @@ public @native trait HTMLHRElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLModElement : HTMLElement {
public @native interface HTMLModElement : HTMLElement {
public @native var cite: String
public @native var dateTime: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLAnchorElement : HTMLElement {
public @native interface HTMLAnchorElement : HTMLElement {
public @native var accessKey: String
public @native var charset: String
public @native var coords: String
@@ -537,7 +537,7 @@ public @native trait HTMLAnchorElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLImageElement : HTMLElement {
public @native interface HTMLImageElement : HTMLElement {
public @native var name: String
public @native var align: String
public @native var alt: String
@@ -555,7 +555,7 @@ public @native trait HTMLImageElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLObjectElement : HTMLElement {
public @native interface HTMLObjectElement : HTMLElement {
public @native val form: HTMLFormElement
public @native var code: String
public @native var align: String
@@ -578,7 +578,7 @@ public @native trait HTMLObjectElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLParamElement : HTMLElement {
public @native interface HTMLParamElement : HTMLElement {
public @native var name: String
public @native var type: String
public @native var value: String
@@ -586,7 +586,7 @@ public @native trait HTMLParamElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLAppletElement : HTMLElement {
public @native interface HTMLAppletElement : HTMLElement {
public @native var align: String
public @native var alt: String
public @native var archive: String
@@ -601,13 +601,13 @@ public @native trait HTMLAppletElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLMapElement : HTMLElement {
public @native interface HTMLMapElement : HTMLElement {
public @native val areas: HTMLCollection
public @native var name: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLAreaElement : HTMLElement {
public @native interface HTMLAreaElement : HTMLElement {
public @native var accessKey: String
public @native var alt: String
public @native var coords: String
@@ -619,7 +619,7 @@ public @native trait HTMLAreaElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLScriptElement : HTMLElement {
public @native interface HTMLScriptElement : HTMLElement {
public @native var text: String
public @native var htmlFor: String
public @native var event: String
@@ -630,7 +630,7 @@ public @native trait HTMLScriptElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLTableElement : HTMLElement {
public @native interface HTMLTableElement : HTMLElement {
public @native var caption: HTMLTableCaptionElement
public @native var tHead: HTMLTableSectionElement
public @native var tFoot: HTMLTableSectionElement
@@ -656,12 +656,12 @@ public @native trait HTMLTableElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLTableCaptionElement : HTMLElement {
public @native interface HTMLTableCaptionElement : HTMLElement {
public @native var align: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLTableColElement : HTMLElement {
public @native interface HTMLTableColElement : HTMLElement {
public @native var align: String
public @native var ch: String
public @native var chOff: String
@@ -671,7 +671,7 @@ public @native trait HTMLTableColElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLTableSectionElement : HTMLElement {
public @native interface HTMLTableSectionElement : HTMLElement {
public @native var align: String
public @native var ch: String
public @native var chOff: String
@@ -682,7 +682,7 @@ public @native trait HTMLTableSectionElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLTableRowElement : HTMLElement {
public @native interface HTMLTableRowElement : HTMLElement {
public @native val rowIndex: Double
public @native val sectionRowIndex: Double
public @native val cells: HTMLCollection
@@ -696,7 +696,7 @@ public @native trait HTMLTableRowElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLTableCellElement : HTMLElement {
public @native interface HTMLTableCellElement : HTMLElement {
public @native val cellIndex: Double
public @native var abbr: String
public @native var align: String
@@ -715,13 +715,13 @@ public @native trait HTMLTableCellElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLFrameSetElement : HTMLElement {
public @native interface HTMLFrameSetElement : HTMLElement {
public @native var cols: String
public @native var rows: String
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLFrameElement : HTMLElement {
public @native interface HTMLFrameElement : HTMLElement {
public @native var frameBorder: String
public @native var longDesc: String
public @native var marginHeight: String
@@ -733,7 +733,7 @@ public @native trait HTMLFrameElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLIFrameElement : HTMLElement {
public @native interface HTMLIFrameElement : HTMLElement {
public @native var align: String
public @native var frameBorder: String
public @native var height: String
+2 -2
View File
@@ -4,8 +4,8 @@ package java.io
public class IOException(message: String = "") : Exception() {}
@library
public trait Closeable {
public interface Closeable {
public open fun close() : Unit;
}
trait Serializable
interface Serializable
+2 -2
View File
@@ -28,7 +28,7 @@ public class NumberFormatException(message: String? = null) : RuntimeException(m
public class NullPointerException(message: String? = null) : RuntimeException(message) {}
@library
public trait Runnable {
public interface Runnable {
public open fun run() : Unit;
}
@@ -37,7 +37,7 @@ public fun Runnable(action: () -> Unit): Runnable = object : Runnable {
}
@library
public trait Appendable {
public interface Appendable {
public open fun append(csq: CharSequence?): Appendable
public open fun append(csq: CharSequence?, start: Int, end: Int): Appendable
public open fun append(c: Char): Appendable
+3 -3
View File
@@ -7,7 +7,7 @@ private val DEFAULT_INITIAL_CAPACITY = 16
private val DEFAULT_LOAD_FACTOR = 0.75f
@library
public trait Comparator<T> {
public interface Comparator<T> {
public fun compare(obj1: T, obj2: T): Int;
}
@@ -85,7 +85,7 @@ public open class HashSet<E>(
}
@library
public trait SortedSet<E> : Set<E> {
public interface SortedSet<E> : Set<E> {
}
@library
@@ -128,7 +128,7 @@ public open class LinkedHashMap<K, V>(
public open class NoSuchElementException(message: String? = null) : Exception() {}
@library
public trait Enumeration<E> {
public interface Enumeration<E> {
public fun hasMoreElements(): Boolean
public fun nextElement(): E
}
+1 -1
View File
@@ -17,7 +17,7 @@ public fun json(vararg pairs: Pair<String, Any?>): Json {
public fun Json.add(other: Json): Json = noImpl
@native
public trait JsonClass {
public interface JsonClass {
public fun stringify(o: Any): String
public fun stringify(o: Any, replacer: (key: String, value: Any?)->Any?): String
public fun stringify(o: Any, replacer: (key: String, value: Any?)->Any?, space: Int): String
+1 -1
View File
@@ -40,7 +40,7 @@ public fun RegExp.reset() {
}
@native public trait RegExpMatch {
@native public interface RegExpMatch {
public val index: Int
public val input: String
}
+6 -6
View File
@@ -4,7 +4,7 @@ import kotlin.js.dom.html.HTMLElement
import org.w3c.dom.Element
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait HTMLCanvasElement : HTMLElement {
public @native interface HTMLCanvasElement : HTMLElement {
public var width: Double
public var height: Double
public fun getContext(contextId: String, vararg attributes: Any): CanvasContext?
@@ -14,7 +14,7 @@ public @native trait HTMLCanvasElement : HTMLElement {
}
@Deprecated("Use declarations from org.w3c.dom instead. See CanvasRenderingContext2D")
public @native trait CanvasContext {
public @native interface CanvasContext {
public var canvas: HTMLCanvasElement
public fun save(): Unit
public fun restore(): Unit
@@ -79,23 +79,23 @@ public @native trait CanvasContext {
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait CanvasGradient {
public @native interface CanvasGradient {
public fun addColorStop(offset: Number, color: String): Unit
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait ImageData {
public @native interface ImageData {
public var data: CanvasPixelArray
public var width: Double
public var height: Double
}
public @native trait CanvasPixelArray {
public @native interface CanvasPixelArray {
public var length: Double
}
@Deprecated("Use declarations from org.w3c.dom instead")
public @native trait TextMetrics {
public @native interface TextMetrics {
public var width: Double
}
+1 -1
View File
@@ -41,6 +41,6 @@ public open class Blob(blobParts: Array<Any>? = undefined, options: BlobProperty
@native
@Deprecated("Use org.w3c.dom")
public trait BlobPropertyBag {
public interface BlobPropertyBag {
public val type: String
}
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
trait A {
interface A {
companion object {
val OK: String = "OK"
}
@@ -1,6 +1,6 @@
package foo
trait Named {
interface Named {
companion object Bar {
val g = "a";
}
@@ -1,6 +1,6 @@
package foo
trait A {
interface A {
fun bar2(arg: Int = 239): Int
fun bar(arg: Int = 240): Int = bar2(arg / 2)
@@ -1,6 +1,6 @@
package foo
trait WithName {
interface WithName {
var name: String
}
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
trait WithNumber {
interface WithNumber {
var number: Int
}
@@ -1,6 +1,6 @@
package foo
trait Getter<T> {
interface Getter<T> {
fun get(): T
}
+2 -2
View File
@@ -1,11 +1,11 @@
// This test was adapted from compiler/testData/codegen/box/classes
package foo
trait Trait1 {
interface Trait1 {
fun foo(): String
}
trait Trait2 {
interface Trait2 {
fun bar(): String
}
+2 -2
View File
@@ -1,11 +1,11 @@
// This test was adapted from compiler/testData/codegen/box/classes
package foo
trait One {
interface One {
public open fun foo(): Int
public open fun faz(): Int = 10
}
trait Two {
interface Two {
public open fun foo(): Int
public open fun quux(): Int = 100
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun foo(x: String): String
var prop: String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun foo(arg: String): String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun foo(x: String): String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun foo(x: String): String
}
@@ -1,14 +1,14 @@
package foo
trait Base {
interface Base {
abstract fun foo(s: String): String
var prop: String
}
trait Base1 : Base {
interface Base1 : Base {
}
trait Base2 : Base1 {
interface Base2 : Base1 {
override fun foo(s: String): String = "Base2:foo ${s}"
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun foo(x: String): String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun foo(x: String): String
var prop: String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun foo(x: String): String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun foo(x: String): String
}
@@ -8,7 +8,7 @@ class BaseImpl(val s: String) : Base {
override fun foo(x: String): String = "Base: ${s}:${x}"
}
trait Base2 {
interface Base2 {
abstract fun bar(x: String): String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun Int.foo(): String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
abstract fun String.foo(arg: String): String
}
@@ -1,6 +1,6 @@
package foo
trait Base {
interface Base {
var prop: String
var Int.foo: String
}
@@ -2,7 +2,7 @@ package foo
class State(var value: Int)
trait Base {
interface Base {
var State.multiplied: Int
}
@@ -1,7 +1,7 @@
// This test was adapted from compiler/testData/codegen/box/classes
package foo
trait A<T> {
interface A<T> {
fun foo(t: T): String
}
@@ -1,15 +1,15 @@
// This test was adapted from compiler/testData/codegen/box/classes
package foo
trait TextField {
interface TextField {
fun getText(): String
}
trait InputTextField : TextField {
interface InputTextField : TextField {
fun setText(text: String)
}
trait MooableTextField : InputTextField {
interface MooableTextField : InputTextField {
fun moo(a: Int, b: Int, c: Int): Int
}
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
trait T {
interface T {
fun foo(): String
}
@@ -11,6 +11,6 @@ enum class MyEnum : T {
}
}
trait T {
interface T {
fun f(): String
}
@@ -14,7 +14,7 @@ enum class B(open val bar: Int) {
var y = 12;
}
trait X {
interface X {
val foo: Int
fun bar(): Int {
return foo;
+1 -1
View File
@@ -2,7 +2,7 @@ open class Base() {
fun n(n: Int): Int = n + 1
}
trait Abstract {
interface Abstract {
}
class Derived1() : Base(), Abstract {
@@ -10,7 +10,7 @@ open class Base() {
}
}
trait Abstract {
interface Abstract {
}
class Derived1() : Base(), Abstract {
@@ -1,6 +1,6 @@
// Changed when traits were introduced. May not make sense any more
trait Left {
interface Left {
}
open class Right() {
open fun f() = 42
@@ -1,6 +1,6 @@
import java.util.ArrayList
trait Tr {
interface Tr {
fun extra(): String = "_"
}
@@ -1,8 +1,8 @@
trait BK {
interface BK {
fun x(): Int = 50
}
trait K : BK {
interface K : BK {
override fun x(): Int = super.x() * 2
}
@@ -2,7 +2,7 @@
open class X(val x: Int) {
}
trait Y {
interface Y {
abstract val y: Int
}
@@ -13,7 +13,7 @@ class Point(x: Int, yy: Int) : X(x), Y {
override val y: Int = yy
}
trait Abstract {
interface Abstract {
}
class P1(x: Int, yy: Y) : Abstract, X(x), Y by yy {
@@ -1,4 +1,4 @@
trait M {
interface M {
var backingB: Int
var b: Int
get() = backingB
@@ -5,7 +5,7 @@ public fun foo(): Int = 4
public fun boo(): Int = 23
fun boo(i: Int): String = "boo" + i
trait T {
interface T {
public fun foo(): Int
public fun boo(): Int
}
@@ -127,7 +127,7 @@ public fun A.boo(): Int = 2
val public_ext_f = { A.(): Int -> this.foo() + this.foo }
val public_ext_b = { A.(): Int -> this.boo() + this.boo }
trait TestPublicInTrait {
interface TestPublicInTrait {
public fun foo(): Int = 2
public val foo: Int
public val boo: Int
@@ -137,7 +137,7 @@ trait TestPublicInTrait {
val public_in_trait_f = { obj: TestPublicInTrait -> obj.foo() + obj.foo }
val public_in_trait_b = { obj: TestPublicInTrait -> obj.boo() + obj.boo }
trait TestInternalInTrait {
interface TestInternalInTrait {
fun foo(): Int = 2
val foo: Int
val boo: Int
@@ -2,7 +2,7 @@
package foo
trait I {
interface I {
fun test(): String
}
@@ -1,10 +1,10 @@
package foo
trait A {
interface A {
fun foo(i: Int) = "A"
}
trait B {
interface B {
fun foo(s: String) = "B"
}
@@ -30,7 +30,7 @@ class Color(r: Int, g: Int, b: Int) : ColorLike {
override val blue: Int = b
}
trait ColorLike {
interface ColorLike {
val red: Int;
val green: Int;
val blue: Int;
+6 -6
View File
@@ -1,13 +1,13 @@
package foo
trait A : B, E
trait B
interface A : B, E
interface B
open class C {
fun foo() = true
}
trait D
trait E
trait F : G, D
trait G
interface D
interface E
interface F : G, D
interface G
fun box() = C().foo()
@@ -8,7 +8,7 @@ package foo
import java.util.ArrayList
import java.util.HashMap
trait Element {
interface Element {
fun render(builder: StringBuilder, indent: String)
override fun toString(): String {
@@ -8,7 +8,7 @@ package foo
import java.util.ArrayList
import java.util.HashMap
trait Element {
interface Element {
fun render(builder: StringBuilder, indent: String)
override fun toString(): String {
@@ -5,7 +5,7 @@
package test
internal trait InlineTrait {
internal interface InlineTrait {
internal inline final fun finalInline(s: () -> String): String {
return s()
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
@native trait HasName {
@native interface HasName {
val name: String
}
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
@native trait Summizer {
@native interface Summizer {
fun sum(a: Int, b: Int): Int
}
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
@native trait Summizer {
@native interface Summizer {
fun sum(a: Int, b: Int): Int
}
@@ -1,7 +1,7 @@
package foo
trait TraitA
trait TraitB
interface TraitA
interface TraitB
public open abstract class Node<T : TraitA>() where T : TraitB {
public abstract fun bar(arg: T): String
@@ -1,7 +1,7 @@
package foo
@native
trait NativeTrait {
interface NativeTrait {
val foo: String
fun bar(a: Int): Any
@@ -9,7 +9,7 @@ trait NativeTrait {
fun baz(): String
}
trait Trait : NativeTrait
interface Trait : NativeTrait
class Class : NativeTrait {
override val foo: String = "Class().foo"
+3 -3
View File
@@ -1,17 +1,17 @@
package foo
@native
trait Chrome {
interface Chrome {
val extension: Extension
}
@native
trait Extension {
interface Extension {
val lastError: LastError?
}
@native
trait LastError {
interface LastError {
val message: String
}
+4 -4
View File
@@ -116,7 +116,7 @@ object Object {
}
}
trait Trait {
interface Trait {
val a: String
var b: String
fun test(): Int = noImpl
@@ -157,7 +157,7 @@ class Class {
fun test(): Int = noImpl
}
trait Trait {
interface Trait {
val a: String
var b: String
fun test(): Int = noImpl
@@ -178,7 +178,7 @@ class Class {
}
@native
trait Trait {
interface Trait {
@native("SomeObject")
object Object {
val a: String = noImpl
@@ -198,7 +198,7 @@ trait Trait {
}
@native("SomeTrait")
trait Trait {
interface Trait {
val a: String
var b: String
fun test(): Int = noImpl
@@ -1,6 +1,6 @@
package foo
trait Foo {
interface Foo {
fun execute(handler: () -> Unit) {
execute(false, handler)
}
@@ -1,6 +1,6 @@
package foo
trait I {
interface I {
fun test(): String
}
@@ -1,6 +1,6 @@
package foo
trait A {
interface A {
val bal: Int
get() {
return 42
@@ -2,7 +2,7 @@
package foo
trait Holder {
interface Holder {
val element: String
}
@@ -2,7 +2,7 @@
package foo
trait Holder {
interface Holder {
val element: String
}
@@ -2,7 +2,7 @@
package foo
trait Holder {
interface Holder {
val element: String
}
@@ -2,7 +2,7 @@
package foo
trait Holder {
interface Holder {
var element: String
}
@@ -1,6 +1,6 @@
package foo
trait A {
interface A {
val bal: Int
get() {
return 5
@@ -17,7 +17,7 @@ trait A {
}
trait B {
interface B {
val bal: Int
get() {
return 42
+1 -1
View File
@@ -8,7 +8,7 @@ class B
class C : A()
trait TypePredicate {
interface TypePredicate {
fun invoke(x: Any): Boolean
}
+2 -2
View File
@@ -2,8 +2,8 @@ package foo
// CHECK_NOT_CALLED: isInstance
trait A
trait B
interface A
interface B
open class C : A, B
+1 -1
View File
@@ -3,7 +3,7 @@ package foo
open class A
trait B
interface B
class C : A(), B
+5 -5
View File
@@ -1,10 +1,10 @@
package foo
trait A
trait B : A
trait C : A
trait D : B, C
trait E : C
interface A
interface B : A
interface C : A
interface D : B, C
interface E : C
open class CB : B
class CB2 : CB()
@@ -1,11 +1,11 @@
package foo
trait A {
interface A {
fun bar(): Int = 2
fun foo(t: Int): Int = t + 1
}
trait B : A {
interface B : A {
override fun bar(): Int = 3
}
@@ -1,10 +1,10 @@
package foo
public trait A {
public interface A {
fun foo() {
}
}
public trait B : A {
public interface B : A {
fun boo() {
}
}
@@ -5,7 +5,7 @@ open class A() {
val value = "BAR"
}
trait Test {
interface Test {
fun addFoo(s: String): String {
return s + "FOO"
}
@@ -5,7 +5,7 @@ open class A() {
val value = "BAR"
}
trait Test {
interface Test {
fun addFoo(s: String): String {
return s + "FOO"
}
+6 -6
View File
@@ -32,16 +32,16 @@ open class A() : F {
}
}
trait F : G {
interface F : G {
fun bar() = "F"
}
// KT-3437
trait G : H
trait K : H
trait L
trait H : L
trait Dummy
interface G : H
interface K : H
interface L
interface H : L
interface Dummy
fun box(): Boolean {
return (C().order == "ABC") && (D().order == "ABD") && (E().order == "AE") && (C().bar() == "F") && (A().bar() == "F")
+1 -1
View File
@@ -1,6 +1,6 @@
package foo
trait AL {
interface AL {
fun get(index: Int): Any? = null
}
+1 -1
View File
@@ -4,7 +4,7 @@ open class Base() {
fun n(n: Int): Int = n + 1
}
trait Abstract {
interface Abstract {
}
class Derived1() : Base(), Abstract {
@@ -1,6 +1,6 @@
package foo
trait Test {
interface Test {
fun addFoo(s: String): String {
return s + "FOO"
}
+2 -2
View File
@@ -1,12 +1,12 @@
package foo
trait Test {
interface Test {
fun addFoo(s: String): String {
return s + "FOO"
}
}
trait ExtendedTest : Test {
interface ExtendedTest : Test {
fun hooray(): String {
return "hooray"
}
@@ -1,18 +1,18 @@
package foo
trait A {
interface A {
fun addFoo(s: String): String {
return s + "FOO"
}
}
trait B {
interface B {
fun hooray(): String {
return "hooray"
}
}
trait AD : A, B {
interface AD : A, B {
}
@@ -45,7 +45,7 @@ fun main(args: Array<String>) {
println(result)
}
trait Element {
interface Element {
fun render(builder: StringBuilder, indent: String)
override fun toString(): String {