Introduce Property: Forbid lazy properties/properties with initializers in traits

This commit is contained in:
Alexey Sedunov
2015-03-04 17:12:04 +03:00
parent 79b64c6f9f
commit 652253b485
8 changed files with 65 additions and 7 deletions
@@ -0,0 +1,6 @@
// EXTRACTION_TARGET: lazy property
trait T {
fun foo(): Int = <selection>1</selection>
}
@@ -0,0 +1 @@
Can't generate lazy property: 1
@@ -0,0 +1,7 @@
// EXTRACTION_TARGET: property with getter
trait T {
fun foo(): Int {
return <selection>1</selection>
}
}
@@ -0,0 +1,12 @@
// EXTRACTION_TARGET: property with getter
trait T {
private val i: Int
get() {
return 1
}
fun foo(): Int {
return i
}
}
@@ -0,0 +1,6 @@
// EXTRACTION_TARGET: property with initializer
trait T {
fun foo(): Int = <selection>1</selection>
}
@@ -0,0 +1 @@
Can't generate property with initializer: 1