K2: Add KtDiagnosticRenderers.CLASS_ID to render ClassId FQNs with dots
KT-MR-13391
This commit is contained in:
committed by
Space Team
parent
1766d0e86a
commit
f53f92cdd6
+47
@@ -0,0 +1,47 @@
|
||||
FILE: ClassIdDiagnosticRendering.kt
|
||||
package a.b.c
|
||||
|
||||
@R|kotlin/RequiresOptIn|() public final annotation class Marker : R|kotlin/Annotation| {
|
||||
public constructor(): R|a/b/c/Marker| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
@R|a/b/c/Marker|() public final class Some : R|kotlin/Any| {
|
||||
public constructor(): R|a/b/c/Some| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
public final fun main(): R|kotlin/Unit| {
|
||||
R|a/b/c/Some.Some|()
|
||||
}
|
||||
public final annotation class DummyAnnotation : R|kotlin/Annotation| {
|
||||
public constructor(): R|a/b/c/DummyAnnotation| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
@R|kotlin/SubclassOptInRequired|(markerClass = <getClass>(Q|a/b/c/DummyAnnotation|)) public open class IncorrectSubclassOptInArgumentMarker : R|kotlin/Any| {
|
||||
public constructor(): R|a/b/c/IncorrectSubclassOptInArgumentMarker| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
}
|
||||
internal abstract fun interface StableInterface : R|kotlin/Any| {
|
||||
@R|a/b/c/Marker|() public abstract fun experimentalMethod(): R|kotlin/Unit|
|
||||
|
||||
}
|
||||
public final fun testOverrides(): R|kotlin/Unit| {
|
||||
object : R|a/b/c/StableInterface| {
|
||||
private constructor(): R|a/b/c/<anonymous>| {
|
||||
super<R|kotlin/Any|>()
|
||||
}
|
||||
|
||||
public open override fun experimentalMethod(): R|kotlin/Unit| {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
public final actual typealias TypealiasToKotlinPkg = R|kotlin/Deprecated|
|
||||
+33
@@ -0,0 +1,33 @@
|
||||
// WITH_EXTENDED_CHECKERS
|
||||
|
||||
package a.b.c
|
||||
|
||||
import <!PLATFORM_CLASS_MAPPED_TO_KOTLIN("kotlin.jvm.functions.Function0")!>kotlin.jvm.functions.Function0<!>
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class Marker
|
||||
|
||||
@Marker
|
||||
class Some
|
||||
|
||||
fun main() {
|
||||
<!OPT_IN_USAGE_ERROR("a.b.c.Marker; This declaration needs opt-in. Its usage must be marked with '@a.b.c.Marker' or '@OptIn(a.b.c.Marker::class)'")!>Some<!>()
|
||||
}
|
||||
|
||||
annotation class DummyAnnotation
|
||||
|
||||
<!OPT_IN_ARGUMENT_IS_NOT_MARKER("a.b.c.DummyAnnotation")!>@SubclassOptInRequired(DummyAnnotation::class)<!>
|
||||
open class IncorrectSubclassOptInArgumentMarker
|
||||
|
||||
internal fun interface StableInterface {
|
||||
@Marker
|
||||
fun experimentalMethod()
|
||||
}
|
||||
|
||||
fun testOverrides() {
|
||||
object : StableInterface {
|
||||
override fun <!OPT_IN_OVERRIDE_ERROR("a.b.c.Marker; Base declaration of supertype 'StableInterface' needs opt-in. The declaration override must be annotated with '@a.b.c.Marker' or '@OptIn(a.b.c.Marker::class)'")!>experimentalMethod<!>() {}
|
||||
}
|
||||
}
|
||||
|
||||
<!NOT_A_MULTIPLATFORM_COMPILATION!>actual<!> typealias TypealiasToKotlinPkg = <!ACTUAL_TYPEALIAS_TO_SPECIAL_ANNOTATION("kotlin.Deprecated")!>kotlin.Deprecated<!>
|
||||
Reference in New Issue
Block a user