Report unmet trait requirements
#KT-3006 Fixed
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
open class Required
|
||||
|
||||
trait Trait : Required
|
||||
|
||||
abstract class <!UNMET_TRAIT_REQUIREMENT!>Abstract<!> : Trait
|
||||
|
||||
abstract class <!UNMET_TRAIT_REQUIREMENT!>AbstractDerived<!> : Abstract()
|
||||
+6
@@ -0,0 +1,6 @@
|
||||
open class Required
|
||||
|
||||
trait A : Required
|
||||
|
||||
val a = <!UNMET_TRAIT_REQUIREMENT!>object<!> : A {}
|
||||
val b: A = object : A, Required() {}
|
||||
@@ -0,0 +1,8 @@
|
||||
open class Generic<T>
|
||||
|
||||
trait A : Generic<Int>
|
||||
|
||||
trait B : Generic<String>
|
||||
|
||||
class <!UNMET_TRAIT_REQUIREMENT, UNMET_TRAIT_REQUIREMENT!>Y<!> : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>A, B<!>
|
||||
class Z : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>A, B, Generic<Int>()<!>
|
||||
@@ -0,0 +1,13 @@
|
||||
open class Base {
|
||||
}
|
||||
|
||||
trait Derived: Base {
|
||||
fun foo() {
|
||||
f1(this@Derived)
|
||||
}
|
||||
}
|
||||
|
||||
class <!UNMET_TRAIT_REQUIREMENT!>DerivedImpl()<!>: Derived {}
|
||||
object <!UNMET_TRAIT_REQUIREMENT!>ObjectImpl<!>: Derived {}
|
||||
|
||||
fun f1(b: Base) = b
|
||||
@@ -0,0 +1,4 @@
|
||||
open class A
|
||||
open class B
|
||||
|
||||
trait C : A, <!MANY_CLASSES_IN_SUPERTYPE_LIST!>B<!>
|
||||
@@ -0,0 +1,14 @@
|
||||
open class Required
|
||||
|
||||
trait A : Required
|
||||
|
||||
trait B : A, Required
|
||||
|
||||
trait C : Required
|
||||
|
||||
trait D : B, Required
|
||||
|
||||
class <!UNMET_TRAIT_REQUIREMENT, UNMET_TRAIT_REQUIREMENT, UNMET_TRAIT_REQUIREMENT!>W<!> : D
|
||||
class X : D, Required()
|
||||
class <!UNMET_TRAIT_REQUIREMENT, UNMET_TRAIT_REQUIREMENT, UNMET_TRAIT_REQUIREMENT, UNMET_TRAIT_REQUIREMENT!>Y<!> : C, D
|
||||
class Z : D, C, Required()
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
open class RequiredBase
|
||||
|
||||
trait Trait : RequiredBase
|
||||
|
||||
open class RequiredDerived : RequiredBase()
|
||||
|
||||
class <!UNMET_TRAIT_REQUIREMENT!>A<!> : Trait
|
||||
class B : Trait, RequiredDerived()
|
||||
@@ -0,0 +1,8 @@
|
||||
open class Required(val value: String)
|
||||
|
||||
trait First : Required
|
||||
|
||||
trait Second : First
|
||||
|
||||
class <!UNMET_TRAIT_REQUIREMENT!>Y<!> : Second
|
||||
class Z : Second, Required(":o)")
|
||||
@@ -0,0 +1,5 @@
|
||||
trait AnyTrait : Any
|
||||
|
||||
class Foo : AnyTrait
|
||||
|
||||
class Bar : AnyTrait, Any()
|
||||
@@ -0,0 +1,10 @@
|
||||
open class bar()
|
||||
|
||||
trait Foo<!CONSTRUCTOR_IN_TRAIT!>()<!> : bar<!SUPERTYPE_INITIALIZED_IN_TRAIT!>()<!>, <!MANY_CLASSES_IN_SUPERTYPE_LIST, SUPERTYPE_APPEARS_TWICE!>bar<!>, <!MANY_CLASSES_IN_SUPERTYPE_LIST, SUPERTYPE_APPEARS_TWICE!>bar<!> {
|
||||
}
|
||||
|
||||
trait Foo2 : bar, Foo {
|
||||
}
|
||||
|
||||
open class Foo1() : bar(), <!SUPERTYPE_NOT_INITIALIZED, MANY_CLASSES_IN_SUPERTYPE_LIST, SUPERTYPE_APPEARS_TWICE!>bar<!>, Foo, <!SUPERTYPE_APPEARS_TWICE!>Foo<!><!NO_CONSTRUCTOR!>()<!> {}
|
||||
open class Foo12 : bar(), <!SUPERTYPE_NOT_INITIALIZED, MANY_CLASSES_IN_SUPERTYPE_LIST, SUPERTYPE_APPEARS_TWICE!>bar<!> {}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
open class Generic<T>
|
||||
|
||||
trait A : Generic<String>
|
||||
|
||||
trait B : Generic<Int>
|
||||
|
||||
trait C : <!INCONSISTENT_TYPE_PARAMETER_VALUES!>A, B<!>
|
||||
Reference in New Issue
Block a user