[FIR] Add NOT_YET_SUPPORTED_IN_INLINE diagnostic

This commit is contained in:
Andrey Zinovyev
2021-07-19 18:21:56 +03:00
committed by teamcityserver
parent bc75a21852
commit 28344c8530
28 changed files with 151 additions and 81 deletions
@@ -40,9 +40,9 @@ abstract class Base {
}
class Derived : Base() {
override final inline fun foo(f: () -> Unit) {
override final inline fun foo(<!NOT_YET_SUPPORTED_IN_INLINE!>f: () -> Unit<!>) {
f()
}
}
inline fun default11(s : () -> Derived = ::Derived) {}
inline fun default11(s : () -> Derived = ::Derived) {}
@@ -1,10 +0,0 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE -NOTHING_TO_INLINE
// SKIP_TXT
suspend inline fun test1(s : suspend () -> String = { "OK" }) {}
suspend inline fun test2(s : () -> String = { "OK" }) {}
suspend inline fun test3(crossinline s : suspend () -> String = { "OK" }) {}
suspend inline fun test4(crossinline s : () -> String = { "OK" }) {}
suspend inline fun test5(noinline s : suspend () -> String = { "OK" }) {}
suspend inline fun test6(noinline s : () -> String = { "OK" }) {}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -REDUNDANT_INLINE_SUSPEND_FUNCTION_TYPE -NOTHING_TO_INLINE
// SKIP_TXT
@@ -39,9 +39,9 @@ abstract class Base {
}
class Derived : Base() {
override final inline fun foo(f: () -> Unit) {
override final inline fun foo(<!NOT_YET_SUPPORTED_IN_INLINE!>f: () -> Unit<!>) {
f()
}
}
inline fun default11(s : () -> Derived = ::Derived) {}
inline fun default11(s : () -> Derived = ::Derived) {}
@@ -1,4 +0,0 @@
fun main() {
inline fun a(){
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
fun main() {
<!NOT_YET_SUPPORTED_IN_INLINE!>inline<!> fun a(){
}
@@ -1,10 +1,10 @@
inline fun inlineFun() {
fun localFun() {}
class LocalClass {}
<!NOT_YET_SUPPORTED_IN_INLINE!>fun<!> localFun() {}
<!NOT_YET_SUPPORTED_IN_INLINE!>class<!> LocalClass {}
}
fun outerFun() {
inline fun localInlineFun() {}
<!NOT_YET_SUPPORTED_IN_INLINE!>inline<!> fun localInlineFun() {}
}
abstract class Base {
@@ -13,6 +13,6 @@ abstract class Base {
class Derived : Base() {
override final inline fun withDefault(
f: () -> Unit
<!NOT_YET_SUPPORTED_IN_INLINE!>f: () -> Unit<!>
) {}
}
}
@@ -1,14 +1,14 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
inline fun <R> inlineFunOnlyLocal(crossinline p: () -> R) {
fun a() {
<!NOT_YET_SUPPORTED_IN_INLINE!>fun<!> a() {
val z = p()
}
a()
}
inline fun <R> inlineFun(p: () -> R) {
fun a() {
<!NOT_YET_SUPPORTED_IN_INLINE!>fun<!> a() {
p()
}
a()
@@ -1,7 +1,7 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
inline fun <R> inlineFunOnlyLocal(crossinline p: () -> R) {
class A {
<!NOT_YET_SUPPORTED_IN_INLINE!>class<!> A {
val z = p()
@@ -12,7 +12,7 @@ inline fun <R> inlineFunOnlyLocal(crossinline p: () -> R) {
}
inline fun <R> inlineFun(p: () -> R) {
class A {
<!NOT_YET_SUPPORTED_IN_INLINE!>class<!> A {
val z = p()
@@ -1,13 +0,0 @@
public fun test() {
class Z {
public fun localFun() {
}
}
inline fun localFun2() {
Z().localFun()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
public fun test() {
class Z {
@@ -1,11 +0,0 @@
public fun test() {
fun localFun() {
}
inline fun localFun2() {
localFun()
}
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
public fun test() {
fun localFun() {
@@ -1,20 +0,0 @@
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
inline val z: Int
get() {
class A {
fun a() {
class AInner {}
}
}
<!LOCAL_OBJECT_NOT_ALLOWED!>object B<!>{
<!LOCAL_OBJECT_NOT_ALLOWED!>object BInner<!> {}
}
fun local() {
fun localInner() {}
}
return 1
}
@@ -1,3 +1,4 @@
// FIR_IDENTICAL
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NOTHING_TO_INLINE
inline val z: Int
@@ -3,7 +3,7 @@
inline fun unsupported() {
class A {
<!NOT_YET_SUPPORTED_IN_INLINE!>class<!> A {
fun a() {
class AInner {}
}
@@ -13,7 +13,7 @@ inline fun unsupported() {
<!LOCAL_OBJECT_NOT_ALLOWED!>object BInner<!> {}
}
fun local() {
<!NOT_YET_SUPPORTED_IN_INLINE!>fun<!> local() {
fun localInner() {}
}
}
@@ -27,7 +27,7 @@ open class Base {
}
class Derived: Base() {
inline final override fun foo(a: Int) {
inline final override fun foo(<!NOT_YET_SUPPORTED_IN_INLINE!>a: Int<!>) {
}
}