KT-650 Prohibit creating class without constructor

This commit is contained in:
svtk
2012-01-24 15:41:38 +04:00
parent ee5fcccda9
commit 70d0cd882b
43 changed files with 170 additions and 218 deletions
+2 -2
View File
@@ -1,12 +1,12 @@
~A~class A {
~B~class B {
~B()~this() {}
~B()~this(i: Int) {}
}
~foo~fun foo(~foo.a~a : `std::Char`Char) = `foo.a`a`:std::Char`
~fooB~fun fooB() = `foo`foo('1')`:std::Char`
~foo.1~fun foo() : Int = (1.`std::Int.plus(Int)`plus(1))`:std::Int`
~foo1~fun foo1() : `B`B = `B()`B()`:B`
~foo1~fun foo1() : `B`B = `B`B()`:B`
~A.a~val a : `std::Int`Int
}
+1 -1
View File
@@ -11,5 +11,5 @@ package Jet86
}
val a = `A`A.`A.x`x
val c = `B`B.`!error`x
val c = `B`B.`B.x`x
val d = B().`B.x`x
@@ -8,7 +8,6 @@ fun f_plus(): Int {
}
~X~class X<~T~T> {
~X()~this() {}
fun foo(a : `T`T) : `X`X<`T`T>{}
~plus~fun plus(t : `T`T) : Int {}
~minus~fun minus(t : String) : Int {}
@@ -23,7 +22,7 @@ fun f_plus(): Int {
~t~fun <~t.T~T> t(~t.t~t : `t.T`T) : `t.T`T {
`t`t<Int>(1)`:std::Int`
`t`t<`t.T`T>(`t.t`t)`:t.T`
`X()`X<`t.T`T>()
`X`X<`t.T`T>()
1 `std::Int.plus(Int)`+ 1
1 `std::Int.plus(Int)`+= 1
X<String>() `plus`+ "1"
@@ -50,7 +49,6 @@ fun f_plus(): Int {
}
~Bar~class Bar : Foo {
~Bar()~this() {}
~not~fun not() : String {}
~inc~fun inc() : Bar
~dec~fun dec() : Bar
@@ -61,7 +59,7 @@ fun f_plus(): Int {
fun <T> tt(t : T) : T {
val x : List<Int> = 0
x`java::java.util.List.get()`[1]
val foo = `Bar()`Bar()
val foo = `Bar`Bar()
foo`!!`[null, 1]
foo`get2`[1, 1]
foo`get1`[1]