Do not include annotations and KDoc into NO_EXPLICIT_VISIBILITY_IN_API_MODE report range

Rename positioning strategy to better reflect its behavior.
#KT-36021 fixed.
This commit is contained in:
Leonid Startsev
2020-01-22 16:39:18 +03:00
parent 4285c6045a
commit 43858e8169
9 changed files with 112 additions and 18 deletions
@@ -0,0 +1,45 @@
// SKIP_TXT
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>annotation class A<!>
@Target(
AnnotationTarget.CLASS,
AnnotationTarget.PROPERTY,
AnnotationTarget.CONSTRUCTOR,
AnnotationTarget.FUNCTION
)
public annotation class B
/**
* Foo1 KDoc
*/
@B
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>class Foo1<!>() {}
public class Foo2() {
/**
* KDoc for methodWithAnnotations
*/
@B
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>fun methodWithAnnotations<!>() {}
/**
* Property KDoc
*/
@B
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>var simple<!>: Int = 10
}
public open class ClassWithOpen {
/**
* constructor KDoc
*/
@B
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>constructor<!>() {}
/**
* KDoc for openAnnotatedMethod
*/
@B
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>open fun openAnnotatedMethod<!>() {}
}
@@ -1,9 +1,19 @@
// SKIP_TXT
/**
* KDoc for Foo1
*/
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>class Foo1<!>() {}
public class Foo2() {
/**
* KDoc for method
*/
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>fun method<!>() {}
/**
* KDoc for method2
*/
public fun method2() {}
private fun method3() {}
@@ -12,6 +22,18 @@ public class Foo2() {
public fun implicit3(): Int = 10
}
public open class ClassWithOpen() {
/**
* KDoc for method
*/
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>fun method<!>() {}
/**
* KDoc for openMethod
*/
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>open fun openMethod<!>() {}
}
public data class FooData(val i: Int, val s: String)
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>data class FooData2<!>(val i: Int, val s: String)
@@ -9,5 +9,8 @@ public class Bar2 {
}
public class Bar3 {
/**
* Nested object KDoc
*/
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>object NestedObject<!> {}
}
@@ -6,6 +6,9 @@ public class Foo3 public constructor() {}
public class Foo4 private constructor() {}
public class Foo5 {
/**
* constructor KDoc
*/
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>constructor<!>() {}
}
@@ -1,6 +1,9 @@
// SKIP_TXT
public class Foo(<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>val bar<!>: Int, private var bar2: String, internal var bar3: Long, public var bar4: Int) {
/**
* Property KDoc
*/
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>var simple<!>: Int = 10
public var simple2: Int = 10
@@ -1,5 +1,8 @@
// SKIP_TXT
/**
* foo KDoc
*/
<!NO_EXPLICIT_VISIBILITY_IN_API_MODE!>fun foo<!>() {}
public fun foo2() {}