Raise RESERVED_VAR_PROPERTY_OF_VALUE_CLASS to error
This commit is contained in:
@@ -356,7 +356,7 @@ public interface Errors {
|
||||
DiagnosticFactory0<KtElement> INLINE_CLASS_CONSTRUCTOR_WRONG_PARAMETERS_SIZE = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory0<KtParameter> INLINE_CLASS_CONSTRUCTOR_NOT_FINAL_READ_ONLY_PARAMETER = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory0<KtProperty> PROPERTY_WITH_BACKING_FIELD_INSIDE_INLINE_CLASS = DiagnosticFactory0.create(ERROR, DECLARATION_SIGNATURE);
|
||||
DiagnosticFactory0<PsiElement> RESERVED_VAR_PROPERTY_OF_VALUE_CLASS = DiagnosticFactory0.create(WARNING);
|
||||
DiagnosticFactory0<PsiElement> RESERVED_VAR_PROPERTY_OF_VALUE_CLASS = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory0<PsiElement> DELEGATED_PROPERTY_INSIDE_INLINE_CLASS = DiagnosticFactory0.create(ERROR);
|
||||
DiagnosticFactory1<KtTypeReference, KotlinType> INLINE_CLASS_HAS_INAPPLICABLE_PARAMETER_TYPE = DiagnosticFactory1.create(ERROR);
|
||||
DiagnosticFactory0<PsiElement> INLINE_CLASS_CANNOT_IMPLEMENT_INTERFACE_BY_DELEGATION = DiagnosticFactory0.create(ERROR);
|
||||
|
||||
+3
@@ -6,6 +6,7 @@ import kotlin.test.assertEquals
|
||||
inline class S(val xs: Array<String>)
|
||||
|
||||
interface IFoo {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
var S.extVar: String
|
||||
}
|
||||
|
||||
@@ -14,12 +15,14 @@ interface GFoo<T> {
|
||||
}
|
||||
|
||||
object FooImpl : IFoo {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
override var S.extVar: String
|
||||
get() = xs[0]
|
||||
set(value) { xs[0] = value }
|
||||
}
|
||||
|
||||
object GFooImpl : GFoo<S> {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
override var S.extVar: String
|
||||
get() = xs[0]
|
||||
set(value) { xs[0] = value }
|
||||
|
||||
Vendored
+4
@@ -6,6 +6,7 @@ import kotlin.test.assertEquals
|
||||
var global = S("")
|
||||
|
||||
inline class Z(val x: Int) {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
var test: S
|
||||
get() = S("${global.x}$x")
|
||||
set(value) {
|
||||
@@ -14,6 +15,7 @@ inline class Z(val x: Int) {
|
||||
}
|
||||
|
||||
inline class L(val x: Long) {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
var test: S
|
||||
get() = S("${global.x}$x")
|
||||
set(value) {
|
||||
@@ -22,6 +24,7 @@ inline class L(val x: Long) {
|
||||
}
|
||||
|
||||
inline class S(val x: String) {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
var test: S
|
||||
get() = S("${global.x}$x")
|
||||
set(value) {
|
||||
@@ -30,6 +33,7 @@ inline class S(val x: String) {
|
||||
}
|
||||
|
||||
inline class A(val x: Any) {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
var test: S
|
||||
get() = S("${global.x}$x")
|
||||
set(value) {
|
||||
|
||||
+4
@@ -10,6 +10,7 @@ interface ITest {
|
||||
}
|
||||
|
||||
inline class Z(val x: Int) : ITest {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
override var test: S
|
||||
get() = S("${global.x}$x")
|
||||
set(value) {
|
||||
@@ -18,6 +19,7 @@ inline class Z(val x: Int) : ITest {
|
||||
}
|
||||
|
||||
inline class L(val x: Long) : ITest {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
override var test: S
|
||||
get() = S("${global.x}$x")
|
||||
set(value) {
|
||||
@@ -26,6 +28,7 @@ inline class L(val x: Long) : ITest {
|
||||
}
|
||||
|
||||
inline class S(val x: String) : ITest {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
override var test: S
|
||||
get() = S("${global.x}$x")
|
||||
set(value) {
|
||||
@@ -34,6 +37,7 @@ inline class S(val x: String) : ITest {
|
||||
}
|
||||
|
||||
inline class A(val x: Any) : ITest {
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
override var test: S
|
||||
get() = S("${global.x}$x")
|
||||
set(value) {
|
||||
|
||||
@@ -13,6 +13,7 @@ class C {
|
||||
var member: S = S("")
|
||||
|
||||
private var suffix = S("")
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
var S.memExt: S
|
||||
get() = this + suffix
|
||||
set(value) { suffix = this + value }
|
||||
@@ -21,6 +22,7 @@ class C {
|
||||
var topLevel: S = S("")
|
||||
|
||||
private var suffix = S("")
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
var S.ext: S
|
||||
get() = this + suffix
|
||||
set(value) { suffix = this + value }
|
||||
|
||||
@@ -15,6 +15,7 @@ inline class Z(val x: Int) : IFoo {
|
||||
|
||||
override fun fooFun(z: Z): Z = Z(z.x + x)
|
||||
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
override var fooVar: Z
|
||||
get() = Z(global.x + x)
|
||||
set(value) {
|
||||
@@ -23,6 +24,7 @@ inline class Z(val x: Int) : IFoo {
|
||||
|
||||
fun barFun(z: Z): Z = Z(z.x * 100 + x)
|
||||
|
||||
@Suppress("RESERVED_VAR_PROPERTY_OF_VALUE_CLASS")
|
||||
var barVar: Z
|
||||
get() = Z(global.x * 100 + x)
|
||||
set(value) {
|
||||
|
||||
Reference in New Issue
Block a user