Replace annotations with brackets in testData
Just in tests that changed after deprecation
This commit is contained in:
@@ -2,10 +2,10 @@ package foo
|
||||
|
||||
annotation class fancy
|
||||
|
||||
[fancy]
|
||||
@fancy
|
||||
class Foo {
|
||||
[fancy]
|
||||
fun baz([fancy] foo : Int) : Int {
|
||||
return [fancy] 1
|
||||
@fancy
|
||||
fun baz(@fancy foo : Int) : Int {
|
||||
return (@fancy 1)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
WARNING: compiler/testData/cli/js/diagnosticForUnhandledElements.kt: (8, 21) Parameter 'foo' is never used
|
||||
ERROR: compiler/testData/cli/js/diagnosticForUnhandledElements.kt: (9, 16) Cannot translate (not supported yet): '[fancy] 1'
|
||||
COMPILATION_ERROR
|
||||
WARNING: compiler/testData/cli/js/diagnosticForUnhandledElements.kt: (8, 20) Parameter 'foo' is never used
|
||||
ERROR: compiler/testData/cli/js/diagnosticForUnhandledElements.kt: (9, 17) Cannot translate (not supported yet): '@fancy 1'
|
||||
COMPILATION_ERROR
|
||||
@@ -1,7 +1,7 @@
|
||||
package android.app
|
||||
|
||||
public open class Activity {
|
||||
public open fun findViewById([suppress("UNUSED_PARAMETER")] id: Int): android.view.View = null!!
|
||||
public open fun findViewById(@suppress("UNUSED_PARAMETER") id: Int): android.view.View = null!!
|
||||
}
|
||||
|
||||
public open class Fragment {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
package android.view
|
||||
|
||||
public open class View {
|
||||
public open fun findViewById([suppress("UNUSED_PARAMETER")] id: Int): android.view.View = null!!
|
||||
public open fun findViewById(@suppress("UNUSED_PARAMETER") id: Int): android.view.View = null!!
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
package android.widget
|
||||
|
||||
public open class TextView : android.view.View() {
|
||||
public fun setText([suppress("UNUSED_PARAMETER")] text: String) {}
|
||||
public fun setText(@suppress("UNUSED_PARAMETER") text: String) {}
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ tailRecursive fun badTails(x : Int) : Int {
|
||||
return 1 + <!NON_TAIL_RECURSIVE_CALL!>badTails<!>(x - 1)
|
||||
}
|
||||
else if (x == 10) {
|
||||
[suppress("NON_TAIL_RECURSIVE_CALL")]
|
||||
@suppress("NON_TAIL_RECURSIVE_CALL")
|
||||
return 1 + badTails(x - 1)
|
||||
} else if (x >= 50) {
|
||||
return badTails(x - 1)
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fun test() {
|
||||
[tailRecursive] fun g3(counter : Int) {
|
||||
@tailRecursive fun g3(counter : Int) {
|
||||
if (counter > 0) { g3(counter - 1) }
|
||||
}
|
||||
g3(1000000)
|
||||
|
||||
@@ -18,6 +18,6 @@ fun test() : Unit {
|
||||
val <!UNUSED_VARIABLE!>s<!> = "" <!USELESS_CAST!>as Any<!>
|
||||
("" as String?)?.length()
|
||||
(data@("" as String?))?.length()
|
||||
([data]( "" as String?))?.length()
|
||||
(@data()( "" as String?))?.length()
|
||||
Unit
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
annotation [<!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Deprecated<!>] class my
|
||||
annotation @<!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>java.lang.Deprecated<!> class my
|
||||
annotation <!PLATFORM_CLASS_MAPPED_TO_KOTLIN!>Deprecated<!> class my1
|
||||
@@ -2,4 +2,4 @@
|
||||
|
||||
annotation class Ann
|
||||
|
||||
[Ann]<!SYNTAX!><!>
|
||||
@Ann<!SYNTAX!><!>
|
||||
@@ -5,18 +5,18 @@ class C {
|
||||
fun foo() {
|
||||
class Local {
|
||||
<!UNRESOLVED_REFERENCE!>Ann0<!>
|
||||
[Ann <!UNRESOLVED_REFERENCE!>Ann3<!>]
|
||||
@Ann <!UNRESOLVED_REFERENCE!>@Ann3<!>
|
||||
Ann2(<!TOO_MANY_ARGUMENTS!>1<!>)
|
||||
[<!UNRESOLVED_REFERENCE!>Ann4<!>]<!SYNTAX!><!>
|
||||
<!UNRESOLVED_REFERENCE!>@Ann4<!><!SYNTAX!><!>
|
||||
}
|
||||
}
|
||||
<!UNRESOLVED_REFERENCE!>Ann0<!>
|
||||
[Ann <!UNRESOLVED_REFERENCE!>Ann3<!>]
|
||||
@Ann <!UNRESOLVED_REFERENCE!>@Ann3<!>
|
||||
Ann2(<!TOO_MANY_ARGUMENTS!>1<!>)
|
||||
[<!UNRESOLVED_REFERENCE!>Ann4<!>]<!SYNTAX!><!>
|
||||
<!UNRESOLVED_REFERENCE!>@Ann4<!><!SYNTAX!><!>
|
||||
}
|
||||
|
||||
<!UNRESOLVED_REFERENCE!>Ann0<!>
|
||||
[Ann <!UNRESOLVED_REFERENCE!>Ann3<!>]
|
||||
Ann2(<!TOO_MANY_ARGUMENTS!>1<!>)
|
||||
[<!UNRESOLVED_REFERENCE!>Ann4<!>]<!SYNTAX!><!>
|
||||
@Ann <!UNRESOLVED_REFERENCE!>@Ann3<!>
|
||||
@Ann2(<!TOO_MANY_ARGUMENTS!>1<!>)
|
||||
<!UNRESOLVED_REFERENCE!>@Ann4<!SYNTAX!><!><!>
|
||||
@@ -2,15 +2,15 @@ annotation class Ann
|
||||
|
||||
class C {
|
||||
fun test() {
|
||||
[Ann]<!SYNTAX!><!>
|
||||
@Ann<!SYNTAX!><!>
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
class Local {
|
||||
[Ann]<!SYNTAX!><!>
|
||||
@Ann<!SYNTAX!><!>
|
||||
}
|
||||
}
|
||||
[Ann]<!SYNTAX!><!>
|
||||
@Ann<!SYNTAX!><!>
|
||||
}
|
||||
|
||||
[Ann]<!SYNTAX!><!>
|
||||
@Ann<!SYNTAX!><!>
|
||||
@@ -1,4 +1,4 @@
|
||||
import java.lang.annotation.*
|
||||
|
||||
annotation [java.lang.annotation.Retention(RetentionPolicy.CLASS)] class my
|
||||
annotation @java.lang.annotation.Retention(RetentionPolicy.CLASS) class my
|
||||
annotation Retention(RetentionPolicy.RUNTIME) Target(ElementType.ANNOTATION_TYPE, ElementType.CONSTRUCTOR) class my1
|
||||
|
||||
+1
-1
@@ -2,5 +2,5 @@ annotation class Ann(vararg val i: Boolean)
|
||||
fun foo() {
|
||||
val bool1 = true
|
||||
|
||||
[Ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>bool1<!>)] val <!UNUSED_VARIABLE!>a<!> = bool1
|
||||
@Ann(<!ANNOTATION_PARAMETER_MUST_BE_CONST!>bool1<!>) val <!UNUSED_VARIABLE!>a<!> = bool1
|
||||
}
|
||||
+2
-2
@@ -6,11 +6,11 @@ fun foo() {
|
||||
val a3 = a1 == a2
|
||||
val a4 = a1 > a2
|
||||
|
||||
[Ann(
|
||||
@Ann(
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>a1<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>a2<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>a3<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>a1 > a2<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>a1 == a2<!>
|
||||
)] val b = 1
|
||||
) val b = 1
|
||||
}
|
||||
+2
-2
@@ -11,7 +11,7 @@ fun foo() {
|
||||
val a4 = 1
|
||||
val a5 = 1.0
|
||||
|
||||
[Ann(
|
||||
@Ann(
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>a1<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>a2<!>,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>a3<!>,
|
||||
@@ -24,5 +24,5 @@ fun foo() {
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>"a" + a2<!>,
|
||||
"a" + topLevel,
|
||||
<!ANNOTATION_PARAMETER_MUST_BE_CONST!>"a" + a4<!>
|
||||
)] val b = 1
|
||||
) val b = 1
|
||||
}
|
||||
+1
-1
@@ -3,7 +3,7 @@ annotation class Ann(val x: Int = 1)
|
||||
inline fun bar(block: () -> Int): Int = block()
|
||||
|
||||
fun foo() {
|
||||
bar() [Ann(1)] @Ann(2) { 101 }
|
||||
bar() @Ann(1) @Ann(2) { 101 }
|
||||
bar() @Ann(3) { 102 }
|
||||
|
||||
bar @Ann l1@ {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
annotation class Ann(val x: Int = 6)
|
||||
|
||||
@Ann(1) [Ann(2)] @Ann(3) @private class A [Ann] () {
|
||||
@Ann(1) @Ann(2) @Ann(3) @private class A [Ann] () {
|
||||
@Ann(x = 5) fun foo() {
|
||||
1 + @Ann(1) 1 * @Ann(<!TYPE_MISMATCH!>""<!>) 6
|
||||
|
||||
@@ -10,5 +10,5 @@ annotation class Ann(val x: Int = 6)
|
||||
|
||||
@Ann val x = 1
|
||||
|
||||
fun bar(x: @Ann(1) [Ann(2)] @Ann(3) Int) {}
|
||||
fun bar(x: @Ann(1) @Ann(2) @Ann(3) Int) {}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ fun foo(<!UNRESOLVED_REFERENCE!>varargs<!> <!UNUSED_PARAMETER!>f<!> : Int) {}
|
||||
var bar : Int = 1
|
||||
set(<!UNRESOLVED_REFERENCE!>varargs<!> v) {}
|
||||
|
||||
val x : (Int) -> Int = {[<!UNRESOLVED_REFERENCE!>varargs<!>] <!TYPE_MISMATCH!>x<!> <!DEPRECATED_STATIC_ASSERT!>: Int<!> <!SYNTAX!>-> x<!>}
|
||||
val x : (Int) -> Int = {<!UNRESOLVED_REFERENCE!>@varargs<!> <!TYPE_MISMATCH!>x<!> <!DEPRECATED_STATIC_ASSERT!>: Int<!> <!SYNTAX!>-> x<!>}
|
||||
|
||||
class Hello(<!UNRESOLVED_REFERENCE!>varargs<!> <!UNUSED_PARAMETER!>args<!>: Any) {
|
||||
}
|
||||
@@ -5,7 +5,7 @@ fun foo(test <!UNUSED_PARAMETER!>f<!> : Int) {}
|
||||
var bar : Int = 1
|
||||
set(test v) {}
|
||||
|
||||
val x : (Int) -> Int = {[test] <!TYPE_MISMATCH!>x<!> <!DEPRECATED_STATIC_ASSERT!>: Int<!> <!SYNTAX!>-> x<!>} // todo fix parser annotation on lambda parameter
|
||||
val x : (Int) -> Int = {@test <!TYPE_MISMATCH!>x<!> <!DEPRECATED_STATIC_ASSERT!>: Int<!> <!SYNTAX!>-> x<!>} // todo fix parser annotation on lambda parameter
|
||||
|
||||
class Hello(test <!UNUSED_PARAMETER!>args<!>: Any) {
|
||||
}
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
fun foo() = [ann] 1
|
||||
fun foo() = @ann 1
|
||||
|
||||
annotation class ann
|
||||
@@ -1,9 +1,9 @@
|
||||
annotation class ann
|
||||
|
||||
fun test([ann] <!UNUSED_PARAMETER!>p<!>: Int) {
|
||||
fun test(@ann <!UNUSED_PARAMETER!>p<!>: Int) {
|
||||
|
||||
}
|
||||
|
||||
val bar = fun test([ann] <!UNUSED_PARAMETER!>g<!>: Int) {}
|
||||
val bar = fun test(@ann <!UNUSED_PARAMETER!>g<!>: Int) {}
|
||||
|
||||
val bas = { <!DEPRECATED_LAMBDA_SYNTAX!>([ann] t: Int)<!> -> }
|
||||
val bas = { <!DEPRECATED_LAMBDA_SYNTAX!>(@ann t: Int)<!> -> }
|
||||
@@ -1,15 +1,15 @@
|
||||
class A {
|
||||
ann init {}
|
||||
[ann] init {}
|
||||
@ann init {}
|
||||
<!UNRESOLVED_REFERENCE!>aaa<!> init {}
|
||||
[<!UNRESOLVED_REFERENCE!>aaa<!>] init {}
|
||||
<!UNRESOLVED_REFERENCE!>@aaa<!> init {}
|
||||
}
|
||||
|
||||
trait T {
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>ann init {}<!>
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>[ann] init {}<!>
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>@ann init {}<!>
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!><!UNRESOLVED_REFERENCE!>aaa<!> init {}<!>
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!>[<!UNRESOLVED_REFERENCE!>aaa<!>] init {}<!>
|
||||
<!ANONYMOUS_INITIALIZER_IN_TRAIT!><!UNRESOLVED_REFERENCE!>@aaa<!> init {}<!>
|
||||
}
|
||||
|
||||
annotation class ann
|
||||
@@ -1,11 +1,11 @@
|
||||
fun test() {
|
||||
[ann]
|
||||
@ann
|
||||
while (2 < 1) {}
|
||||
|
||||
[ann]
|
||||
@ann
|
||||
do {} while (2 < 1)
|
||||
|
||||
[ann]
|
||||
@ann
|
||||
for (i in 1..2) {}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
fun test() {
|
||||
[ann]
|
||||
@ann
|
||||
while (2 > 1) {}
|
||||
|
||||
[ann]
|
||||
@ann
|
||||
<!UNREACHABLE_CODE!>do {} while (2 > 1)<!>
|
||||
|
||||
[ann]
|
||||
@ann
|
||||
<!UNREACHABLE_CODE!>for (i in 1..2) {}<!>
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fun test(): Any? {
|
||||
[ann] val (a, b) = P(1, 1)
|
||||
@ann val (a, b) = P(1, 1)
|
||||
return a + b
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE, -UNUSED_PARAMETER
|
||||
class A
|
||||
|
||||
fun [<!UNRESOLVED_REFERENCE!>x<!>] A.foo(a: [<!UNRESOLVED_REFERENCE!>x<!>] Int) {
|
||||
val v: [<!UNRESOLVED_REFERENCE!>x<!>] Int = 1
|
||||
fun <!UNRESOLVED_REFERENCE!>@x<!> A.foo(a: <!UNRESOLVED_REFERENCE!>@x<!> Int) {
|
||||
val v: <!UNRESOLVED_REFERENCE!>@x<!> Int = 1
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
class Foo<T> {
|
||||
[<!NOT_A_CLASS!>T<!>]
|
||||
@<!NOT_A_CLASS!>T<!>
|
||||
fun foo() = 0
|
||||
}
|
||||
|
||||
class Bar<T : Annotation> {
|
||||
[<!NOT_A_CLASS!>T<!>]
|
||||
@<!NOT_A_CLASS!>T<!>
|
||||
fun foo() = 0
|
||||
}
|
||||
@@ -6,20 +6,20 @@ trait B
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>fun A.()<!> {}
|
||||
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>a fun ()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>fun [a] A.()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>fun @a A.()<!> {}
|
||||
|
||||
class Outer {
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>fun ()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun B.()<!> {}
|
||||
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME, CONFLICTING_OVERLOADS!>a fun ()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun [a] A.()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun @a A.()<!> {}
|
||||
}
|
||||
|
||||
fun outerFun() {
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun ()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun B.()<!> {}
|
||||
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>[a] fun ()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun [a] A.()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>@a fun ()<!> {}
|
||||
<!FUNCTION_DECLARATION_WITH_NO_NAME!>fun @a A.()<!> {}
|
||||
}
|
||||
@@ -11,6 +11,6 @@ public class A {
|
||||
|
||||
// FILE: B.kt
|
||||
|
||||
class B(private [deprecated] val foo: String) : <!DEPRECATED_SYMBOL_WITH_MESSAGE!>A<!>() {
|
||||
class B(private @deprecated val foo: String) : <!DEPRECATED_SYMBOL_WITH_MESSAGE!>A<!>() {
|
||||
override fun getFoo(text: String): String = super.<!DEPRECATED_SYMBOL_WITH_MESSAGE!>getFoo<!>(text + <!DEPRECATED_SYMBOL!>foo<!>)
|
||||
}
|
||||
@@ -19,19 +19,19 @@ class PropertyHolder {
|
||||
var varDelegate <!DEPRECATED_SYMBOL_WITH_MESSAGE, DEPRECATED_SYMBOL_WITH_MESSAGE!>by<!> Delegate()
|
||||
|
||||
public val test1: String = ""
|
||||
[deprecated("val-getter")] get
|
||||
@deprecated("val-getter") get
|
||||
|
||||
public var test2: String = ""
|
||||
[deprecated("var-getter")] get
|
||||
[deprecated("var-setter")] set
|
||||
@deprecated("var-getter") get
|
||||
@deprecated("var-setter") set
|
||||
|
||||
public var test3: String = ""
|
||||
[deprecated("var-getter")] get
|
||||
@deprecated("var-getter") get
|
||||
set
|
||||
|
||||
public var test4: String = ""
|
||||
get
|
||||
[deprecated("var-setter")] set
|
||||
@deprecated("var-setter") set
|
||||
}
|
||||
|
||||
fun PropertyHolder.extFunction() {
|
||||
|
||||
@@ -11,7 +11,7 @@ val extensionWithName = fun A.name() {}
|
||||
val withoutName = fun () {}
|
||||
val extensionWithoutName = fun A.() {}
|
||||
|
||||
fun withAnnotation() = [ann(ok)] fun () {}
|
||||
fun withAnnotation() = @ann(ok) fun () {}
|
||||
val withReturn = fun (): Int { return 5}
|
||||
val withExpression = fun() = 5
|
||||
val funfun = fun() = fun() = 5
|
||||
|
||||
@@ -8,5 +8,5 @@ fun bar(a: Any) = <!NON_MEMBER_FUNCTION_NO_BODY!>fun name()<!>
|
||||
fun outer() {
|
||||
bar(<!NON_MEMBER_FUNCTION_NO_BODY!>fun ()<!>)
|
||||
bar(<!NON_MEMBER_FUNCTION_NO_BODY!>fun name()<!>)
|
||||
bar(<!NON_MEMBER_FUNCTION_NO_BODY!>[ann] fun name()<!>)
|
||||
bar(<!NON_MEMBER_FUNCTION_NO_BODY!>@ann fun name()<!>)
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
fun main(args: Array<String>) {
|
||||
<!NOT_YET_SUPPORTED_IN_INLINE!>[inline] fun a(){
|
||||
<!NOT_YET_SUPPORTED_IN_INLINE!>@inline fun a(){
|
||||
}<!>
|
||||
}
|
||||
@@ -6,7 +6,7 @@ public fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
<!NOT_YET_SUPPORTED_IN_INLINE!>[inline] fun localFun2() {
|
||||
<!NOT_YET_SUPPORTED_IN_INLINE!>@inline fun localFun2() {
|
||||
Z().localFun()
|
||||
}<!>
|
||||
|
||||
|
||||
@@ -4,7 +4,7 @@ public fun test() {
|
||||
|
||||
}
|
||||
|
||||
<!NOT_YET_SUPPORTED_IN_INLINE!>[inline] fun localFun2() {
|
||||
<!NOT_YET_SUPPORTED_IN_INLINE!>@inline fun localFun2() {
|
||||
localFun()
|
||||
}<!>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Test {
|
||||
[`InnerAnnotation`InnerAnnotation]
|
||||
@`InnerAnnotation` @InnerAnnotation
|
||||
companion object : StaticClass(), <!INACCESSIBLE_OUTER_CLASS_EXPRESSION!><!MANY_CLASSES_IN_SUPERTYPE_LIST!>InnerClass<!>()<!> {
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -DEPRECATED_ANNOTATION_SYNTAX
|
||||
annotation class Ann
|
||||
|
||||
fun <T> bar(block: (T) -> Int) {}
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
fun foo() {
|
||||
[suppress("warnings")]
|
||||
@suppress("warnings")
|
||||
("": String??)
|
||||
}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
val foo: String?
|
||||
[suppress("warnings")]
|
||||
@suppress("warnings")
|
||||
get(): String?? = null as Nothing?
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
fun foo(): Any? {
|
||||
[suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
return ""!! <!USELESS_CAST!>as String??<!>
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
val foo: String?
|
||||
[suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")]
|
||||
@suppress("REDUNDANT_NULLABLE", "UNNECESSARY_NOT_NULL_ASSERTION")
|
||||
get(): String?? = ""!! <!USELESS_CAST!>as String??<!>
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
fun foo(): Any? {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
return null <!USELESS_CAST!>as Nothing??<!>
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
class C {
|
||||
fun foo(): Any? {
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
val v: String?? = null <!USELESS_CAST!>as Nothing??<!>
|
||||
return v
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class C {
|
||||
val foo: String?
|
||||
[suppress("REDUNDANT_NULLABLE")]
|
||||
@suppress("REDUNDANT_NULLABLE")
|
||||
get(): String?? = null <!USELESS_CAST!>as Nothing??<!>
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
fun foo(a: Int) {
|
||||
[ann]
|
||||
@ann
|
||||
when (a) {
|
||||
1 -> {}
|
||||
}
|
||||
|
||||
@@ -19,5 +19,5 @@ fun test(d: dynamic) {
|
||||
// Checking specificity of `dynamic` vs `Nothing`
|
||||
nothing(d).checkType { _<String>() }
|
||||
nothing("").checkType { _<Int>() }
|
||||
[suppress("UNREACHABLE_CODE")] nothing(null!!).checkType { _<String>() }
|
||||
@suppress("UNREACHABLE_CODE") nothing(null!!).checkType { _<String>() }
|
||||
}
|
||||
+7
-7
@@ -1,24 +1,24 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun foo() {
|
||||
[nativeGetter]
|
||||
@nativeGetter
|
||||
fun Int.get(a: String): Int? = 1
|
||||
|
||||
[nativeGetter]
|
||||
@nativeGetter
|
||||
fun Int.get2(a: Number): String? = "OK"
|
||||
|
||||
[nativeGetter]
|
||||
@nativeGetter
|
||||
fun Int.get3(a: Int): String? = "OK"
|
||||
|
||||
[nativeGetter]
|
||||
@nativeGetter
|
||||
fun Int.get(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: Any<!>): Int? = 1
|
||||
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeGetter]
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
||||
fun Int.get2(): String?<!> = "OK"
|
||||
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeGetter]
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
||||
fun Int.get3(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: Any<!>, b: Int, c: Any?): String?<!> = "OK"
|
||||
|
||||
[nativeGetter]
|
||||
@nativeGetter
|
||||
fun Any.foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Int = 1<!>): Any? = "OK"
|
||||
}
|
||||
+3
-3
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun foo() {
|
||||
[native]
|
||||
@native
|
||||
class A {
|
||||
nativeGetter
|
||||
fun get(a: String): Any? = null
|
||||
@@ -13,13 +13,13 @@ fun foo() {
|
||||
fun foo(a: Double): String? = null
|
||||
}
|
||||
|
||||
[native]
|
||||
@native
|
||||
class B {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeGetter
|
||||
val foo<!> = 0
|
||||
}
|
||||
|
||||
[native]
|
||||
@native
|
||||
class C {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeGetter
|
||||
fun Int.get(a: String): Int?<!> = 1
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -NON_TOPLEVEL_CLASS_DECLARATION
|
||||
|
||||
fun foo() {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeGetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeGetter
|
||||
fun toplevelFun(): <!NATIVE_GETTER_RETURN_TYPE_SHOULD_BE_NULLABLE!>Any<!><!> = 0
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeGetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeGetter
|
||||
val toplevelVal<!> = 0
|
||||
|
||||
[nativeGetter]
|
||||
@nativeGetter
|
||||
class <!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>Foo<!> {}
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,9 +1,9 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun foo() {
|
||||
[nativeInvoke]
|
||||
@nativeInvoke
|
||||
fun Int.ext() = 1
|
||||
|
||||
[nativeInvoke]
|
||||
@nativeInvoke
|
||||
fun Int.invoke(a: String, b: Int) = "OK"
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun foo() {
|
||||
[native]
|
||||
@native
|
||||
class A {
|
||||
nativeInvoke
|
||||
fun foo() {}
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -NON_TOPLEVEL_CLASS_DECLARATION
|
||||
|
||||
fun foo() {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeInvoke]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeInvoke
|
||||
fun toplevelFun()<!> {}
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeInvoke]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeInvoke
|
||||
val toplevelVal<!> = 0
|
||||
|
||||
[nativeInvoke]
|
||||
@nativeInvoke
|
||||
class <!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>Foo<!> {}
|
||||
}
|
||||
|
||||
+10
-10
@@ -1,33 +1,33 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun foo() {
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun Int.set(a: String, v: Int) {}
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun Int.set2(a: Number, v: String?): Any? = null
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun Int.set3(a: Double, v: String) = "OK"
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun Int.set4(a: Double, v: String): Any = 1
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun Int.set5(a: Double, v: String): CharSequence = "OK"
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun Int.set6(a: Double, v: String): <!NATIVE_SETTER_WRONG_RETURN_TYPE!>Number<!> = 1
|
||||
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeSetter]
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||
fun Int.set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: Any<!>): Int?<!> = 1
|
||||
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeSetter]
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||
fun Int.set2(): String?<!> = "OK"
|
||||
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeSetter]
|
||||
<!NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||
fun Int.set3(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: Any<!>, b: Int, c: Any?)<!> {}
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun Any.<!NATIVE_SETTER_WRONG_RETURN_TYPE!>foo<!>(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Double = 0.0<!>, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String? = null<!>) = "OK"
|
||||
}
|
||||
+5
-5
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
fun foo() {
|
||||
[native]
|
||||
@native
|
||||
class A {
|
||||
nativeSetter
|
||||
fun set(a: String, v: Any?): Any? = null
|
||||
@@ -19,13 +19,13 @@ fun foo() {
|
||||
fun set5(a: Double, v: String): CharSequence = "OK"
|
||||
}
|
||||
|
||||
[native]
|
||||
@native
|
||||
class B {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
val foo<!> = 0
|
||||
}
|
||||
|
||||
[native]
|
||||
@native
|
||||
class C {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
fun Int.set(a: String, v: Int)<!> {}
|
||||
@@ -51,10 +51,10 @@ fun foo() {
|
||||
nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Number = 0.0<!>, v: String) = "OK"
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun boo(a: Number, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "str"<!>) = "OK"
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -39,7 +39,7 @@ fun foo() {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?)<!> {}
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeSetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeSetter
|
||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Int = 0<!>, v: String)<!> = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -1,12 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE -NON_TOPLEVEL_CLASS_DECLARATION
|
||||
|
||||
fun foo() {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>[nativeSetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN, NATIVE_INDEXER_WRONG_PARAMETER_COUNT!>@nativeSetter
|
||||
fun toplevelFun(): Any<!> = 0
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeSetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeSetter
|
||||
val toplevelVal<!> = 0
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
class <!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>Foo<!> {}
|
||||
}
|
||||
|
||||
+1
-1
@@ -78,6 +78,6 @@ class C {
|
||||
nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun foo(a: Number, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "aa"<!>) = "OK"
|
||||
}
|
||||
+3
-3
@@ -78,7 +78,7 @@ class A {
|
||||
nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Double = 0.0<!>, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "str"<!>) = "OK"
|
||||
}
|
||||
|
||||
@@ -104,7 +104,7 @@ class A {
|
||||
nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun foo(a: Int, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "str"<!>) = "OK"
|
||||
}
|
||||
|
||||
@@ -130,7 +130,7 @@ class A {
|
||||
nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?) {}
|
||||
|
||||
[nativeSetter]
|
||||
@nativeSetter
|
||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Number = 0.0<!>, v: String) = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
+3
-3
@@ -71,7 +71,7 @@ class A {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?)<!> {}
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeSetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeSetter
|
||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Double = 0.0<!>, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "str"<!>)<!> = "OK"
|
||||
}
|
||||
|
||||
@@ -97,7 +97,7 @@ class A {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?)<!> {}
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeSetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeSetter
|
||||
fun foo(a: Int, <!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>v: String = "str"<!>)<!> = "OK"
|
||||
}
|
||||
|
||||
@@ -123,7 +123,7 @@ class A {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?)<!> {}
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeSetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeSetter
|
||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: Number = 0.0<!>, v: String)<!> = "OK"
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -60,6 +60,6 @@ class C {
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>nativeSetter
|
||||
fun set(<!NATIVE_INDEXER_KEY_SHOULD_BE_STRING_OR_NUMBER!>a: A<!>, v: Any?)<!> {}
|
||||
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>[nativeSetter]
|
||||
<!NATIVE_ANNOTATIONS_ALLOWED_ONLY_ON_MEMBER_OR_EXTENSION_FUN!>@nativeSetter
|
||||
fun foo(<!NATIVE_INDEXER_CAN_NOT_HAVE_DEFAULT_ARGUMENTS!>a: String = "0.0"<!>, v: String)<!> = "OK"
|
||||
}
|
||||
@@ -59,7 +59,7 @@ object O {
|
||||
}
|
||||
|
||||
fun test() {
|
||||
[native]
|
||||
@native
|
||||
class Local {
|
||||
val baz: Int
|
||||
val boo: Int = noImpl
|
||||
|
||||
+4
-4
@@ -1,14 +1,14 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
import kotlin.platform.*
|
||||
|
||||
[<!ILLEGAL_PLATFORM_NAME!>platformName("")<!>]
|
||||
<!ILLEGAL_PLATFORM_NAME!>@platformName("")<!>
|
||||
fun foo(a: Any) {}
|
||||
|
||||
[<!ILLEGAL_PLATFORM_NAME!>platformName(".")<!>]
|
||||
<!ILLEGAL_PLATFORM_NAME!>@platformName(".")<!>
|
||||
fun foo() {}
|
||||
|
||||
[<!ILLEGAL_PLATFORM_NAME!>platformName("/")<!>]
|
||||
<!ILLEGAL_PLATFORM_NAME!>@platformName("/")<!>
|
||||
fun fooSlash() {}
|
||||
|
||||
[<!ILLEGAL_PLATFORM_NAME!>platformName("<")<!>]
|
||||
<!ILLEGAL_PLATFORM_NAME!>@platformName("<")<!>
|
||||
fun fooLT() {}
|
||||
+19
-19
@@ -2,66 +2,66 @@
|
||||
|
||||
import kotlin.platform.*
|
||||
|
||||
[platformName("a")]
|
||||
@platformName("a")
|
||||
fun foo() {}
|
||||
|
||||
[platformName("b")]
|
||||
@platformName("b")
|
||||
fun Any.foo() {}
|
||||
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("c")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("c")<!>
|
||||
val px = 1
|
||||
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("d")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("d")<!>
|
||||
val Any.px : Int
|
||||
get() = 1
|
||||
|
||||
val valx: Int
|
||||
[platformName("e")]
|
||||
@platformName("e")
|
||||
get() = 1
|
||||
|
||||
var varx: Int
|
||||
[platformName("f")]
|
||||
@platformName("f")
|
||||
get() = 1
|
||||
[platformName("g")]
|
||||
@platformName("g")
|
||||
set(v) {}
|
||||
|
||||
var vardef: Int = 1
|
||||
[platformName("h")]
|
||||
@platformName("h")
|
||||
get
|
||||
[platformName("i")]
|
||||
@platformName("i")
|
||||
set
|
||||
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("C")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("C")<!>
|
||||
class C [<!INAPPLICABLE_ANNOTATION!>platformName("primary")<!>]() {
|
||||
<!INAPPLICABLE_ANNOTATION!>platformName("ctr")<!> constructor(x: Int): this() {}
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("a")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("a")<!>
|
||||
fun foo() {}
|
||||
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("b")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("b")<!>
|
||||
fun Any.foo() {}
|
||||
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("c")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("c")<!>
|
||||
val px = 1
|
||||
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("d")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("d")<!>
|
||||
val Any.px : Int
|
||||
get() = 1
|
||||
|
||||
val valx: Int
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("e")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("e")<!>
|
||||
get() = 1
|
||||
|
||||
var varx: Int
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("f")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("f")<!>
|
||||
get() = 1
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("g")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("g")<!>
|
||||
set(v) {}
|
||||
}
|
||||
|
||||
fun foo1() {
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("a")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("a")<!>
|
||||
fun foo() {}
|
||||
|
||||
[<!INAPPLICABLE_ANNOTATION!>platformName("a")<!>]
|
||||
<!INAPPLICABLE_ANNOTATION!>@platformName("a")<!>
|
||||
val x = 1
|
||||
}
|
||||
+8
-8
@@ -6,18 +6,18 @@ public @interface A {
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
[A("1", "2", "3", y = 1)] fun test1() {}
|
||||
@A("1", "2", "3", y = 1) fun test1() {}
|
||||
|
||||
[A("4", y = 2)] fun test2() {}
|
||||
@A("4", y = 2) fun test2() {}
|
||||
|
||||
[A(*arrayOf("5", "6"), "7", y = 3)] fun test3() {}
|
||||
@A(*arrayOf("5", "6"), "7", y = 3) fun test3() {}
|
||||
|
||||
[A("1", "2", "3", x = String::class, y = 4)] fun test4() {}
|
||||
@A("1", "2", "3", x = String::class, y = 4) fun test4() {}
|
||||
|
||||
[A("4", y = 5)] fun test5() {}
|
||||
@A("4", y = 5) fun test5() {}
|
||||
|
||||
[A(*arrayOf("5", "6"), "7", x = Any::class, y = 6)] fun test6() {}
|
||||
@A(*arrayOf("5", "6"), "7", x = Any::class, y = 6) fun test6() {}
|
||||
|
||||
[A(y = 7)] fun test7() {}
|
||||
@A(y = 7) fun test7() {}
|
||||
|
||||
[A("8", "9", "10"<!NO_VALUE_FOR_PARAMETER!>)<!>] fun test8() {}
|
||||
@A("8", "9", "10"<!NO_VALUE_FOR_PARAMETER!>)<!> fun test8() {}
|
||||
|
||||
+11
-11
@@ -6,22 +6,22 @@ public @interface A {
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
[A("1", "2", "3")] fun test1() {}
|
||||
@A("1", "2", "3") fun test1() {}
|
||||
|
||||
[A("4")] fun test2() {}
|
||||
@A("4") fun test2() {}
|
||||
|
||||
[A(*arrayOf("5", "6"), "7")] fun test3() {}
|
||||
@A(*arrayOf("5", "6"), "7") fun test3() {}
|
||||
|
||||
[A("1", "2", "3", x = String::class)] fun test4() {}
|
||||
@A("1", "2", "3", x = String::class) fun test4() {}
|
||||
|
||||
[A("4", y = 2)] fun test5() {}
|
||||
@A("4", y = 2) fun test5() {}
|
||||
|
||||
[A(*arrayOf("5", "6"), "7", x = Any::class, y = 3)] fun test6() {}
|
||||
@A(*arrayOf("5", "6"), "7", x = Any::class, y = 3) fun test6() {}
|
||||
|
||||
[A()] fun test7() {}
|
||||
@A() fun test7() {}
|
||||
|
||||
[A] fun test8() {}
|
||||
@A fun test8() {}
|
||||
|
||||
[A(x = Any::class, <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>*arrayOf("5", "6")<!>, <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>"7"<!>, y = 3)] fun test9() {}
|
||||
[A(x = Any::class, value = *arrayOf("5", "6"), <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>"7"<!>, y = 3)] fun test10() {}
|
||||
[A(x = Any::class, value = *arrayOf("5", "6", "7"), y = 3)] fun test11() {}
|
||||
@A(x = Any::class, <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>*arrayOf("5", "6")<!>, <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>"7"<!>, y = 3) fun test9() {}
|
||||
@A(x = Any::class, value = *arrayOf("5", "6"), <!MIXING_NAMED_AND_POSITIONED_ARGUMENTS!>"7"<!>, y = 3) fun test10() {}
|
||||
@A(x = Any::class, value = *arrayOf("5", "6", "7"), y = 3) fun test11() {}
|
||||
|
||||
+1
-1
@@ -5,4 +5,4 @@ public @interface A {
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
[A(x = <!TYPE_MISMATCH(kotlin.reflect.KClass<*>; java.lang.Class<kotlin.Any>)!>javaClass<Any>()<!>, y = <!TYPE_MISMATCH!>""<!>)] fun test1() {}
|
||||
@A(x = <!TYPE_MISMATCH(kotlin.reflect.KClass<*>; java.lang.Class<kotlin.Any>)!>javaClass<Any>()<!>, y = <!TYPE_MISMATCH!>""<!>) fun test1() {}
|
||||
|
||||
+5
-5
@@ -4,12 +4,12 @@ public @interface A {
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
[A("1", "2", "3")] fun test1() {}
|
||||
@A("1", "2", "3") fun test1() {}
|
||||
|
||||
[A("4")] fun test2() {}
|
||||
@A("4") fun test2() {}
|
||||
|
||||
[A(*arrayOf("5", "6"), "7")] fun test3() {}
|
||||
@A(*arrayOf("5", "6"), "7") fun test3() {}
|
||||
|
||||
[A()] fun test4() {}
|
||||
@A() fun test4() {}
|
||||
|
||||
[A] fun test5() {}
|
||||
@A fun test5() {}
|
||||
|
||||
+5
-5
@@ -4,12 +4,12 @@ public @interface A {
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
[A("1", "2", "3")] fun test1() {}
|
||||
@A("1", "2", "3") fun test1() {}
|
||||
|
||||
[A("4")] fun test2() {}
|
||||
@A("4") fun test2() {}
|
||||
|
||||
[A(*arrayOf("5", "6"), "7")] fun test3() {}
|
||||
@A(*arrayOf("5", "6"), "7") fun test3() {}
|
||||
|
||||
[A()] fun test4() {}
|
||||
@A() fun test4() {}
|
||||
|
||||
[A] fun test5() {}
|
||||
@A fun test5() {}
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ public @interface A {
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
[A(*<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH(kotlin.Array<out kotlin.String>; IGNORE)!>arrayOf<!>(1, "b"))]
|
||||
@A(*<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH(kotlin.Array<out kotlin.String>; IGNORE)!>arrayOf<!>(1, "b"))
|
||||
fun test() {
|
||||
}
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
annotation class B(vararg val args: String)
|
||||
|
||||
[B(*<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH(kotlin.Array<out kotlin.String>; IGNORE)!>arrayOf<!>(1, "b"))]
|
||||
@B(*<!TYPE_INFERENCE_EXPECTED_TYPE_MISMATCH(kotlin.Array<out kotlin.String>; IGNORE)!>arrayOf<!>(1, "b"))
|
||||
fun test() {
|
||||
}
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
class C {
|
||||
<!OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS!>[kotlin.jvm.overloads] constructor()<!> {
|
||||
<!OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS!>@kotlin.jvm.overloads constructor()<!> {
|
||||
}
|
||||
|
||||
<!OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS!>[kotlin.jvm.overloads] fun foo(s: String)<!> {}
|
||||
<!OVERLOADS_WITHOUT_DEFAULT_ARGUMENTS!>@kotlin.jvm.overloads fun foo(s: String)<!> {}
|
||||
}
|
||||
+2
-2
@@ -1,8 +1,8 @@
|
||||
trait T {
|
||||
<!OVERLOADS_ABSTRACT!>[kotlin.jvm.overloads] fun foo(s: String = "OK")<!>
|
||||
<!OVERLOADS_ABSTRACT!>@kotlin.jvm.overloads fun foo(s: String = "OK")<!>
|
||||
}
|
||||
|
||||
|
||||
abstract class C {
|
||||
<!OVERLOADS_ABSTRACT!>[kotlin.jvm.overloads] abstract fun foo(s: String = "OK")<!>
|
||||
<!OVERLOADS_ABSTRACT!>@kotlin.jvm.overloads abstract fun foo(s: String = "OK")<!>
|
||||
}
|
||||
+4
-4
@@ -1,20 +1,20 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
class C {
|
||||
<!OVERLOADS_PRIVATE!>[kotlin.jvm.overloads] private fun foo(s: String = "OK")<!> {
|
||||
<!OVERLOADS_PRIVATE!>@kotlin.jvm.overloads private fun foo(s: String = "OK")<!> {
|
||||
}
|
||||
|
||||
[kotlin.jvm.overloads] fun bar(s: String = "OK") {
|
||||
@kotlin.jvm.overloads fun bar(s: String = "OK") {
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
class D {
|
||||
<!OVERLOADS_PRIVATE!>[kotlin.jvm.overloads] fun foo(s: String = "OK")<!> {
|
||||
<!OVERLOADS_PRIVATE!>@kotlin.jvm.overloads fun foo(s: String = "OK")<!> {
|
||||
}
|
||||
}
|
||||
|
||||
val <!UNUSED_VARIABLE!>x<!> = object {
|
||||
<!OVERLOADS_PRIVATE!>[kotlin.jvm.overloads] fun foo(s: String = "OK")<!> {
|
||||
<!OVERLOADS_PRIVATE!>@kotlin.jvm.overloads fun foo(s: String = "OK")<!> {
|
||||
}
|
||||
}
|
||||
}
|
||||
+8
-8
@@ -12,24 +12,24 @@ abstract class A {
|
||||
|
||||
object B: A() {
|
||||
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] override fun a()<!> {}
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>@platformStatic override fun a()<!> {}
|
||||
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] override fun b()<!> {}
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>@platformStatic override fun b()<!> {}
|
||||
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] final override fun c()<!> {}
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>@platformStatic final override fun c()<!> {}
|
||||
|
||||
[platformStatic] open fun d() {}
|
||||
@platformStatic open fun d() {}
|
||||
}
|
||||
|
||||
class C {
|
||||
|
||||
companion object: A() {
|
||||
[platformStatic] override fun a() {}
|
||||
@platformStatic override fun a() {}
|
||||
|
||||
[platformStatic] override fun b() {}
|
||||
@platformStatic override fun b() {}
|
||||
|
||||
[platformStatic] final override fun c() {}
|
||||
@platformStatic final override fun c() {}
|
||||
|
||||
[platformStatic] open fun d() {}
|
||||
@platformStatic open fun d() {}
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
import kotlin.platform.platformStatic
|
||||
|
||||
fun main(args: Array<String>) {
|
||||
<!PLATFORM_STATIC_NOT_IN_OBJECT!>[platformStatic] fun a()<!>{
|
||||
<!PLATFORM_STATIC_NOT_IN_OBJECT!>@platformStatic fun a()<!>{
|
||||
|
||||
}
|
||||
}
|
||||
+10
-10
@@ -9,38 +9,38 @@ open class B {
|
||||
class A {
|
||||
companion object : B() {
|
||||
var p1:Int = 1
|
||||
[platformStatic] set(p: Int) {
|
||||
@platformStatic set(p: Int) {
|
||||
p1 = 1
|
||||
}
|
||||
|
||||
[platformStatic] val z = 1;
|
||||
@platformStatic val z = 1;
|
||||
|
||||
[platformStatic] override val base1: Int = 0
|
||||
@platformStatic override val base1: Int = 0
|
||||
|
||||
override val base2: Int = 0
|
||||
[platformStatic] get
|
||||
@platformStatic get
|
||||
}
|
||||
|
||||
object A : B() {
|
||||
var p:Int = 1
|
||||
[platformStatic] set(p1: Int) {
|
||||
@platformStatic set(p1: Int) {
|
||||
p = 1
|
||||
}
|
||||
|
||||
[platformStatic] val z = 1;
|
||||
@platformStatic val z = 1;
|
||||
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] override val base1: Int<!> = 0
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>@platformStatic override val base1: Int<!> = 0
|
||||
|
||||
platformStatic open fun f() {}
|
||||
|
||||
override val base2: Int = 0
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>[platformStatic] get<!>
|
||||
<!OVERRIDE_CANNOT_BE_STATIC!>@platformStatic get<!>
|
||||
}
|
||||
|
||||
var p:Int = 1
|
||||
<!PLATFORM_STATIC_NOT_IN_OBJECT!>[platformStatic] set(p1: Int)<!> {
|
||||
<!PLATFORM_STATIC_NOT_IN_OBJECT!>@platformStatic set(p1: Int)<!> {
|
||||
p = 1
|
||||
}
|
||||
|
||||
<!PLATFORM_STATIC_NOT_IN_OBJECT!>[platformStatic] val z2<!> = 1;
|
||||
<!PLATFORM_STATIC_NOT_IN_OBJECT!>@platformStatic val z2<!> = 1;
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
class A {
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>[kotlin.jvm.overloads] fun foo(s: String = "")<!> {
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>@kotlin.jvm.overloads fun foo(s: String = "")<!> {
|
||||
}
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun foo()<!> {
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
import kotlin.platform.*
|
||||
|
||||
[platformName("bar")]
|
||||
@platformName("bar")
|
||||
fun foo(a: Any) {}
|
||||
|
||||
fun Any.foo() {}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
import kotlin.platform.*
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>[platformName("bar")]
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>@platformName("bar")
|
||||
fun foo(a: Any)<!> {}
|
||||
|
||||
<!CONFLICTING_JVM_DECLARATIONS!>fun bar(a: Any)<!> {}
|
||||
@@ -4,7 +4,7 @@ fun unused(<warning descr="[UNUSED_PARAMETER] Parameter 'p' is never used">p</wa
|
||||
|
||||
}
|
||||
|
||||
[MyTestAnnotation]
|
||||
@MyTestAnnotation
|
||||
fun unusedButAnnotated(p: Int) {
|
||||
|
||||
}
|
||||
|
||||
@@ -7,7 +7,7 @@ fun <info descr="null">bar</info>(<info descr="null">block</info>: () -> <info d
|
||||
|
||||
<info descr="null" textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">@private</info>
|
||||
fun <info descr="null">foo</info>() {
|
||||
1 + [<info descr="null" textAttributesKey="KOTLIN_ANNOTATION">Ann</info>] 2
|
||||
1 + <info descr="null" textAttributesKey="KOTLIN_ANNOTATION">@Ann</info> 2
|
||||
|
||||
<info descr="null" textAttributesKey="KOTLIN_ANNOTATION">@Ann</info> 3 + 4
|
||||
|
||||
|
||||
@@ -7,6 +7,6 @@ class <info textAttributesKey="KOTLIN_CLASS">TheClass</info> : <info textAttribu
|
||||
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">annotation</info> class <info textAttributesKey="KOTLIN_ANNOTATION">magnificent</info>
|
||||
<info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">annotation</info> class <info textAttributesKey="KOTLIN_ANNOTATION">deprecated</info>
|
||||
|
||||
[<info textAttributesKey="KOTLIN_ANNOTATION">deprecated</info>]
|
||||
<info textAttributesKey="KOTLIN_ANNOTATION">@deprecated</info>
|
||||
<info textAttributesKey="KOTLIN_ANNOTATION">magnificent</info> <info textAttributesKey="KOTLIN_BUILTIN_ANNOTATION">abstract</info> class <info textAttributesKey="KOTLIN_ABSTRACT_CLASS">AbstractClass</info><<info textAttributesKey="KOTLIN_TYPE_PARAMETER">T</info>> {
|
||||
}
|
||||
|
||||
@@ -9,13 +9,13 @@ fun test() {
|
||||
|
||||
class MyClass() {
|
||||
public val test1: String = ""
|
||||
[deprecated("Use A instead")] get
|
||||
@deprecated("Use A instead") get
|
||||
|
||||
public var test2: String = ""
|
||||
[deprecated("Use A instead")] get
|
||||
@deprecated("Use A instead") get
|
||||
|
||||
deprecated("Use A instead") public val test3: String = ""
|
||||
[deprecated("Use A instead")] get
|
||||
@deprecated("Use A instead") get
|
||||
}
|
||||
|
||||
// NO_CHECK_INFOS
|
||||
|
||||
@@ -19,11 +19,11 @@ fun test() {
|
||||
|
||||
class MyClass() {
|
||||
public var test1: Int = 0
|
||||
[deprecated("Use A instead")] set
|
||||
@deprecated("Use A instead") set
|
||||
}
|
||||
|
||||
public var test2: Int = 0
|
||||
[deprecated("Use A instead")] set
|
||||
@deprecated("Use A instead") set
|
||||
|
||||
// NO_CHECK_INFOS
|
||||
// NO_CHECK_WEAK_WARNINGS
|
||||
+1
-1
@@ -3,6 +3,6 @@
|
||||
// ERROR: Unresolved reference: foo
|
||||
// ERROR: Unresolved reference: bar
|
||||
|
||||
[foo(1, "2", <caret>bar("3", 4))] fun test() {
|
||||
@foo(1, "2", <caret>bar("3", 4)) fun test() {
|
||||
|
||||
}
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
// "class com.intellij.codeInspection.SuppressIntentionAction" "false"
|
||||
// ACTION: Suppress 'INTEGER_OVERFLOW' for fun foo
|
||||
|
||||
[Ann(Integer.MAX_VALUE<caret> + 1)]
|
||||
@Ann(Integer.MAX_VALUE<caret> + 1)
|
||||
fun foo() {}
|
||||
|
||||
annotation class Ann(val b: Int)
|
||||
Reference in New Issue
Block a user