From c9f3f9ca1f8bb481427859fcb3657545e1ce483b Mon Sep 17 00:00:00 2001 From: Svetlana Isakova Date: Thu, 19 Dec 2013 22:03:43 +0400 Subject: [PATCH] added position strategy to NOTHING_TO_INLINE error --- .../jet/lang/diagnostics/Errors.java | 2 +- .../tests/inline/nothingToInline.kt | 24 +++++++++---------- .../tests/inline/nullableFunction.kt | 8 +++---- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java index 3a4e11b21d4..5b6dc10c4f1 100644 --- a/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java +++ b/compiler/frontend/src/org/jetbrains/jet/lang/diagnostics/Errors.java @@ -574,7 +574,7 @@ public interface Errors { //Inline and inlinable parameters DiagnosticFactory2 INVISIBLE_MEMBER_FROM_INLINE = DiagnosticFactory2.create(ERROR, CALL_ELEMENT); DiagnosticFactory2 NOT_YET_SUPPORTED_IN_INLINE = DiagnosticFactory2.create(ERROR); - DiagnosticFactory1 NOTHING_TO_INLINE = DiagnosticFactory1.create(WARNING); + DiagnosticFactory1 NOTHING_TO_INLINE = DiagnosticFactory1.create(WARNING, NAMED_ELEMENT); DiagnosticFactory2 USAGE_IS_NOT_INLINABLE = DiagnosticFactory2.create(ERROR); DiagnosticFactory2 NULLABLE_INLINE_PARAMETER = DiagnosticFactory2.create(ERROR); DiagnosticFactory2 RECURSION_IN_INLINE = DiagnosticFactory2.create(ERROR); diff --git a/compiler/testData/diagnostics/tests/inline/nothingToInline.kt b/compiler/testData/diagnostics/tests/inline/nothingToInline.kt index a9bd8a8294d..a56443be26e 100644 --- a/compiler/testData/diagnostics/tests/inline/nothingToInline.kt +++ b/compiler/testData/diagnostics/tests/inline/nothingToInline.kt @@ -1,29 +1,29 @@ // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE -NULLABLE_INLINE_PARAMETER -inline fun test() { +inline fun test() { -} +} inline fun test2(s : (Int) -> Int) { } -inline fun test3(noinline s : (Int) -> Int) { +inline fun test3(noinline s : (Int) -> Int) { -} +} -inline fun test4(noinline s : Int.() -> Int) { +inline fun test4(noinline s : Int.() -> Int) { -} +} -inline fun Function1?.test5() { +inline fun Function1?.test5() { -} +} -inline fun Function1?.test6() { +inline fun Function1?.test6() { -} +} -inline fun test2(s : ((Int) -> Int)?) { +inline fun test2(s : ((Int) -> Int)?) { -} \ No newline at end of file +} \ No newline at end of file diff --git a/compiler/testData/diagnostics/tests/inline/nullableFunction.kt b/compiler/testData/diagnostics/tests/inline/nullableFunction.kt index 7beb39cbb72..6990aa155c7 100644 --- a/compiler/testData/diagnostics/tests/inline/nullableFunction.kt +++ b/compiler/testData/diagnostics/tests/inline/nullableFunction.kt @@ -12,10 +12,10 @@ public inline fun submitNoInline(noinline action: Function1?, s: ( action?.invoke(10) } -public inline fun Function1?.submit() { +public inline fun Function1?.submit() { -} +} -public inline fun submit(action: Function1?) { +public inline fun submit(action: Function1?) { -} \ No newline at end of file +} \ No newline at end of file