KT-14274: resolve type alias constructors calls in supertypes list as type alias constructors.
Support @Deprecated for type aliases, including type alias constructors.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
@Deprecated("Deprecated class")
|
||||
open class DeprecatedClass
|
||||
|
||||
open class WithDeprecatedCtor(val x: Int) {
|
||||
@Deprecated("Deprecated constructor")
|
||||
constructor() : this(0)
|
||||
}
|
||||
|
||||
typealias DeprecatedClassAlias = <!DEPRECATION!>DeprecatedClass<!>
|
||||
typealias WithDeprecatedCtorAlias = WithDeprecatedCtor
|
||||
|
||||
class Test1 : <!DEPRECATION!>DeprecatedClassAlias<!>()
|
||||
|
||||
class Test2 : <!DEPRECATION!>WithDeprecatedCtorAlias<!>()
|
||||
@@ -0,0 +1,34 @@
|
||||
package
|
||||
|
||||
@kotlin.Deprecated(message = "Deprecated class") public open class DeprecatedClass {
|
||||
public constructor DeprecatedClass()
|
||||
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 Test1 : DeprecatedClassAlias /* = DeprecatedClass */ {
|
||||
public constructor Test1()
|
||||
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 Test2 : WithDeprecatedCtorAlias /* = WithDeprecatedCtor */ {
|
||||
public constructor Test2()
|
||||
public final override /*1*/ /*fake_override*/ val x: 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 WithDeprecatedCtor {
|
||||
@kotlin.Deprecated(message = "Deprecated constructor") public constructor WithDeprecatedCtor()
|
||||
public constructor WithDeprecatedCtor(/*0*/ x: kotlin.Int)
|
||||
public final val x: 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 typealias DeprecatedClassAlias = DeprecatedClass
|
||||
public typealias WithDeprecatedCtorAlias = WithDeprecatedCtor
|
||||
@@ -0,0 +1,24 @@
|
||||
open class Base {
|
||||
companion object
|
||||
}
|
||||
interface IFoo
|
||||
open class CG<T>
|
||||
interface IG<T>
|
||||
|
||||
@Deprecated("Obsolete")
|
||||
typealias Obsolete = Base
|
||||
|
||||
@Deprecated("Obsolete")
|
||||
typealias IObsolete = IFoo
|
||||
|
||||
fun test1(x: <!DEPRECATION!>Obsolete<!>) = x
|
||||
fun test1a(x: List<<!DEPRECATION!>Obsolete<!>>) = x
|
||||
|
||||
val test2 = <!DEPRECATION!>Obsolete<!>()
|
||||
|
||||
val test3 = <!DEPRECATION!>Obsolete<!>
|
||||
|
||||
class Test4: <!DEPRECATION!>Obsolete<!>()
|
||||
class Test4a: <!DEPRECATION!>IObsolete<!>
|
||||
class Test4b: IG<<!DEPRECATION!>Obsolete<!>>
|
||||
class Test4c: CG<<!DEPRECATION!>Obsolete<!>>()
|
||||
@@ -0,0 +1,69 @@
|
||||
package
|
||||
|
||||
public val test2: Base
|
||||
public val test3: Base.Companion
|
||||
public fun test1(/*0*/ x: Obsolete /* = Base */): Obsolete /* = Base */
|
||||
public fun test1a(/*0*/ x: kotlin.collections.List<Obsolete /* = Base */>): kotlin.collections.List<Obsolete /* = Base */>
|
||||
|
||||
public open class Base {
|
||||
public constructor Base()
|
||||
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 companion object Companion {
|
||||
private constructor Companion()
|
||||
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 CG</*0*/ T> {
|
||||
public constructor CG</*0*/ T>()
|
||||
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 IFoo {
|
||||
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 IG</*0*/ T> {
|
||||
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 Test4 : Obsolete /* = Base */ {
|
||||
public constructor Test4()
|
||||
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 Test4a : IObsolete /* = IFoo */ {
|
||||
public constructor Test4a()
|
||||
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 Test4b : IG<Obsolete /* = Base */> {
|
||||
public constructor Test4b()
|
||||
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 Test4c : CG<Obsolete /* = Base */> {
|
||||
public constructor Test4c()
|
||||
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
|
||||
}
|
||||
@kotlin.Deprecated(message = "Obsolete") public typealias IObsolete = IFoo
|
||||
@kotlin.Deprecated(message = "Obsolete") public typealias Obsolete = Base
|
||||
+1
-1
@@ -19,7 +19,7 @@ val test3a = MyClass(1.0)
|
||||
class MyDerived : MyClass(1.0) {
|
||||
val test4 = <!NONE_APPLICABLE!>MyAlias<!>(1)
|
||||
val test4a = <!NONE_APPLICABLE!>MyClass<!>(1)
|
||||
val test5 = <!NONE_APPLICABLE!>MyAlias<!>("")
|
||||
val test5 = <!PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL!>MyAlias<!>("")
|
||||
val test5a = <!PROTECTED_CONSTRUCTOR_NOT_IN_SUPER_CALL!>MyClass<!>("")
|
||||
val test6 = MyAlias(1.0)
|
||||
val test6a = MyClass(1.0)
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@ public final class MyDerived : MyClass {
|
||||
public constructor MyDerived()
|
||||
public final val test4: [ERROR : Type for MyAlias(1)]
|
||||
public final val test4a: [ERROR : Type for MyClass(1)]
|
||||
public final val test5: [ERROR : Type for MyAlias("")]
|
||||
public final val test5: MyClass
|
||||
public final val test5a: MyClass
|
||||
public final val test6: MyClass
|
||||
public final val test6a: MyClass
|
||||
|
||||
Reference in New Issue
Block a user