Files
kotlin-fork/compiler/testData/diagnostics/tests/inline/unsupportedConstruction.kt
T
Dmitry Petrov 2b27e64fc8 Improve diagnostics for "not yet supported in inline"
- Tell user what exactly is not supported (e.g., local inline function)
- Reduce diagnostics range to a keyword or an identifier
  where appropriate

 #KT-16223 Fixed Target versions 1.1.50
2017-09-06 09:46:33 +03:00

33 lines
752 B
Kotlin
Vendored

// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
// !LANGUAGE: -InlineDefaultFunctionalParameters
inline fun unsupported() {
<!NOT_YET_SUPPORTED_IN_INLINE!>class<!> A {
fun a() {
class AInner {}
}
}
<!LOCAL_OBJECT_NOT_ALLOWED!>object B<!>{
<!LOCAL_OBJECT_NOT_ALLOWED!>object BInner<!> {}
}
<!NOT_YET_SUPPORTED_IN_INLINE!>fun<!> local() {
fun localInner() {}
}
}
inline fun unsupportedDefault(<!NOT_YET_SUPPORTED_IN_INLINE!>s : ()->Unit = {}<!>) {
}
open class Base {
open fun foo(a: Int = 1) {}
}
class Derived: Base() {
<!OVERRIDE_BY_INLINE!>inline final override fun foo(<!NOT_YET_SUPPORTED_IN_INLINE!>a: Int<!>)<!> {
}
}