Checking modality and visibility of inline function

This commit is contained in:
Mikhael Bogdanov
2013-11-18 14:36:03 +04:00
parent 87e66a6e57
commit f7c62fe631
3 changed files with 72 additions and 3 deletions
@@ -0,0 +1,48 @@
inline private fun a() {}
inline fun b() {}
inline public fun c() {}
abstract class A {
inline private fun good1() {}
inline public final fun good2() {}
inline protected final fun good3() {}
inline final fun good4() {}
<!DECLARATION_CANT_BE_INLINED!>inline open protected fun wrong1() {}<!>
<!DECLARATION_CANT_BE_INLINED!>inline open public fun wrong2() {}<!>
<!DECLARATION_CANT_BE_INLINED!>inline open fun wrong3() {}<!>
<!DECLARATION_CANT_BE_INLINED!>inline abstract protected fun wrong4()<!>
<!DECLARATION_CANT_BE_INLINED!>inline abstract public fun wrong5()<!>
<!DECLARATION_CANT_BE_INLINED!>inline abstract fun wrong6()<!>
}
trait B {
inline private fun good1() {}
inline public final fun good2() {}
inline protected final fun good3() {}
inline final fun good4() {}
<!DECLARATION_CANT_BE_INLINED!>inline fun wrong1() {}<!>
<!DECLARATION_CANT_BE_INLINED!>inline open protected fun wrong2() {}<!>
<!DECLARATION_CANT_BE_INLINED!>inline open public fun wrong3() {}<!>
<!DECLARATION_CANT_BE_INLINED!>inline open fun wrong4() {}<!>
<!DECLARATION_CANT_BE_INLINED!>inline protected fun wrong5()<!>
<!DECLARATION_CANT_BE_INLINED!>inline public fun wrong6()<!>
<!DECLARATION_CANT_BE_INLINED!>inline fun wrong7()<!>
}