Allow return statements in secondary constructors

This commit is contained in:
Denis Zharkov
2015-03-03 16:36:52 +03:00
parent 80e13d3f70
commit 61ae694be4
4 changed files with 42 additions and 2 deletions
@@ -0,0 +1,17 @@
class A {
init {
<!RETURN_NOT_ALLOWED!>return<!>
<!RETURN_NOT_ALLOWED!>return 1<!>
}
constructor() {
if (1 == 1) {
return
return <!CONSTANT_EXPECTED_TYPE_MISMATCH!>1<!>
}
return
return <!TYPE_MISMATCH!>foo()<!>
}
fun foo(): Int = 1
}
@@ -0,0 +1,9 @@
package
internal final class A {
public constructor A()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
internal final fun foo(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}