Files
kotlin/idea/testData/quickfix/addDataModifier/sealed.kt
2017-09-25 14:17:35 +03:00

15 lines
686 B
Kotlin
Vendored

// "Make 'Foo' data class" "false"
// ACTION: Create extension function 'Foo.component1'
// ACTION: Create extension function 'Foo.component2'
// ACTION: Create member function 'Foo.component1'
// ACTION: Create member function 'Foo.component2'
// ACTION: Put arguments on separate lines
// ERROR: Cannot access '<init>': it is private in 'Foo'
// ERROR: Destructuring declaration initializer of type Foo must have a 'component1()' function
// ERROR: Destructuring declaration initializer of type Foo must have a 'component2()' function
// ERROR: Sealed types cannot be instantiated
sealed class Foo(val bar: String, val baz: Int)
fun test() {
var (bar, baz) = Foo("A", 1)<caret>
}