KT-2397 Prohibit final methods in traits with no implementation

#KT-2397 fixed
This commit is contained in:
Svetlana Isakova
2012-12-29 20:07:58 +04:00
parent 9bd4ed2a8d
commit 0b53bd25bd
7 changed files with 44 additions and 6 deletions
@@ -0,0 +1,17 @@
//KT-2397 Prohibit final methods in traits with no implementation
package a
trait T {
<!FINAL_FUNCTION_WITH_NO_BODY!>final<!> fun foo()
<!FINAL_PROPERTY_IN_TRAIT!>final<!> val b : Int
final fun bar() {}
final val c : Int
get() = 42
final val d = <!PROPERTY_INITIALIZER_IN_TRAIT!>1<!>
}
class A {
<!NON_ABSTRACT_FUNCTION_WITH_NO_BODY!>final fun foo()<!>
}