Prohibit initializer blocks inside inline classes

This commit is contained in:
Mikhail Zarechenskiy
2018-05-06 03:52:22 +03:00
parent 6a120d2f85
commit d3c1c11dc5
7 changed files with 43 additions and 3 deletions
@@ -0,0 +1,10 @@
// !LANGUAGE: +InlineClasses
// !DIAGNOSTICS: -UNUSED_VARIABLE
inline class Foo(val x: Int) {
<!INLINE_CLASS_WITH_INITIALIZER!>init<!> {}
<!INLINE_CLASS_WITH_INITIALIZER!>init<!> {
val f = 1
}
}
@@ -0,0 +1,9 @@
package
public final inline class Foo {
public constructor Foo(/*0*/ x: kotlin.Int)
public final val x: kotlin.Int
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
}