[FE 1.0] Report warning on non-deprecated overrides of deprecated members
Also don't propagate deprecation status to overrides after 1.7 ^KT-47902 Fixed
This commit is contained in:
+1
@@ -1,3 +1,4 @@
|
||||
// LANGUAGE: +StopPropagatingDeprecationThroughOverrides
|
||||
package foo
|
||||
|
||||
interface WarningDeprecated {
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
// LANGUAGE: +StopPropagatingDeprecationThroughOverrides
|
||||
package foo
|
||||
|
||||
interface WarningDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.WARNING)
|
||||
fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface ErrorDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface HiddenDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN)
|
||||
fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface NotDeprecated {
|
||||
fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class WE : WarningDeprecated, ErrorDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class WH : WarningDeprecated, HiddenDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class EH : ErrorDeprecated, HiddenDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class NW : WarningDeprecated, NotDeprecated {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class NE : ErrorDeprecated, NotDeprecated {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class NH : HiddenDeprecated, NotDeprecated {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class WEH: WarningDeprecated, ErrorDeprecated, HiddenDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class NWEH: NotDeprecated, WarningDeprecated, ErrorDeprecated, HiddenDeprecated {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class WE2: WE()
|
||||
|
||||
<!MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class NWE2<!>: WE(), NotDeprecated
|
||||
|
||||
class NWE3: WE(), NotDeprecated {
|
||||
override fun f() {
|
||||
}
|
||||
}
|
||||
|
||||
interface E2: ErrorDeprecated
|
||||
interface W2: WarningDeprecated
|
||||
|
||||
interface EW2: E2, W2 {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
}
|
||||
}
|
||||
|
||||
interface HEW2: EW2, HiddenDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
}
|
||||
}
|
||||
|
||||
interface ExplicitError: HEW2 {
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
override fun f() {
|
||||
super.f()
|
||||
}
|
||||
}
|
||||
|
||||
fun use(
|
||||
wd: WarningDeprecated, ed: ErrorDeprecated, hd: HiddenDeprecated,
|
||||
we: WE, wh: WH, eh: EH, nw: NW, ne: NE, nh: NH,
|
||||
weh: WEH, nweh: NWEH,
|
||||
we2: WE2, nwe2: NWE2, nwe3: NWE3,
|
||||
e2: E2, w2: W2, ew2: EW2, hew2: HEW2,
|
||||
explicitError: ExplicitError
|
||||
) {
|
||||
wd.<!DEPRECATION!>f<!>()
|
||||
ed.<!DEPRECATION_ERROR!>f<!>()
|
||||
hd.<!UNRESOLVED_REFERENCE!>f<!>()
|
||||
|
||||
we.f()
|
||||
wh.f()
|
||||
eh.f()
|
||||
|
||||
nw.f()
|
||||
ne.f()
|
||||
nh.f()
|
||||
|
||||
weh.f()
|
||||
nweh.f()
|
||||
|
||||
we2.f()
|
||||
nwe2.f()
|
||||
nwe3.f()
|
||||
|
||||
e2.<!DEPRECATION_ERROR!>f<!>()
|
||||
w2.<!DEPRECATION!>f<!>()
|
||||
ew2.f()
|
||||
hew2.f()
|
||||
|
||||
explicitError.<!DEPRECATION_ERROR!>f<!>()
|
||||
}
|
||||
+11
-10
@@ -1,3 +1,4 @@
|
||||
// LANGUAGE: -StopPropagatingDeprecationThroughOverrides
|
||||
package foo
|
||||
|
||||
interface WarningDeprecated {
|
||||
@@ -100,7 +101,7 @@ interface HEW2: EW2, HiddenDeprecated {
|
||||
interface ExplicitError: HEW2 {
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
override fun f() {
|
||||
super.<!DEPRECATION!>f<!>()
|
||||
super.f()
|
||||
}
|
||||
}
|
||||
|
||||
@@ -114,27 +115,27 @@ fun use(
|
||||
) {
|
||||
wd.<!DEPRECATION!>f<!>()
|
||||
ed.<!DEPRECATION_ERROR!>f<!>()
|
||||
hd.<!UNRESOLVED_REFERENCE!>f<!>()
|
||||
hd.<!INVISIBLE_REFERENCE!>f<!>()
|
||||
|
||||
we.<!DEPRECATION!>f<!>()
|
||||
wh.<!DEPRECATION!>f<!>()
|
||||
eh.<!DEPRECATION_ERROR!>f<!>()
|
||||
we.f()
|
||||
wh.f()
|
||||
eh.f()
|
||||
|
||||
nw.f()
|
||||
ne.f()
|
||||
nh.f()
|
||||
|
||||
weh.<!DEPRECATION!>f<!>()
|
||||
weh.f()
|
||||
nweh.f()
|
||||
|
||||
we2.<!DEPRECATION!>f<!>()
|
||||
we2.f()
|
||||
nwe2.f()
|
||||
nwe3.f()
|
||||
|
||||
e2.<!DEPRECATION_ERROR!>f<!>()
|
||||
w2.<!DEPRECATION!>f<!>()
|
||||
ew2.<!DEPRECATION!>f<!>()
|
||||
hew2.<!DEPRECATION!>f<!>()
|
||||
ew2.f()
|
||||
hew2.f()
|
||||
|
||||
explicitError.<!DEPRECATION_ERROR!>f<!>()
|
||||
}
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
// LANGUAGE: -StopPropagatingDeprecationThroughOverrides
|
||||
package foo
|
||||
|
||||
interface WarningDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.WARNING)
|
||||
fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface ErrorDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface HiddenDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN)
|
||||
fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface NotDeprecated {
|
||||
fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class WE : WarningDeprecated, ErrorDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class WH : WarningDeprecated, HiddenDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class EH : ErrorDeprecated, HiddenDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class NW : WarningDeprecated, NotDeprecated {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class NE : ErrorDeprecated, NotDeprecated {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class NH : HiddenDeprecated, NotDeprecated {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class WEH: WarningDeprecated, ErrorDeprecated, HiddenDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
open class NWEH: NotDeprecated, WarningDeprecated, ErrorDeprecated, HiddenDeprecated {
|
||||
override fun f() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
class WE2: WE()
|
||||
|
||||
<!MANY_IMPL_MEMBER_NOT_IMPLEMENTED!>class NWE2<!>: WE(), NotDeprecated
|
||||
|
||||
class NWE3: WE(), NotDeprecated {
|
||||
override fun f() {
|
||||
}
|
||||
}
|
||||
|
||||
interface E2: ErrorDeprecated
|
||||
interface W2: WarningDeprecated
|
||||
|
||||
interface EW2: E2, W2 {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
}
|
||||
}
|
||||
|
||||
interface HEW2: EW2, HiddenDeprecated {
|
||||
override fun <!OVERRIDE_DEPRECATION!>f<!>() {
|
||||
}
|
||||
}
|
||||
|
||||
interface ExplicitError: HEW2 {
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
override fun f() {
|
||||
super.<!DEPRECATION!>f<!>()
|
||||
}
|
||||
}
|
||||
|
||||
fun use(
|
||||
wd: WarningDeprecated, ed: ErrorDeprecated, hd: HiddenDeprecated,
|
||||
we: WE, wh: WH, eh: EH, nw: NW, ne: NE, nh: NH,
|
||||
weh: WEH, nweh: NWEH,
|
||||
we2: WE2, nwe2: NWE2, nwe3: NWE3,
|
||||
e2: E2, w2: W2, ew2: EW2, hew2: HEW2,
|
||||
explicitError: ExplicitError
|
||||
) {
|
||||
wd.<!DEPRECATION!>f<!>()
|
||||
ed.<!DEPRECATION_ERROR!>f<!>()
|
||||
hd.<!UNRESOLVED_REFERENCE!>f<!>()
|
||||
|
||||
we.<!DEPRECATION!>f<!>()
|
||||
wh.<!DEPRECATION!>f<!>()
|
||||
eh.<!DEPRECATION_ERROR!>f<!>()
|
||||
|
||||
nw.f()
|
||||
ne.f()
|
||||
nh.f()
|
||||
|
||||
weh.<!DEPRECATION!>f<!>()
|
||||
nweh.f()
|
||||
|
||||
we2.<!DEPRECATION!>f<!>()
|
||||
nwe2.f()
|
||||
nwe3.f()
|
||||
|
||||
e2.<!DEPRECATION_ERROR!>f<!>()
|
||||
w2.<!DEPRECATION!>f<!>()
|
||||
ew2.<!DEPRECATION!>f<!>()
|
||||
hew2.<!DEPRECATION!>f<!>()
|
||||
|
||||
explicitError.<!DEPRECATION_ERROR!>f<!>()
|
||||
}
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
package
|
||||
|
||||
package foo {
|
||||
public fun use(/*0*/ wd: foo.WarningDeprecated, /*1*/ ed: foo.ErrorDeprecated, /*2*/ hd: foo.HiddenDeprecated, /*3*/ we: foo.WE, /*4*/ wh: foo.WH, /*5*/ eh: foo.EH, /*6*/ nw: foo.NW, /*7*/ ne: foo.NE, /*8*/ nh: foo.NH, /*9*/ weh: foo.WEH, /*10*/ nweh: foo.NWEH, /*11*/ we2: foo.WE2, /*12*/ nwe2: foo.NWE2, /*13*/ nwe3: foo.NWE3, /*14*/ e2: foo.E2, /*15*/ w2: foo.W2, /*16*/ ew2: foo.EW2, /*17*/ hew2: foo.HEW2, /*18*/ explicitError: foo.ExplicitError): kotlin.Unit
|
||||
|
||||
public interface E2 : foo.ErrorDeprecated {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "") public open override /*1*/ /*fake_override*/ fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class EH : foo.ErrorDeprecated, foo.HiddenDeprecated {
|
||||
public constructor EH()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface EW2 : foo.E2, foo.W2 {
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface ErrorDeprecated {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "") public open fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface ExplicitError : foo.HEW2 {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "") public open override /*1*/ fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface HEW2 : foo.EW2, foo.HiddenDeprecated {
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface HiddenDeprecated {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public open fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class NE : foo.ErrorDeprecated, foo.NotDeprecated {
|
||||
public constructor NE()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class NH : foo.HiddenDeprecated, foo.NotDeprecated {
|
||||
public constructor NH()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class NW : foo.WarningDeprecated, foo.NotDeprecated {
|
||||
public constructor NW()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class NWE2 : foo.WE, foo.NotDeprecated {
|
||||
public constructor NWE2()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class NWE3 : foo.WE, foo.NotDeprecated {
|
||||
public constructor NWE3()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class NWEH : foo.NotDeprecated, foo.WarningDeprecated, foo.ErrorDeprecated, foo.HiddenDeprecated {
|
||||
public constructor NWEH()
|
||||
public open override /*4*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*4*/ fun f(): kotlin.Unit
|
||||
public open override /*4*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*4*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface NotDeprecated {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface W2 : foo.WarningDeprecated {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@kotlin.Deprecated(level = DeprecationLevel.WARNING, message = "") public open override /*1*/ /*fake_override*/ fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class WE : foo.WarningDeprecated, foo.ErrorDeprecated {
|
||||
public constructor WE()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class WE2 : foo.WE {
|
||||
public constructor WE2()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class WEH : foo.WarningDeprecated, foo.ErrorDeprecated, foo.HiddenDeprecated {
|
||||
public constructor WEH()
|
||||
public open override /*3*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*3*/ fun f(): kotlin.Unit
|
||||
public open override /*3*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*3*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class WH : foo.WarningDeprecated, foo.HiddenDeprecated {
|
||||
public constructor WH()
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ fun f(): kotlin.Unit
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface WarningDeprecated {
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
@kotlin.Deprecated(level = DeprecationLevel.WARNING, message = "") public open fun f(): kotlin.Unit
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// LANGUAGE: +StopPropagatingDeprecationThroughOverrides
|
||||
package foo
|
||||
|
||||
interface HiddenDeprecated {
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
// LANGUAGE: +StopPropagatingDeprecationThroughOverrides
|
||||
package foo
|
||||
|
||||
interface HiddenDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN)
|
||||
var p: Int
|
||||
}
|
||||
|
||||
interface NoDeprecation {
|
||||
var p: Int
|
||||
}
|
||||
|
||||
|
||||
open class WarningDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.WARNING)
|
||||
open var p: Int = 3
|
||||
}
|
||||
|
||||
open class ErrorDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
open var p: Int = 3
|
||||
}
|
||||
|
||||
open class GetterDeprecated {
|
||||
open var p: Int = 3
|
||||
@Deprecated("") get
|
||||
}
|
||||
|
||||
open class SetterDeprecated {
|
||||
open var p: Int = 3
|
||||
@Deprecated("") set
|
||||
}
|
||||
|
||||
class WD: WarningDeprecated() {
|
||||
override var <!OVERRIDE_DEPRECATION!>p<!>: Int
|
||||
get() = 3
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
class ED: ErrorDeprecated() {
|
||||
override var <!OVERRIDE_DEPRECATION!>p<!>: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class GD: GetterDeprecated() {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class SD: SetterDeprecated() {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class SDH: SetterDeprecated(), HiddenDeprecated {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class EDH: ErrorDeprecated(), HiddenDeprecated {
|
||||
override var <!OVERRIDE_DEPRECATION!>p<!>: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class NED: ErrorDeprecated(), NoDeprecation {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class Diff {
|
||||
@Deprecated("", level = DeprecationLevel.WARNING)
|
||||
var p: Int
|
||||
@Deprecated("", level = DeprecationLevel.ERROR) get() = 3
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN) set(value) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun use(
|
||||
warningDeprecated: WarningDeprecated, errorDeprecated: ErrorDeprecated, setterDeprecated: SetterDeprecated,
|
||||
getterDeprecated: GetterDeprecated, hiddenDeprecated: HiddenDeprecated,
|
||||
wd: WD, ed: ED, gd: GD, sd: SD,
|
||||
sdh: SDH, edh: EDH, ned: NED,
|
||||
diff: Diff
|
||||
) {
|
||||
warningDeprecated.<!DEPRECATION!>p<!>
|
||||
warningDeprecated.<!DEPRECATION!>p<!> = 1
|
||||
|
||||
errorDeprecated.<!DEPRECATION_ERROR!>p<!>
|
||||
errorDeprecated.<!DEPRECATION_ERROR!>p<!> = 1
|
||||
|
||||
getterDeprecated.<!DEPRECATION!>p<!>
|
||||
getterDeprecated.p = 1
|
||||
|
||||
setterDeprecated.p
|
||||
setterDeprecated.<!DEPRECATION!>p<!> = 1
|
||||
|
||||
hiddenDeprecated.<!UNRESOLVED_REFERENCE!>p<!>
|
||||
hiddenDeprecated.<!UNRESOLVED_REFERENCE!>p<!> = 1
|
||||
|
||||
wd.p
|
||||
wd.p = 1
|
||||
|
||||
ed.p
|
||||
ed.p = 1
|
||||
|
||||
gd.p
|
||||
gd.p = 1
|
||||
|
||||
sd.p
|
||||
sd.p = 1
|
||||
|
||||
sdh.p
|
||||
sdh.p = 1
|
||||
|
||||
edh.p
|
||||
edh.p = 1
|
||||
|
||||
ned.p
|
||||
ned.p = 1
|
||||
|
||||
diff.<!DEPRECATION!>p<!>
|
||||
diff.<!DEPRECATION, DEPRECATION_ERROR!>p<!> = 1
|
||||
}
|
||||
+136
@@ -0,0 +1,136 @@
|
||||
// LANGUAGE: -StopPropagatingDeprecationThroughOverrides
|
||||
package foo
|
||||
|
||||
interface HiddenDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN)
|
||||
var p: Int
|
||||
}
|
||||
|
||||
interface NoDeprecation {
|
||||
var p: Int
|
||||
}
|
||||
|
||||
|
||||
open class WarningDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.WARNING)
|
||||
open var p: Int = 3
|
||||
}
|
||||
|
||||
open class ErrorDeprecated {
|
||||
@Deprecated("", level = DeprecationLevel.ERROR)
|
||||
open var p: Int = 3
|
||||
}
|
||||
|
||||
open class GetterDeprecated {
|
||||
open var p: Int = 3
|
||||
@Deprecated("") get
|
||||
}
|
||||
|
||||
open class SetterDeprecated {
|
||||
open var p: Int = 3
|
||||
@Deprecated("") set
|
||||
}
|
||||
|
||||
class WD: WarningDeprecated() {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
class ED: ErrorDeprecated() {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class GD: GetterDeprecated() {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class SD: SetterDeprecated() {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class SDH: SetterDeprecated(), HiddenDeprecated {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class EDH: ErrorDeprecated(), HiddenDeprecated {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class NED: ErrorDeprecated(), NoDeprecation {
|
||||
override var p: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
}
|
||||
|
||||
class Diff {
|
||||
@Deprecated("", level = DeprecationLevel.WARNING)
|
||||
var p: Int
|
||||
@Deprecated("", level = DeprecationLevel.ERROR) get() = 3
|
||||
@Deprecated("", level = DeprecationLevel.HIDDEN) set(value) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun use(
|
||||
warningDeprecated: WarningDeprecated, errorDeprecated: ErrorDeprecated, setterDeprecated: SetterDeprecated,
|
||||
getterDeprecated: GetterDeprecated, hiddenDeprecated: HiddenDeprecated,
|
||||
wd: WD, ed: ED, gd: GD, sd: SD,
|
||||
sdh: SDH, edh: EDH, ned: NED,
|
||||
diff: Diff
|
||||
) {
|
||||
warningDeprecated.<!DEPRECATION!>p<!>
|
||||
warningDeprecated.p <!DEPRECATION!>=<!> 1
|
||||
|
||||
errorDeprecated.<!DEPRECATION_ERROR!>p<!>
|
||||
errorDeprecated.p <!DEPRECATION_ERROR!>=<!> 1
|
||||
|
||||
getterDeprecated.<!DEPRECATION!>p<!>
|
||||
getterDeprecated.p = 1
|
||||
|
||||
setterDeprecated.p
|
||||
setterDeprecated.p <!DEPRECATION!>=<!> 1
|
||||
|
||||
hiddenDeprecated.<!INVISIBLE_REFERENCE!>p<!>
|
||||
hiddenDeprecated.<!INVISIBLE_REFERENCE!>p<!> = 1
|
||||
|
||||
wd.p
|
||||
wd.p = 1
|
||||
|
||||
ed.p
|
||||
ed.p = 1
|
||||
|
||||
gd.p
|
||||
gd.p = 1
|
||||
|
||||
sd.p
|
||||
sd.p = 1
|
||||
|
||||
sdh.p
|
||||
sdh.p = 1
|
||||
|
||||
edh.p
|
||||
edh.p = 1
|
||||
|
||||
ned.p
|
||||
ned.p = 1
|
||||
|
||||
diff.<!DEPRECATION_ERROR!>p<!>
|
||||
diff.<!INVISIBLE_REFERENCE!>p<!> = 1
|
||||
}
|
||||
+4
-3
@@ -1,3 +1,4 @@
|
||||
// LANGUAGE: -StopPropagatingDeprecationThroughOverrides
|
||||
package foo
|
||||
|
||||
interface HiddenDeprecated {
|
||||
@@ -31,13 +32,13 @@ open class SetterDeprecated {
|
||||
}
|
||||
|
||||
class WD: WarningDeprecated() {
|
||||
override var p: Int
|
||||
override var <!OVERRIDE_DEPRECATION!>p<!>: Int
|
||||
get() = 3
|
||||
set(value) {}
|
||||
}
|
||||
|
||||
class ED: ErrorDeprecated() {
|
||||
override var p: Int
|
||||
override var <!OVERRIDE_DEPRECATION!>p<!>: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
@@ -65,7 +66,7 @@ class SDH: SetterDeprecated(), HiddenDeprecated {
|
||||
}
|
||||
|
||||
class EDH: ErrorDeprecated(), HiddenDeprecated {
|
||||
override var p: Int
|
||||
override var <!OVERRIDE_DEPRECATION!>p<!>: Int
|
||||
get() = 3
|
||||
set(value) {
|
||||
}
|
||||
+115
@@ -0,0 +1,115 @@
|
||||
package
|
||||
|
||||
package foo {
|
||||
public fun use(/*0*/ warningDeprecated: foo.WarningDeprecated, /*1*/ errorDeprecated: foo.ErrorDeprecated, /*2*/ setterDeprecated: foo.SetterDeprecated, /*3*/ getterDeprecated: foo.GetterDeprecated, /*4*/ hiddenDeprecated: foo.HiddenDeprecated, /*5*/ wd: foo.WD, /*6*/ ed: foo.ED, /*7*/ gd: foo.GD, /*8*/ sd: foo.SD, /*9*/ sdh: foo.SDH, /*10*/ edh: foo.EDH, /*11*/ ned: foo.NED, /*12*/ diff: foo.Diff): kotlin.Unit
|
||||
|
||||
public final class Diff {
|
||||
public constructor Diff()
|
||||
@kotlin.Deprecated(level = DeprecationLevel.WARNING, message = "") @get:kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "") @set:kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public final var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class ED : foo.ErrorDeprecated {
|
||||
public constructor ED()
|
||||
public open override /*1*/ var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class EDH : foo.ErrorDeprecated, foo.HiddenDeprecated {
|
||||
public constructor EDH()
|
||||
public open override /*2*/ var p: kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class ErrorDeprecated {
|
||||
public constructor ErrorDeprecated()
|
||||
@kotlin.Deprecated(level = DeprecationLevel.ERROR, message = "") public open var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class GD : foo.GetterDeprecated {
|
||||
public constructor GD()
|
||||
public open override /*1*/ var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class GetterDeprecated {
|
||||
public constructor GetterDeprecated()
|
||||
@get:kotlin.Deprecated(message = "") public open var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface HiddenDeprecated {
|
||||
@kotlin.Deprecated(level = DeprecationLevel.HIDDEN, message = "") public abstract var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class NED : foo.ErrorDeprecated, foo.NoDeprecation {
|
||||
public constructor NED()
|
||||
public open override /*2*/ var p: kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public interface NoDeprecation {
|
||||
public abstract var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class SD : foo.SetterDeprecated {
|
||||
public constructor SD()
|
||||
public open override /*1*/ var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class SDH : foo.SetterDeprecated, foo.HiddenDeprecated {
|
||||
public constructor SDH()
|
||||
public open override /*2*/ var p: kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*2*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*2*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class SetterDeprecated {
|
||||
public constructor SetterDeprecated()
|
||||
@set:kotlin.Deprecated(message = "") public open var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public final class WD : foo.WarningDeprecated {
|
||||
public constructor WD()
|
||||
public open override /*1*/ var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
|
||||
public open class WarningDeprecated {
|
||||
public constructor WarningDeprecated()
|
||||
@kotlin.Deprecated(level = DeprecationLevel.WARNING, message = "") public open var p: kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ interface WithDeprecation {
|
||||
}
|
||||
|
||||
class A : J(), WithDeprecation {
|
||||
override fun foo() {}
|
||||
override fun <!OVERRIDE_DEPRECATION!>foo<!>() {}
|
||||
}
|
||||
|
||||
fun main() {
|
||||
|
||||
@@ -58,13 +58,13 @@ interface I {
|
||||
}
|
||||
|
||||
<!ABSTRACT_MEMBER_NOT_IMPLEMENTED!>class X<!> : I {
|
||||
override fun foo1() {
|
||||
override fun <!OVERRIDE_DEPRECATION!>foo1<!>() {
|
||||
}
|
||||
}
|
||||
|
||||
class B : A(<!TYPE_MISMATCH!>""<!>) {
|
||||
// still can override it
|
||||
override fun memberFun() {
|
||||
override fun <!OVERRIDE_DEPRECATION!>memberFun<!>() {
|
||||
super.<!UNRESOLVED_REFERENCE!>memberFun<!>() // but cannot call super :)
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
|
||||
interface A : MutableCollection<String> {
|
||||
// Override of deprecated function could be marked as deprecated too
|
||||
override fun nonExistingMethod(x: String) = ""
|
||||
override fun <!OVERRIDE_DEPRECATION!>nonExistingMethod<!>(x: String) = ""
|
||||
}
|
||||
|
||||
fun foo(x: MutableCollection<Int>, y: Collection<String>, z: A) {
|
||||
|
||||
Reference in New Issue
Block a user