protected is deprecated inside objects and forbidden inside annotations and enum entries

This commit is contained in:
Mikhail Glukhikh
2015-10-05 11:43:57 +03:00
committed by Mikhail Glukhikh
parent 407d46baad
commit 846d7cac69
6 changed files with 98 additions and 4 deletions
@@ -0,0 +1,21 @@
class My(protected val x: Int) {
class Her(protected val x: Int)
inner class Its(protected val x: Int)
}
object Your {
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() = 3
}
annotation class His(<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> val x: Int)
enum class Our(protected val x: Int) {
FIRST(42) {
<!WRONG_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() = 13
}
}
interface Their {
<!DEPRECATED_MODIFIER_CONTAINING_DECLARATION!>protected<!> fun foo() = 7
}