"trait" instead of "trait class"

virtual -> open
 "final" introduced
 "wraps" dropped
This commit is contained in:
Andrey Breslav
2011-09-09 16:16:05 +04:00
parent 704a876537
commit 16dcbd41cb
94 changed files with 537 additions and 532 deletions
+1 -1
View File
@@ -14,7 +14,7 @@ abstract class MyAbstractClass() {
<error>abstract</error> fun j() {}
}
trait class MyTrait {
trait MyTrait {
fun f()
fun g() {}
<warning>abstract</warning> fun h()
+1 -1
View File
@@ -4,7 +4,7 @@ open class A() {
fun foo() : Int = 1
}
trait class B {
trait B {
fun bar() : Double = 1.0;
}
+1 -1
View File
@@ -1,6 +1,6 @@
namespace toplevelObjectDeclarations {
open class Foo(y : Int) {
virtual fun foo() : Int = 1
open fun foo() : Int = 1
}
class T : <error>Foo</error> {}
@@ -17,25 +17,25 @@ open class C2 {}
open class C3 {}
trait class T1 {}
trait T1 {}
trait class T2<T> {}
trait T2<T> {}
trait class Test<error>()</error> {
trait Test<error>()</error> {
<error>this</error>(x : Int) {}
}
trait class Test1 : C2<error>()</error> {}
trait Test1 : C2<error>()</error> {}
trait class Test2 : C2 {}
trait Test2 : C2 {}
trait class Test3 : C2, <error>C3</error> {}
trait Test3 : C2, <error>C3</error> {}
trait class Test4 : T1 {}
trait Test4 : T1 {}
trait class Test5 : T1, <error>T1</error> {}
trait Test5 : T1, <error>T1</error> {}
trait class Test6 : <error>C1</error> {}
trait Test6 : <error>C1</error> {}
class CTest1() : OC1() {}
+2 -2
View File
@@ -1,10 +1,10 @@
open class bar()
trait open class Foo<error>()</error> : bar<error>()</error>, <error>bar</error>, <error>bar</error> {
trait Foo<error>()</error> : bar<error>()</error>, <error>bar</error>, <error>bar</error> {
<error>this</error>(x : Int) {}
}
trait open class Foo2 : bar, Foo {
trait Foo2 : bar, Foo {
}
open class Foo1() : bar(), <error>bar</error>, Foo, <error>Foo</error><error>()</error> {}
@@ -4,7 +4,7 @@ fun box() {
}
open class A {
virtual fun foo() {}
open fun foo() {}
}
open class B : A {
+1 -1
View File
@@ -1,7 +1,7 @@
import java.lang.Integer
open class C {
virtual fun f(): Any = "C f"
open fun f(): Any = "C f"
}
class D() : C {
@@ -5,7 +5,7 @@ open class Base() {
}
open class Left() : Base() {}
trait class Right : Base {}
trait Right : Base {}
class D() : Left(), Right
@@ -2,7 +2,7 @@ open class Base() {
fun n(n : Int) : Int = n + 1
}
trait class Abstract {}
trait Abstract {}
class Derived1() : Base(), Abstract {}
class Derived2() : Abstract, Base() {}
@@ -1,7 +1,7 @@
// Changed when traits were introduced. May not make sense any more
open class X(val x : Int) {}
trait class Y {
trait Y {
abstract val y : Int
}
@@ -11,7 +11,7 @@ class Point(x : Int, yy : Int) : X(x) , Y {
override val y : Int = yy
}
trait class Abstract {}
trait Abstract {}
class P1(x : Int, yy : Y) : Abstract, X(x), Y by yy {}
class P2(x : Int, yy : Y) : X(x), Abstract, Y by yy {}
@@ -10,7 +10,7 @@ open class Base() {
}
}
trait class Abstract {}
trait Abstract {}
class Derived1() : Base(), Abstract {}
class Derived2() : Abstract, Base() {}
@@ -1,8 +1,8 @@
// Changed when traits were introduced. May not make sense any more
trait class Left {}
trait Left {}
open class Right() {
virtual fun f() = 42
open fun f() = 42
}
class D() : Left, Right() {
+6 -6
View File
@@ -1,12 +1,12 @@
namespace foo.bar.goo
abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
private
protected
@@ -19,15 +19,15 @@ in
out
ref
class Bar<abstract
virtual
open
[sdfsdf(1+1) a]
[sdfsdf(1+1)]
[a() sdfsdf(1+1)]
enum
open
attribute
annotation
override
virtual
open
abstract
[sdfsd sdfsd a.b.f.c]
private
+6 -6
View File
@@ -13,17 +13,17 @@ JetFile: Attributes.jet
MODIFIER_LIST
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(enum)('enum')
PsiWhiteSpace('\n')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n')
PsiElement(override)('override')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
@@ -163,7 +163,7 @@ JetFile: Attributes.jet
MODIFIER_LIST
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
ANNOTATION
PsiElement(LBRACKET)('[')
@@ -249,11 +249,11 @@ JetFile: Attributes.jet
PsiWhiteSpace('\n')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n')
PsiElement(override)('override')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
+6 -6
View File
@@ -1,12 +1,12 @@
namespace foo.bar.goo
abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
[]
private
@@ -21,12 +21,12 @@ in
out
ref
class Bar<abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
[sdfsd sdfsd a.b.f.c]
private
+6 -6
View File
@@ -13,17 +13,17 @@ JetFile: Attributes_ERR.jet
MODIFIER_LIST
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(enum)('enum')
PsiWhiteSpace('\n')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n')
PsiElement(override)('override')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
@@ -199,17 +199,17 @@ JetFile: Attributes_ERR.jet
MODIFIER_LIST
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(enum)('enum')
PsiWhiteSpace('\n')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n')
PsiElement(override)('override')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
+9 -9
View File
@@ -1,12 +1,12 @@
namespace foo.bar.goo
abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
private
protected
@@ -16,12 +16,12 @@ in
out
ref
class Bar<abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
private
protected
@@ -31,12 +31,12 @@ ref
out
ref T> {
val abstract
val virtual
val open
val enum
val open
val attribute
val annotation
val override
val virtual
val open
val abstract
val private
val protected
+9 -9
View File
@@ -13,17 +13,17 @@ JetFile: SimpleModifiers.jet
MODIFIER_LIST
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(enum)('enum')
PsiWhiteSpace('\n')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n')
PsiElement(override)('override')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
@@ -50,17 +50,17 @@ JetFile: SimpleModifiers.jet
MODIFIER_LIST
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n ')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(enum)('enum')
PsiWhiteSpace('\n ')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n ')
PsiElement(override)('override')
PsiWhiteSpace('\n ')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n ')
@@ -92,7 +92,7 @@ JetFile: SimpleModifiers.jet
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace('\n ')
PROPERTY
PsiElement(val)('val')
@@ -107,7 +107,7 @@ JetFile: SimpleModifiers.jet
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('attribute')
PsiElement(IDENTIFIER)('annotation')
PsiWhiteSpace('\n ')
PROPERTY
PsiElement(val)('val')
@@ -117,7 +117,7 @@ JetFile: SimpleModifiers.jet
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace('\n ')
PROPERTY
PsiElement(val)('val')
+26 -26
View File
@@ -4,12 +4,12 @@ import foo
public protected private internal
abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
private
protected
@@ -18,27 +18,27 @@ internal
in
out
ref
class Bar<abstract, abstract enum : T, out virtual,
class Bar<abstract, abstract enum : T, out open,
public protected private internal abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
private
protected
public
internal open
> wraps (a : B) : A by b {
> (a : B) : A by b {
public protected private internal val abstract
val virtual
val open
val enum
val open
val attribute
val annotation
val override
val virtual
val open
val abstract
val private
val protected
@@ -61,12 +61,12 @@ ref
public protected private internal
fun abstract () : abstract
fun virtual () : virtual
fun open () : open
fun enum () : enum
fun open () : open
fun attribute () : attribute
fun annotation () : annotation
fun override () : override
fun virtual () : virtual
fun open () : open
fun abstract () : abstract
fun private () : private
fun protected () : protected
@@ -86,12 +86,12 @@ ref
fun test(
abstract : t,
virtual : t,
open : t,
enum : t,
open : t,
attribute : t,
annotation : t,
override : t,
virtual : t,
open : t,
abstract : t,
private : t,
protected : t,
@@ -109,12 +109,12 @@ ref
protected : t,
internal : t,
public protected private internal abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
private
protected
@@ -128,12 +128,12 @@ ref
class F(val foo : bar,
abstract : t,
virtual : t,
open : t,
enum : t,
open : t,
attribute : t,
annotation : t,
override : t,
virtual : t,
open : t,
abstract : t,
private : t,
protected : t,
@@ -151,12 +151,12 @@ class F(val foo : bar,
protected : t,
internal : t,
public protected private internal abstract
virtual
open
enum
open
attribute
annotation
override
virtual
open
abstract
private
protected
+28 -30
View File
@@ -27,17 +27,17 @@ JetFile: SoftKeywords.jet
PsiWhiteSpace('\n')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(enum)('enum')
PsiWhiteSpace('\n')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n')
PsiElement(override)('override')
PsiWhiteSpace('\n')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n')
@@ -82,7 +82,7 @@ JetFile: SoftKeywords.jet
MODIFIER_LIST
PsiElement(out)('out')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiElement(COMMA)(',')
PsiWhiteSpace('\n ')
TYPE_PARAMETER
@@ -97,17 +97,17 @@ JetFile: SoftKeywords.jet
PsiWhiteSpace(' ')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n ')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(enum)('enum')
PsiWhiteSpace('\n ')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n ')
PsiElement(override)('override')
PsiWhiteSpace('\n ')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n ')
@@ -123,8 +123,6 @@ JetFile: SoftKeywords.jet
PsiWhiteSpace('\n ')
PsiElement(GT)('>')
PsiWhiteSpace(' ')
PsiElement(wraps)('wraps')
PsiWhiteSpace(' ')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
@@ -172,7 +170,7 @@ JetFile: SoftKeywords.jet
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace('\n ')
PROPERTY
PsiElement(val)('val')
@@ -187,7 +185,7 @@ JetFile: SoftKeywords.jet
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('attribute')
PsiElement(IDENTIFIER)('annotation')
PsiWhiteSpace('\n ')
PROPERTY
PsiElement(val)('val')
@@ -197,7 +195,7 @@ JetFile: SoftKeywords.jet
PROPERTY
PsiElement(val)('val')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace('\n ')
PROPERTY
PsiElement(val)('val')
@@ -336,7 +334,7 @@ JetFile: SoftKeywords.jet
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace(' ')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
@@ -347,7 +345,7 @@ JetFile: SoftKeywords.jet
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace('\n ')
FUN
PsiElement(fun)('fun')
@@ -384,7 +382,7 @@ JetFile: SoftKeywords.jet
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('attribute')
PsiElement(IDENTIFIER)('annotation')
PsiWhiteSpace(' ')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
@@ -395,7 +393,7 @@ JetFile: SoftKeywords.jet
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('attribute')
PsiElement(IDENTIFIER)('annotation')
PsiWhiteSpace('\n ')
FUN
PsiElement(fun)('fun')
@@ -416,7 +414,7 @@ JetFile: SoftKeywords.jet
FUN
PsiElement(fun)('fun')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace(' ')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
@@ -427,7 +425,7 @@ JetFile: SoftKeywords.jet
TYPE_REFERENCE
USER_TYPE
REFERENCE_EXPRESSION
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace('\n ')
FUN
PsiElement(fun)('fun')
@@ -704,7 +702,7 @@ JetFile: SoftKeywords.jet
PsiElement(COMMA)(',')
PsiWhiteSpace('\n ')
VALUE_PARAMETER
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
@@ -737,7 +735,7 @@ JetFile: SoftKeywords.jet
PsiElement(COMMA)(',')
PsiWhiteSpace('\n ')
VALUE_PARAMETER
PsiElement(IDENTIFIER)('attribute')
PsiElement(IDENTIFIER)('annotation')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
@@ -759,7 +757,7 @@ JetFile: SoftKeywords.jet
PsiElement(COMMA)(',')
PsiWhiteSpace('\n ')
VALUE_PARAMETER
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
@@ -957,17 +955,17 @@ JetFile: SoftKeywords.jet
PsiWhiteSpace(' ')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n ')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(enum)('enum')
PsiWhiteSpace('\n ')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n ')
PsiElement(override)('override')
PsiWhiteSpace('\n ')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n ')
@@ -1025,7 +1023,7 @@ JetFile: SoftKeywords.jet
PsiElement(COMMA)(',')
PsiWhiteSpace('\n ')
VALUE_PARAMETER
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
@@ -1058,7 +1056,7 @@ JetFile: SoftKeywords.jet
PsiElement(COMMA)(',')
PsiWhiteSpace('\n ')
VALUE_PARAMETER
PsiElement(IDENTIFIER)('attribute')
PsiElement(IDENTIFIER)('annotation')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
@@ -1080,7 +1078,7 @@ JetFile: SoftKeywords.jet
PsiElement(COMMA)(',')
PsiWhiteSpace('\n ')
VALUE_PARAMETER
PsiElement(IDENTIFIER)('virtual')
PsiElement(IDENTIFIER)('open')
PsiWhiteSpace(' ')
PsiElement(COLON)(':')
PsiWhiteSpace(' ')
@@ -1278,17 +1276,17 @@ JetFile: SoftKeywords.jet
PsiWhiteSpace(' ')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n ')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(enum)('enum')
PsiWhiteSpace('\n ')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(attribute)('attribute')
PsiElement(annotation)('annotation')
PsiWhiteSpace('\n ')
PsiElement(override)('override')
PsiWhiteSpace('\n ')
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace('\n ')
PsiElement(abstract)('abstract')
PsiWhiteSpace('\n ')
+1 -1
View File
@@ -21,7 +21,7 @@ fun countOnes(x : INumber) = if (x == 0) 0 else mostSignificantBit(x) + countOne
fun Int.matchMask(mask : Int) = this and mask == mask
virtual class INumber : IComparable<This> {
open class INumber : IComparable<This> {
val bits : Int
[operator] fun plus(other : This) : This
[operator] fun shl(bits : Int) : This
+1 -1
View File
@@ -515,7 +515,7 @@ JetFile: BitArith.jet
PsiWhiteSpace('\n\n')
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
+1 -1
View File
@@ -1,4 +1,4 @@
virtual class IPushPop<T> {
open class IPushPop<T> {
val isEmpty : Boolean
fun push(item : T)
fun pop() : T
+1 -1
View File
@@ -2,7 +2,7 @@ JetFile: IPushPop.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,9 +1,9 @@
virtual class Builder<E, R> {
open class Builder<E, R> {
[operator] fun plusAssign(item : E)
fun result() : R
}
virtual class Buildable {
open class Buildable {
fun newBuilder<E, R>() : Builder<E, R>
}
@@ -2,7 +2,7 @@ JetFile: PolymorphicClassObjects.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -67,7 +67,7 @@ JetFile: PolymorphicClassObjects.jet
PsiWhiteSpace('\n\n')
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -2,11 +2,11 @@
These declarations are "shallow" in the sense that they are not really compiled, only the type-checker uses them
*/
virtual class ReadOnlyArray<out T> : ISized {
open class ReadOnlyArray<out T> : ISized {
[operator] fun get(index : Int) : T
}
virtual class WriteOnlyArray<in T> : ISized { // This is needed to keep IIterator's <T> covariant
open class WriteOnlyArray<in T> : ISized { // This is needed to keep IIterator's <T> covariant
[operator] fun set(index : Int, value : T)
}
@@ -4,7 +4,7 @@ JetFile: MutableArray.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -69,7 +69,7 @@ JetFile: MutableArray.jet
PsiWhiteSpace('\n\n')
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,27 +1,27 @@
virtual class IEquality {
open class IEquality {
fun equals(other : Any) : Boolean
= (this as java.lang.Object).equals(other as java.lang.Object)
}
virtual class IHashable : IEquality {
open class IHashable : IEquality {
val hashCode : Integer
get() = (this as java.lang.Object).hashCode()
}
virtual class IMap<K, V> {
open class IMap<K, V> {
fun get(key : K) : V
fun set(key : K, value : V) : V
fun remove(key : K) : V
fun containsKey(key : K) : Boolean
}
class HashableWrapper wraps (val obj : Any) : IHashable
class HashableWrapper(val obj : Any) : IHashable
// equals and hashCode implementations are inherited
[inline] fun Any.hashable() : HashableWrapper = HashableWrapper(this)
virtual class IHashingStrategy<K> {
open class IHashingStrategy<K> {
fun equals(a : K, b : K) : Boolean
fun hashCode(a : K) : Integer
}
@@ -2,7 +2,7 @@ JetFile: HashMap.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -95,7 +95,7 @@ JetFile: HashMap.jet
PsiWhiteSpace('\n\n')
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -170,7 +170,7 @@ JetFile: HashMap.jet
PsiWhiteSpace('\n\n')
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -301,11 +301,8 @@ JetFile: HashMap.jet
PsiElement(class)('class')
PsiWhiteSpace(' ')
PsiElement(IDENTIFIER)('HashableWrapper')
PsiWhiteSpace(' ')
TYPE_PARAMETER_LIST
<empty list>
PsiElement(wraps)('wraps')
PsiWhiteSpace(' ')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
@@ -378,7 +375,7 @@ JetFile: HashMap.jet
PsiWhiteSpace('\n\n')
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,3 +1,3 @@
virtual class IIterable<out T> {
open class IIterable<out T> {
fun iterator() : IIterator<T>
}
@@ -2,7 +2,7 @@ JetFile: IIterable.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,4 +1,4 @@
virtual class IIterator<out T> {
open class IIterator<out T> {
fun next() : T
val hasNext : Boolean
@@ -2,7 +2,7 @@ JetFile: IIterator.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,4 +1,4 @@
virtual class IList<out T> : IIterable<T>, ISized {
open class IList<out T> : IIterable<T>, ISized {
[operator] fun get(index : Int) : T
val isEmpty : Boolean
}
@@ -2,7 +2,7 @@ JetFile: IList.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,3 +1,3 @@
virtual class IMutableIterable<out T> : IIterable<T> {
open class IMutableIterable<out T> : IIterable<T> {
fun mutableIterator() : IMutableIterator<T>
}
@@ -2,7 +2,7 @@ JetFile: IMutableIterable.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,4 +1,4 @@
virtual class IMutableIterator<out T> : IIterator<T> {
open class IMutableIterator<out T> : IIterator<T> {
fun remove() : T
/*
@@ -2,7 +2,7 @@ JetFile: IMutableIterator.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,4 +1,4 @@
virtual class IMutableList<T> : IList<T>, IMutableIterable<T> {
open class IMutableList<T> : IList<T>, IMutableIterable<T> {
fun set(index : Int, value : T) : T
fun add(index : Int, value : T)
fun remove(index : Int) : T
@@ -2,7 +2,7 @@ JetFile: IMutableList.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,4 +1,4 @@
virtual class IMutableSet<T> : ISet<T>, IMutableIterable<T> {
open class IMutableSet<T> : ISet<T>, IMutableIterable<T> {
fun add(item : T) : Boolean
fun remove(item : T) : Boolean
}
@@ -2,7 +2,7 @@ JetFile: IMutableSet.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,3 +1,3 @@
virtual class ISet<T> : IIterable<T>, ISized {
open class ISet<T> : IIterable<T>, ISized {
fun contains(item : T) : Boolean
}
@@ -2,7 +2,7 @@ JetFile: ISet.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,3 +1,3 @@
virtual class ISized {
open class ISized {
val size : Int
}
@@ -2,7 +2,7 @@ JetFile: ISized.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
+2 -2
View File
@@ -1,8 +1,8 @@
virtual class IAdder<in T> {
open class IAdder<in T> {
fun add(item : T) : Boolean
}
virtual class ICloseable {
open class ICloseable {
fun close()
}
+2 -2
View File
@@ -2,7 +2,7 @@ JetFile: IOSamples.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -47,7 +47,7 @@ JetFile: IOSamples.jet
PsiWhiteSpace('\n\n')
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
+1 -1
View File
@@ -1,4 +1,4 @@
virtual class IMap<in K, out V> {
open class IMap<in K, out V> {
}
+1 -1
View File
@@ -2,7 +2,7 @@ JetFile: IMap.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,4 +1,4 @@
virtual class IPriorityQueue<T> {
open class IPriorityQueue<T> {
fun extract() : T
fun add(item : T)
val isEmpty : Boolean
@@ -2,7 +2,7 @@ JetFile: IPriorityQueue.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -1,4 +1,4 @@
class PriorityQueueAsPushPop<T> wraps(wrapped : IPriorityQueue<T>) : IPushPop<T> {
class PriorityQueueAsPushPop<T>(wrapped : IPriorityQueue<T>) : IPushPop<T> {
override fun pop() = wrapped.extract()
override fun push(item : T) = wrapped.add(item)
override val isEmpty
@@ -9,8 +9,6 @@ JetFile: PriorityQueueAsPushPop.jet
TYPE_PARAMETER
PsiElement(IDENTIFIER)('T')
PsiElement(GT)('>')
PsiWhiteSpace(' ')
PsiElement(wraps)('wraps')
VALUE_PARAMETER_LIST
PsiElement(LPAR)('(')
VALUE_PARAMETER
@@ -1,3 +1,3 @@
virtual class IComparable<in T> {
open class IComparable<in T> {
fun compareTo(other : T) : Int
}
@@ -2,7 +2,7 @@ JetFile: IComparable.jet
NAMESPACE
CLASS
MODIFIER_LIST
PsiElement(virtual)('virtual')
PsiElement(open)('open')
PsiWhiteSpace(' ')
PsiElement(class)('class')
PsiWhiteSpace(' ')
@@ -12,11 +12,11 @@ val {foo.bar.() : ()}.foo = foo
val {foo.bar.() : ()}.foo : bar = foo
[a] public get() {}
virtual set(a : b) {}
open set(a : b) {}
val {foo.bar.() : ()}.foo : bar = foo
virtual set(a : b) {}
open set(a : b) {}
val {foo.bar.() : ()}.foo : bar = foo
+1 -1
View File
@@ -1,6 +1,6 @@
namespace toplevelObjectDeclarations {
class Foo(y : Int) {
~foo()~virtual fun foo() : Int = 1
~foo()~open fun foo() : Int = 1
}
object ~A~A : Foo(0) {