[Commonizer] Classifiers tests

This commit is contained in:
Dmitriy Dolovov
2019-09-20 12:38:30 +07:00
parent 1a49d88578
commit acd146363e
84 changed files with 4861 additions and 241 deletions
@@ -92,8 +92,12 @@ class CommonizedClassDescriptor(
if (isExpect && kind.isSingleton) {
check(constructors.isEmpty())
primaryConstructor = createPrimaryConstructorForObject(this, SourceElement.NO_SOURCE).apply { returnType = getDefaultType() }
this.constructors = listOf(primaryConstructor!!)
primaryConstructor = if (kind == ClassKind.ENUM_ENTRY)
createPrimaryConstructorForObject(this, SourceElement.NO_SOURCE).apply { returnType = getDefaultType() }
else
null
this.constructors = listOfNotNull(primaryConstructor)
} else {
constructors.forEach { it.returnType = getDefaultType() }
@@ -40,8 +40,8 @@ class CommonizedTypeAliasDescriptor(
override fun isActual() = isActual
fun initialize(underlyingType: SimpleType, expandedType: SimpleType) {
super.initialize(emptyList())
fun initialize(declaredTypeParameters: List<TypeParameterDescriptor>, underlyingType: SimpleType, expandedType: SimpleType) {
super.initialize(declaredTypeParameters)
this.underlyingType = underlyingType
this.expandedType = expandedType
typeConstructorParameters = computeConstructorTypeParameters()
@@ -60,6 +60,7 @@ class CommonizedTypeAliasDescriptor(
isActual = isActual
)
substituted.initialize(
declaredTypeParameters,
substitutor.safeSubstitute(underlyingType, Variance.INVARIANT).asSimpleType(),
substitutor.safeSubstitute(expandedType, Variance.INVARIANT).asSimpleType()
)
@@ -5,10 +5,7 @@
package org.jetbrains.kotlin.descriptors.commonizer.builder
import org.jetbrains.kotlin.descriptors.ClassConstructorDescriptor
import org.jetbrains.kotlin.descriptors.ClassDescriptor
import org.jetbrains.kotlin.descriptors.ClassifierDescriptorWithTypeParameters
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.commonizer.CommonizedGroup
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.*
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.indexOfCommon
@@ -20,9 +17,10 @@ internal fun ClassNode.buildDescriptors(
storageManager: StorageManager
) {
val commonClass = common()
val markAsActual = commonClass != null && commonClass.kind != ClassKind.ENUM_ENTRY
target.forEachIndexed { index, clazz ->
clazz?.buildDescriptor(output, index, containingDeclarations, storageManager, isActual = commonClass != null)
clazz?.buildDescriptor(output, index, containingDeclarations, storageManager, isActual = markAsActual)
}
commonClass?.buildDescriptor(output, indexOfCommon, containingDeclarations, storageManager, isExpect = true)
@@ -67,13 +65,13 @@ internal fun ClassConstructorNode.buildDescriptors(
containingDeclarations: List<ClassDescriptor?>
) {
val commonConstructor = common()
val markAsActual = commonConstructor != null
target.forEachIndexed { index, constructor ->
constructor?.buildDescriptor(output, index, containingDeclarations, isActual = commonConstructor != null)
constructor?.buildDescriptor(output, index, containingDeclarations, isActual = markAsActual)
}
commonConstructor?.buildDescriptor(output, indexOfCommon, containingDeclarations, isExpect = true)
}
private fun ClassConstructor.buildDescriptor(
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.descriptors.commonizer.builder
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
import org.jetbrains.kotlin.descriptors.SourceElement
@@ -19,12 +20,13 @@ internal fun FunctionNode.buildDescriptors(
containingDeclarations: List<DeclarationDescriptor?>
) {
val commonFunction = common()
val markAsExpectAndActual = commonFunction != null && commonFunction.kind != CallableMemberDescriptor.Kind.SYNTHESIZED
target.forEachIndexed { index, function ->
function?.buildDescriptor(output, index, containingDeclarations, isActual = commonFunction != null)
function?.buildDescriptor(output, index, containingDeclarations, isActual = markAsExpectAndActual)
}
commonFunction?.buildDescriptor(output, indexOfCommon, containingDeclarations, isExpect = true)
commonFunction?.buildDescriptor(output, indexOfCommon, containingDeclarations, isExpect = markAsExpectAndActual)
}
private fun Function.buildDescriptor(
@@ -5,6 +5,7 @@
package org.jetbrains.kotlin.descriptors.commonizer.builder
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.DeclarationDescriptor
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.SourceElement
@@ -23,12 +24,16 @@ internal fun PropertyNode.buildDescriptors(
storageManager: StorageManager
) {
val commonProperty = common()
val markAsExpectAndActual = commonProperty != null && commonProperty.kind != CallableMemberDescriptor.Kind.SYNTHESIZED
target.forEachIndexed { index, property ->
property?.buildDescriptor(output, index, containingDeclarations, storageManager, isActual = commonProperty != null)
// target property is DELEGATION
// AND
// the property it overrides is actual
property?.buildDescriptor(output, index, containingDeclarations, storageManager, isActual = markAsExpectAndActual)
}
commonProperty?.buildDescriptor(output, indexOfCommon, containingDeclarations, storageManager, isExpect = true)
commonProperty?.buildDescriptor(output, indexOfCommon, containingDeclarations, storageManager, isExpect = markAsExpectAndActual)
}
private fun Property.buildDescriptor(
@@ -20,9 +20,10 @@ internal fun TypeAliasNode.buildDescriptors(
storageManager: StorageManager
) {
val commonClass: ClassDeclaration? = common()
val markAsActual = commonClass != null
target.forEachIndexed { index, typeAlias ->
typeAlias?.buildDescriptor(output, index, containingDeclarations, storageManager, isActual = commonClass != null)
typeAlias?.buildDescriptor(output, index, containingDeclarations, storageManager, isActual = markAsActual)
}
commonClass?.buildDescriptor(output, indexOfCommon, containingDeclarations, storageManager, isExpect = true)
@@ -46,7 +47,11 @@ private fun TypeAlias.buildDescriptor(
isActual = isActual
)
typeAliasDescriptor.initialize(underlyingType, expandedType)
typeAliasDescriptor.initialize(
declaredTypeParameters = typeParameters.buildDescriptors(typeAliasDescriptor),
underlyingType = underlyingType,
expandedType = expandedType
)
output[index] = typeAliasDescriptor
}
@@ -5,8 +5,12 @@
package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.DELEGATION
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor.Kind.SYNTHESIZED
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.ClassifiersCache
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.FunctionOrProperty
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.isNonAbstractMemberInInterface
import org.jetbrains.kotlin.name.Name
abstract class AbstractFunctionOrPropertyCommonizer<T : FunctionOrProperty>(cache: ClassifiersCache) : AbstractStandardCommonizer<T, T>() {
@@ -15,14 +19,19 @@ abstract class AbstractFunctionOrPropertyCommonizer<T : FunctionOrProperty>(cach
protected val visibility = VisibilityCommonizer.lowering()
protected val extensionReceiver = ExtensionReceiverCommonizer.default(cache)
protected val returnType = TypeCommonizer.default(cache)
protected lateinit var kind: CallableMemberDescriptor.Kind
protected val typeParameters = TypeParameterListCommonizer.default(cache)
override fun initialize(first: T) {
name = first.name
kind = first.kind
}
override fun doCommonizeWith(next: T) =
!next.isNonAbstractCallableMemberInInterface // non-abstract callable members declared in interface can't be commonized
override fun doCommonizeWith(next: T): Boolean =
!next.isNonAbstractMemberInInterface() // non-abstract callable members declared in interface can't be commonized
&& next.kind != DELEGATION // delegated members should not be commonized
&& (next.kind != SYNTHESIZED || next.containingClassIsData != true) // synthesized members of data classes should not be commonized
&& kind == next.kind
&& modality.commonizeWith(next.modality)
&& visibility.commonizeWith(next)
&& extensionReceiver.commonizeWith(next.extensionReceiver)
@@ -41,7 +41,7 @@ abstract class AbstractListCommonizer<T, R>(
if (commonizers.size != next.size) // lists must be of the same size
error = true
else
for (index in 0 until next.size) {
for (index in next.indices) {
val commonizer = commonizers[index]
val nextElement = next[index]
@@ -45,7 +45,6 @@ class ClassCommonizer(cache: ClassifiersCache) : AbstractStandardCommonizer<Clas
&& isInner == next.isInner
&& isInline == next.isInline
&& isCompanion == next.isCompanion
&& next.sealedSubclasses.isEmpty() // commonization of sealed classes is not supported, but their subclasses can be commonized
&& modality.commonizeWith(next.modality)
&& visibility.commonizeWith(next)
&& typeParameters.commonizeWith(next.typeParameters)
@@ -6,6 +6,7 @@
package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.CallableMemberDescriptor
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.ClassConstructor
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.ClassifiersCache
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.CommonClassConstructor
@@ -35,7 +36,9 @@ class ClassConstructorCommonizer(cache: ClassifiersCache) : AbstractStandardComm
}
override fun doCommonizeWith(next: ClassConstructor): Boolean {
val result = isPrimary == next.isPrimary
val result = !next.containingClassKind.isSingleton // don't commonize constructors for objects and enum entries
&& next.containingClassModality != Modality.SEALED // don't commonize constructors for sealed classes (not not their subclasses)
&& isPrimary == next.isPrimary
&& kind == next.kind
&& visibility.commonizeWith(next)
&& typeParameters.commonizeWith(next.typeParameters)
@@ -22,6 +22,7 @@ class FunctionCommonizer(cache: ClassifiersCache) : AbstractFunctionOrPropertyCo
visibility = visibility.result,
extensionReceiver = extensionReceiver.result?.toReceiverNoAnnotations(),
returnType = returnType.result,
kind = kind,
modifiers = modifiers.result,
valueParameters = valueParameters.result,
typeParameters = typeParameters.result,
@@ -14,61 +14,27 @@ interface ModalityCommonizer : Commonizer<Modality, Modality> {
}
private class DefaultModalityCommonizer : ModalityCommonizer {
private enum class State {
EMPTY {
override fun getNext(modality: Modality) = when (modality) {
Modality.ABSTRACT -> CAN_HAVE_ONLY_ABSTRACT
Modality.SEALED -> CAN_HAVE_ONLY_SEALED
Modality.FINAL -> HAS_FINAL
Modality.OPEN -> HAS_OPEN
}
},
ERROR {
override fun getNext(modality: Modality) = ERROR
},
CAN_HAVE_ONLY_SEALED {
override fun getNext(modality: Modality) = if (modality == Modality.SEALED) this else ERROR
},
CAN_HAVE_ONLY_ABSTRACT {
override fun getNext(modality: Modality) = if (modality == Modality.ABSTRACT) this else ERROR
},
HAS_FINAL {
override fun getNext(modality: Modality) = when (modality) {
Modality.FINAL -> this
Modality.OPEN -> HAS_FINAL_AND_OPEN
else -> ERROR
}
},
HAS_OPEN {
override fun getNext(modality: Modality) = when (modality) {
Modality.FINAL -> HAS_FINAL_AND_OPEN
Modality.OPEN -> this
else -> ERROR
}
},
HAS_FINAL_AND_OPEN {
override fun getNext(modality: Modality) = when (modality) {
Modality.FINAL, Modality.OPEN -> this
else -> ERROR
}
};
abstract fun getNext(modality: Modality): State
}
private var state = State.EMPTY
private var temp: Modality? = null
private var error = false
override val result: Modality
get() = when (state) {
State.CAN_HAVE_ONLY_SEALED -> Modality.SEALED
State.CAN_HAVE_ONLY_ABSTRACT -> Modality.ABSTRACT
State.HAS_FINAL, State.HAS_FINAL_AND_OPEN -> Modality.FINAL
State.HAS_OPEN -> Modality.OPEN
else -> throw IllegalCommonizerStateException()
}
get() = temp?.takeIf { !error } ?: throw IllegalCommonizerStateException()
override fun commonizeWith(next: Modality): Boolean {
state = state.getNext(next)
return state != State.ERROR
if (error)
return false
val temp = temp
this.temp = if (temp != null) getNext(temp, next) else next
error = this.temp == null
return !error
}
private fun getNext(current: Modality, next: Modality): Modality? = when {
current == Modality.FINAL && next == Modality.OPEN -> Modality.FINAL
current == Modality.OPEN && next == Modality.FINAL -> Modality.FINAL
current == next -> current
else -> null
}
}
@@ -21,6 +21,7 @@ class PropertyCommonizer(cache: ClassifiersCache) : AbstractFunctionOrPropertyCo
isExternal = isExternal,
extensionReceiver = extensionReceiver.result?.toReceiverNoAnnotations(),
returnType = returnType.result,
kind = kind,
setter = setter.result,
typeParameters = typeParameters.result
)
@@ -7,7 +7,8 @@ package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.DeclarationWithVisibility
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.MaybeVirtualCallableMember
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.FunctionOrProperty
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.isVirtual
abstract class VisibilityCommonizer(private val allowPrivate: Boolean) : Commonizer<DeclarationWithVisibility, Visibility> {
@@ -19,9 +20,7 @@ abstract class VisibilityCommonizer(private val allowPrivate: Boolean) : Commoni
private var temp: Visibility? = null
override val result: Visibility
get() {
return temp?.takeIf { it != Visibilities.UNKNOWN } ?: throw IllegalCommonizerStateException()
}
get() = temp?.takeIf { it != Visibilities.UNKNOWN } ?: throw IllegalCommonizerStateException()
override fun commonizeWith(next: DeclarationWithVisibility): Boolean {
if (temp == Visibilities.UNKNOWN)
@@ -52,7 +51,7 @@ private class LoweringVisibilityCommonizer(allowPrivate: Boolean) : VisibilityCo
override fun canBeCommonized(next: DeclarationWithVisibility): Boolean {
if (!atLeastOneVirtualCallableMet)
atLeastOneVirtualCallableMet = (next as? MaybeVirtualCallableMember)?.isVirtual == true
atLeastOneVirtualCallableMet = (next as? FunctionOrProperty)?.isVirtual() == true
return !atLeastOneVirtualCallableMet || !atLeastTwoVisibilitiesMet
}
@@ -12,11 +12,6 @@ import org.jetbrains.kotlin.descriptors.commonizer.core.CommonizationVisitor
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.mergeRoots
import org.jetbrains.kotlin.storage.LockBasedStorageManager
class CommonizationSession {
// TODO (???): add progress tracker
// TODO (???): add logger
}
class CommonizationParameters {
private val modulesByTargets = LinkedHashMap<ConcreteTargetId, Collection<ModuleDescriptor>>()
@@ -13,22 +13,23 @@ import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.types.KotlinType
import kotlin.LazyThreadSafetyMode.PUBLICATION
interface ClassDeclaration : AnnotatedDeclaration, NamedDeclaration, DeclarationWithTypeParameters, DeclarationWithVisibility {
interface ClassDeclaration : AnnotatedDeclaration, NamedDeclaration, DeclarationWithTypeParameters, DeclarationWithVisibility, DeclarationWithModality {
val companion: FqName? // null means no companion object
val kind: ClassKind
val modality: Modality
val isCompanion: Boolean
val isData: Boolean
val isInline: Boolean
val isInner: Boolean
val isExternal: Boolean
val sealedSubclasses: Collection<FqName>
val supertypes: Collection<KotlinType>
}
interface ClassConstructor : AnnotatedDeclaration, DeclarationWithTypeParameters, DeclarationWithVisibility, CallableMemberWithParameters {
interface ClassConstructor : AnnotatedDeclaration, DeclarationWithTypeParameters, DeclarationWithVisibility, MaybeCallableMemberOfClass, CallableMemberWithParameters {
val isPrimary: Boolean
val kind: CallableMemberDescriptor.Kind
override val containingClassKind: ClassKind
override val containingClassModality: Modality
override val containingClassIsData: Boolean
}
data class CommonClassDeclaration(
@@ -45,7 +46,6 @@ data class CommonClassDeclaration(
override val isData get() = false
override val isExternal get() = false
override var companion: FqName? = null
override val sealedSubclasses: Collection<FqName> get() = emptyList()
override val supertypes: MutableCollection<KotlinType> = ArrayList()
}
@@ -59,6 +59,9 @@ data class CommonClassConstructor(
override val hasSynthesizedParameterNames: Boolean
) : ClassConstructor {
override val annotations: Annotations get() = Annotations.EMPTY
override val containingClassKind: ClassKind get() = unsupported()
override val containingClassModality: Modality get() = unsupported()
override val containingClassIsData: Boolean get() = unsupported()
}
class TargetClassDeclaration(private val descriptor: ClassDescriptor) : ClassDeclaration {
@@ -74,13 +77,15 @@ class TargetClassDeclaration(private val descriptor: ClassDescriptor) : ClassDec
override val isInline get() = descriptor.isInline
override val isInner get() = descriptor.isInner
override val isExternal get() = descriptor.isExternal
override val sealedSubclasses by lazy(PUBLICATION) { descriptor.sealedSubclasses.map { it.fqNameSafe } }
override val supertypes: Collection<KotlinType> get() = descriptor.typeConstructor.supertypes
}
class TargetClassConstructor(private val descriptor: ClassConstructorDescriptor) : ClassConstructor {
override val isPrimary: Boolean get() = descriptor.isPrimary
override val kind: CallableMemberDescriptor.Kind get() = descriptor.kind
override val containingClassKind: ClassKind get() = descriptor.containingDeclaration.kind
override val containingClassModality: Modality get() = descriptor.containingDeclaration.modality
override val containingClassIsData: Boolean get() = descriptor.containingDeclaration.isData
override val annotations: Annotations get() = descriptor.annotations
override val visibility: Visibility get() = descriptor.visibility
override val typeParameters: List<TypeParameter> by lazy(PUBLICATION) { descriptor.typeParameters.map(::TargetTypeParameter) }
@@ -98,7 +103,6 @@ object ClassDeclarationRecursionMarker : ClassDeclaration, RecursionMarker {
override val isInline: Boolean get() = unsupported()
override val isInner: Boolean get() = unsupported()
override val isExternal: Boolean get() = unsupported()
override val sealedSubclasses: Collection<FqName> get() = unsupported()
override val supertypes: Collection<KotlinType> get() = unsupported()
override val annotations: Annotations get() = unsupported()
override val name: Name get() = unsupported()
@@ -36,8 +36,14 @@ interface DeclarationWithVisibility : Declaration {
val visibility: Visibility
}
interface MaybeVirtualCallableMember : DeclarationWithVisibility {
val isVirtual: Boolean
interface DeclarationWithModality : Declaration {
val modality: Modality
}
interface MaybeCallableMemberOfClass : Declaration {
val containingClassKind: ClassKind? // null assumes no containing class
val containingClassModality: Modality? // null assumes no containing class
val containingClassIsData: Boolean? // null assumes no containing class
}
interface DeclarationWithTypeParameters : Declaration {
@@ -47,5 +53,5 @@ interface DeclarationWithTypeParameters : Declaration {
/** Indicates presence of recursion in lazy calculations. */
interface RecursionMarker : Declaration
@Suppress("unused")
internal fun Declaration.unsupported(): Nothing = error("This method should never be called")
@Suppress("unused", "NOTHING_TO_INLINE")
internal inline fun Declaration.unsupported(): Nothing = error("This method should never be called")
@@ -5,10 +5,7 @@
package org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir
import org.jetbrains.kotlin.descriptors.Modality
import org.jetbrains.kotlin.descriptors.SimpleFunctionDescriptor
import org.jetbrains.kotlin.descriptors.ValueParameterDescriptor
import org.jetbrains.kotlin.descriptors.Visibility
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.UnwrappedType
@@ -37,6 +34,7 @@ data class CommonFunction(
override val visibility: Visibility,
override val extensionReceiver: ExtensionReceiver?,
override val returnType: UnwrappedType,
override val kind: CallableMemberDescriptor.Kind,
private val modifiers: FunctionModifiers,
override val valueParameters: List<ValueParameter>,
override val typeParameters: List<TypeParameter>,
@@ -11,20 +11,18 @@ import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.ExtensionReceiv
import org.jetbrains.kotlin.types.UnwrappedType
import kotlin.LazyThreadSafetyMode.PUBLICATION
interface FunctionOrProperty : AnnotatedDeclaration, NamedDeclaration, DeclarationWithTypeParameters, MaybeVirtualCallableMember {
val modality: Modality
interface FunctionOrProperty : AnnotatedDeclaration, NamedDeclaration, DeclarationWithTypeParameters, DeclarationWithVisibility, DeclarationWithModality, MaybeCallableMemberOfClass {
val isExternal: Boolean
val extensionReceiver: ExtensionReceiver?
val returnType: UnwrappedType
val kind: CallableMemberDescriptor.Kind
val isNonAbstractCallableMemberInInterface: Boolean
}
abstract class CommonFunctionOrProperty : FunctionOrProperty {
final override val annotations get() = Annotations.EMPTY
final override val kind get() = CallableMemberDescriptor.Kind.DECLARATION
final override val isVirtual get() = unsupported()
final override val isNonAbstractCallableMemberInInterface get() = unsupported()
final override val containingClassKind: ClassKind? get() = unsupported()
final override val containingClassModality: Modality? get() = unsupported()
final override val containingClassIsData: Boolean? get() = unsupported()
}
abstract class TargetFunctionOrProperty<T : CallableMemberDescriptor>(protected val descriptor: T) : FunctionOrProperty {
@@ -36,10 +34,11 @@ abstract class TargetFunctionOrProperty<T : CallableMemberDescriptor>(protected
final override val extensionReceiver by lazy(PUBLICATION) { descriptor.extensionReceiverParameter?.toReceiver() }
final override val returnType by lazy(PUBLICATION) { descriptor.returnType!!.unwrap() }
final override val kind get() = descriptor.kind
final override val isVirtual get() = descriptor.isOverridable
final override val isNonAbstractCallableMemberInInterface
get() = modality != Modality.ABSTRACT && (descriptor.containingDeclaration as? ClassDescriptor)?.kind == ClassKind.INTERFACE
final override val containingClassKind: ClassKind? get() = containingClass?.kind
final override val containingClassModality: Modality? get() = containingClass?.modality
final override val containingClassIsData: Boolean? get() = containingClass?.isData
final override val typeParameters by lazy(PUBLICATION) { descriptor.typeParameters.map(::TargetTypeParameter) }
private val containingClass: ClassDescriptor? get() = descriptor.containingDeclaration as? ClassDescriptor
}
data class ExtensionReceiver(
@@ -51,3 +50,11 @@ data class ExtensionReceiver(
fun ReceiverParameterDescriptor.toReceiver() = ExtensionReceiver(annotations, type.unwrap())
}
}
fun FunctionOrProperty.isNonAbstractMemberInInterface() =
modality != Modality.ABSTRACT && containingClassKind == ClassKind.INTERFACE
fun FunctionOrProperty.isVirtual() =
visibility != Visibilities.PRIVATE
&& modality != Modality.FINAL
&& !(containingClassModality == Modality.FINAL && containingClassKind != ClassKind.ENUM_CLASS)
@@ -33,6 +33,7 @@ data class CommonProperty(
override val isExternal: Boolean,
override val extensionReceiver: ExtensionReceiver?,
override val returnType: UnwrappedType,
override val kind: CallableMemberDescriptor.Kind,
override val setter: Setter?,
override val typeParameters: List<TypeParameter>
) : CommonFunctionOrProperty(), Property {
@@ -89,9 +90,7 @@ data class Setter(
override val isDefault: Boolean,
override val isExternal: Boolean,
override val isInline: Boolean
) : PropertyAccessor, MaybeVirtualCallableMember {
override val isVirtual get() = false
) : PropertyAccessor, DeclarationWithVisibility {
companion object {
fun createDefaultNoAnnotations(visibility: Visibility) = Setter(
Annotations.EMPTY,
@@ -24,9 +24,9 @@ actual val <T> T.propertyWithTypeParameter1 get() = 42
actual val <T> T.propertyWithTypeParameter2 get() = 42
val <T> T.propertyWithTypeParameter3 get() = 42
actual val <T : CharSequence> T.propertyWithTypeParameter4 get() = length
val <T : CharSequence> T.propertyWithTypeParameter5 get() = length
val <T : CharSequence> T.propertyWithTypeParameter6 get() = length
val <T : CharSequence> T.propertyWithTypeParameter7 get() = length
val <T : CharSequence> T.propertyWithTypeParameter5: Int get() = length
val <T : CharSequence> T.propertyWithTypeParameter6: Int get() = length
val <T : CharSequence> T.propertyWithTypeParameter7: Int get() = length
val <T> T.propertyWithTypeParameter8 get() = 42
val <T> T.propertyWithTypeParameter9 get() = 42
@@ -24,9 +24,9 @@ actual val <T> T.propertyWithTypeParameter1 get() = 42
actual val <T : Any?> T.propertyWithTypeParameter2 get() = 42
val <T : Any> T.propertyWithTypeParameter3 get() = 42
actual val <T : CharSequence> T.propertyWithTypeParameter4 get() = length
val <T : Appendable> T.propertyWithTypeParameter5 get() = length
val <T : String> T.propertyWithTypeParameter6 get() = length
val String.propertyWithTypeParameter7 get() = length
val <T : Appendable> T.propertyWithTypeParameter5: Int get() = length
val <T : String> T.propertyWithTypeParameter6: Int get() = length
val String.propertyWithTypeParameter7: Int get() = length
val <Q> Q.propertyWithTypeParameter8 get() = 42
val <T, Q> T.propertyWithTypeParameter9 get() = 42
@@ -23,10 +23,10 @@ fun mismatchedFunction2() = 42
val <T> T.propertyWithTypeParameter1 get() = 42
val <T> T.propertyWithTypeParameter2 get() = 42
val <T> T.propertyWithTypeParameter3 get() = 42
val <T : CharSequence> T.propertyWithTypeParameter4 get() = length
val <T : CharSequence> T.propertyWithTypeParameter5 get() = length
val <T : CharSequence> T.propertyWithTypeParameter6 get() = length
val <T : CharSequence> T.propertyWithTypeParameter7 get() = length
val <T : CharSequence> T.propertyWithTypeParameter4: Int get() = length
val <T : CharSequence> T.propertyWithTypeParameter5: Int get() = length
val <T : CharSequence> T.propertyWithTypeParameter6: Int get() = length
val <T : CharSequence> T.propertyWithTypeParameter7: Int get() = length
val <T> T.propertyWithTypeParameter8 get() = 42
val <T> T.propertyWithTypeParameter9 get() = 42
@@ -23,10 +23,10 @@ fun Double.mismatchedFunction2() = 42
val <T> T.propertyWithTypeParameter1 get() = 42
val <T : Any?> T.propertyWithTypeParameter2 get() = 42
val <T : Any> T.propertyWithTypeParameter3 get() = 42
val <T : CharSequence> T.propertyWithTypeParameter4 get() = length
val <T : Appendable> T.propertyWithTypeParameter5 get() = length
val <T : String> T.propertyWithTypeParameter6 get() = length
val String.propertyWithTypeParameter7 get() = length
val <T : CharSequence> T.propertyWithTypeParameter4: Int get() = length
val <T : Appendable> T.propertyWithTypeParameter5: Int get() = length
val <T : String> T.propertyWithTypeParameter6: Int get() = length
val String.propertyWithTypeParameter7: Int get() = length
val <Q> Q.propertyWithTypeParameter8 get() = 42
val <T, Q> T.propertyWithTypeParameter9 get() = 42
@@ -3,5 +3,41 @@ expect internal val publicOrInternalProperty: Int
expect internal val internalProperty: Int
expect public fun publicFunction(): Int
expect internal val internalFunction(): Int
expect internal fun publicOrInternalFunction(): Int
expect internal fun internalFunction(): Int
expect open class Outer1() {
public val publicProperty: Int
internal val publicOrInternalProperty: Int
internal val internalProperty: Int
public fun publicFunction(): Int
internal fun publicOrInternalFunction(): Int
internal fun internalFunction(): Int
open class Inner1() {
public val publicProperty: Int
internal val publicOrInternalProperty: Int
internal val internalProperty: Int
public fun publicFunction(): Int
internal fun publicOrInternalFunction(): Int
internal fun internalFunction(): Int
}
}
expect open class Outer2() {
public open val publicProperty: Int
internal open val internalProperty: Int
public open fun publicFunction(): Int
internal open fun internalFunction(): Int
open class Inner2() {
public open val publicProperty: Int
internal open val internalProperty: Int
public open fun publicFunction(): Int
internal open fun internalFunction(): Int
}
}
@@ -6,6 +6,62 @@ private val privateProperty = 1
actual public fun publicFunction() = 1
actual public fun publicOrInternalFunction() = 1
actual internal val internalFunction() = 1
internal val internalOrPrivateFunction() = 1
private val privateFunction() = 1
actual internal fun internalFunction() = 1
internal fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
actual open class Outer1 actual constructor() {
actual public val publicProperty = 1
actual public val publicOrInternalProperty = 1
actual internal val internalProperty = 1
internal val internalOrPrivateProperty = 1
private val privateProperty = 1
actual public fun publicFunction() = 1
actual public fun publicOrInternalFunction() = 1
actual internal fun internalFunction() = 1
internal fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
actual open class Inner1 actual constructor() {
actual public val publicProperty = 1
actual public val publicOrInternalProperty = 1
actual internal val internalProperty = 1
internal val internalOrPrivateProperty = 1
private val privateProperty = 1
actual public fun publicFunction() = 1
actual public fun publicOrInternalFunction() = 1
actual internal fun internalFunction() = 1
internal fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
}
}
actual open class Outer2 actual constructor() {
actual public open val publicProperty = 1
public open val publicOrInternalProperty = 1
actual internal open val internalProperty = 1
internal open val internalOrPrivateProperty = 1
private val privateProperty = 1
actual public open fun publicFunction() = 1
public open fun publicOrInternalFunction() = 1
actual internal open fun internalFunction() = 1
internal open fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
actual open class Inner2 actual constructor() {
actual public open val publicProperty = 1
public open val publicOrInternalProperty = 1
actual internal open val internalProperty = 1
internal open val internalOrPrivateProperty = 1
private val privateProperty = 1
actual public open fun publicFunction() = 1
public open fun publicOrInternalFunction() = 1
actual internal open fun internalFunction() = 1
internal open fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
}
}
@@ -6,6 +6,62 @@ private val privateProperty = 1
actual public fun publicFunction() = 1
actual internal fun publicOrInternalFunction() = 1
actual internal val internalFunction() = 1
private val internalOrPrivateFunction() = 1
private val privateFunction() = 1
actual internal fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
actual open class Outer1 actual constructor() {
actual public val publicProperty = 1
actual internal val publicOrInternalProperty = 1
actual internal val internalProperty = 1
private val internalOrPrivateProperty = 1
private val privateProperty = 1
actual public fun publicFunction() = 1
actual internal fun publicOrInternalFunction() = 1
actual internal fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
actual open class Inner1 actual constructor() {
actual public val publicProperty = 1
actual internal val publicOrInternalProperty = 1
actual internal val internalProperty = 1
private val internalOrPrivateProperty = 1
private val privateProperty = 1
actual public fun publicFunction() = 1
actual internal fun publicOrInternalFunction() = 1
actual internal fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
}
}
actual open class Outer2 actual constructor() {
actual public open val publicProperty = 1
internal open val publicOrInternalProperty = 1
actual internal open val internalProperty = 1
private val internalOrPrivateProperty = 1
private val privateProperty = 1
actual public open fun publicFunction() = 1
internal open fun publicOrInternalFunction() = 1
actual internal open fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
actual open class Inner2 actual constructor() {
actual public open val publicProperty = 1
internal open val publicOrInternalProperty = 1
actual internal open val internalProperty = 1
private val internalOrPrivateProperty = 1
private val privateProperty = 1
actual public open fun publicFunction() = 1
internal open fun publicOrInternalFunction() = 1
actual internal open fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
}
}
@@ -6,6 +6,62 @@ private val privateProperty = 1
public fun publicFunction() = 1
public fun publicOrInternalFunction() = 1
internal val internalFunction() = 1
internal val internalOrPrivateFunction() = 1
private val privateFunction() = 1
internal fun internalFunction() = 1
internal fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
open class Outer1 {
public val publicProperty = 1
public val publicOrInternalProperty = 1
internal val internalProperty = 1
internal val internalOrPrivateProperty = 1
private val privateProperty = 1
public fun publicFunction() = 1
public fun publicOrInternalFunction() = 1
internal fun internalFunction() = 1
internal fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
open class Inner1 {
public val publicProperty = 1
public val publicOrInternalProperty = 1
internal val internalProperty = 1
internal val internalOrPrivateProperty = 1
private val privateProperty = 1
public fun publicFunction() = 1
public fun publicOrInternalFunction() = 1
internal fun internalFunction() = 1
internal fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
}
}
open class Outer2 {
public open val publicProperty = 1
public open val publicOrInternalProperty = 1
internal open val internalProperty = 1
internal open val internalOrPrivateProperty = 1
private val privateProperty = 1
public open fun publicFunction() = 1
public open fun publicOrInternalFunction() = 1
internal open fun internalFunction() = 1
internal open fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
open class Inner2 {
public open val publicProperty = 1
public open val publicOrInternalProperty = 1
internal open val internalProperty = 1
internal open val internalOrPrivateProperty = 1
private val privateProperty = 1
public open fun publicFunction() = 1
public open fun publicOrInternalFunction() = 1
internal open fun internalFunction() = 1
internal open fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
}
}
@@ -6,6 +6,62 @@ private val privateProperty = 1
public fun publicFunction() = 1
internal fun publicOrInternalFunction() = 1
internal val internalFunction() = 1
private val internalOrPrivateFunction() = 1
private val privateFunction() = 1
internal fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
open class Outer1 {
public val publicProperty = 1
internal val publicOrInternalProperty = 1
internal val internalProperty = 1
private val internalOrPrivateProperty = 1
private val privateProperty = 1
public fun publicFunction() = 1
internal fun publicOrInternalFunction() = 1
internal fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
open class Inner1 {
public val publicProperty = 1
internal val publicOrInternalProperty = 1
internal val internalProperty = 1
private val internalOrPrivateProperty = 1
private val privateProperty = 1
public fun publicFunction() = 1
internal fun publicOrInternalFunction() = 1
internal fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
}
}
open class Outer2 {
public open val publicProperty = 1
internal open val publicOrInternalProperty = 1
internal open val internalProperty = 1
private val internalOrPrivateProperty = 1
private val privateProperty = 1
public open fun publicFunction() = 1
internal open fun publicOrInternalFunction() = 1
internal open fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
open class Inner2 {
public open val publicProperty = 1
internal open val publicOrInternalProperty = 1
internal open val internalProperty = 1
private val internalOrPrivateProperty = 1
private val privateProperty = 1
public open fun publicFunction() = 1
internal open fun publicOrInternalFunction() = 1
internal open fun internalFunction() = 1
private fun internalOrPrivateFunction() = 1
private fun privateFunction() = 1
}
}
@@ -0,0 +1,84 @@
expect class A1()
expect interface B1
expect annotation class C1()
expect object D1
expect enum class E1 { FOO, BAR, BAZ }
expect class F() {
inner class G1()
class H1()
interface I1
object J1
enum class K1 { FOO, BAR, BAZ }
}
expect interface L {
class M1()
interface N1
object O1
enum class P1 { FOO, BAR, BAZ }
}
expect object R {
class S1()
interface T1
object U1
enum class V1 { FOO, BAR, BAZ }
}
expect class W() {
object X {
interface Y {
class Z() {
enum class AA { FOO, BAR, BAZ }
}
}
}
}
expect class BB1() { companion object }
expect class BB2()
expect class CC1() { companion object DD1 }
expect class CC2()
expect class CC3()
expect inline class EE1(val value: String)
expect class FF1(property1: String) {
val property1: String
val property2: String
val property3: String
val property4: String
fun function1(): String
fun function2(): String
}
expect class FF2()
expect sealed class GG1
expect sealed class GG2 {
class HH1(): GG2
object HH2 : GG2
}
expect class HH5(): GG2
expect object HH6 : GG2
expect enum class II1
expect enum class II2 { FOO }
expect interface JJ {
val property: String
fun function(): String
}
expect class KK1(property: String) : JJ {
override val property: String
override fun function(): String
}
expect class KK2(wrapped: JJ) : JJ
expect class LL1(value: String) { val value: String }
expect class LL2(value: String) { val value: String }
@@ -0,0 +1,133 @@
actual class A1 actual constructor()
class A2
class A3
class A4
class A5
actual interface B1
interface B2
interface B3
interface B4
actual annotation class C1 actual constructor()
annotation class C2
annotation class C3
actual object D1
object D2
actual enum class E1 { FOO, BAR, BAZ }
actual class F actual constructor() {
actual inner class G1 actual constructor()
inner class G2
inner class G3
inner class G4
inner class G5
inner class G6
actual class H1 actual constructor()
class H2
class H3
class H4
actual interface I1
interface I2
interface I3
actual object J1
object J2
actual enum class K1 { FOO, BAR, BAZ }
}
actual interface L {
actual class M1 actual constructor()
class M2
class M3
class M4
class M5
actual interface N1
interface N2
interface N3
actual object O1
object O2
actual enum class P1 { FOO, BAR, BAZ }
}
actual object R {
actual class S1 actual constructor()
class S2
class S3
class S4
actual interface T1
interface T2
interface T3
actual object U1
object U2
actual enum class V1 { FOO, BAR, BAZ }
}
actual class W actual constructor() {
actual object X {
actual interface Y {
actual class Z actual constructor() {
actual enum class AA { FOO, BAR, BAZ }
}
}
}
}
actual class BB1 actual constructor() { actual companion object }
actual class BB2 actual constructor() { companion object }
actual class CC1 actual constructor() { actual companion object DD1 }
actual class CC2 actual constructor() { companion object DD2 }
actual class CC3 actual constructor() { companion object DD3 }
actual inline class EE1 actual constructor(actual val value: String)
inline class EE2(val value: String)
actual external class FF1 actual constructor(actual val property1: String) {
actual val property2 = property1
actual val property3 get() = property1
actual val property4: String
actual fun function1() = property1
actual fun function2(): String
}
actual external class FF2 actual constructor()
actual sealed class GG1
actual sealed class GG2 {
actual class HH1 actual constructor(): GG2()
actual object HH2 : GG2()
class HH3 : GG2()
}
actual class HH5 actual constructor(): GG2()
actual object HH6 : GG2()
class HH7 : GG2()
actual enum class II1
actual enum class II2 { FOO, BAR }
actual interface JJ {
actual val property: String
actual fun function(): String
}
actual class KK1 actual constructor(actual override val property: String) : JJ {
actual override fun function() = property
}
actual class KK2 actual constructor(private val wrapped: JJ) : JJ by wrapped
actual data class LL1 actual constructor(actual val value: String)
actual data class LL2 actual constructor(actual val value: String)
@@ -0,0 +1,135 @@
actual class A1 actual constructor()
interface A2
annotation class A3
object A4
enum class A5 { FOO, BAR, BAZ }
actual interface B1
annotation class B2
object B3
enum class B4 { FOO, BAR, BAZ }
actual annotation class C1 actual constructor()
object C2
enum class C3 { FOO, BAR, BAZ }
actual object D1
enum class D2 { FOO, BAR, BAZ }
actual enum class E1 { FOO, BAR, BAZ }
actual class F actual constructor() {
actual inner class G1 actual constructor()
class G2
interface G3
object G4
enum class G5 { FOO, BAR, BAZ }
companion object G6
actual class H1 actual constructor()
interface H2
object H3
enum class H4 { FOO, BAR, BAZ }
actual interface I1
object I2
enum class I3 { FOO, BAR, BAZ }
actual object J1
enum class J2 { FOO, BAR, BAZ }
actual enum class K1 { FOO, BAR, BAZ }
}
actual interface L {
actual class M1 actual constructor()
interface M2
object M3
enum class M4 { FOO, BAR, BAZ }
companion object M5
actual interface N1
object N2
enum class N3 { FOO, BAR, BAZ }
actual object O1
enum class O2 { FOO, BAR, BAZ }
actual enum class P1 { FOO, BAR, BAZ }
}
actual object R {
actual class S1 actual constructor()
interface S2
object S3
enum class S4 { FOO, BAR, BAZ }
actual interface T1
object T2
enum class T3 { FOO, BAR, BAZ }
actual object U1
enum class U2 { FOO, BAR, BAZ }
actual enum class V1 { FOO, BAR, BAZ }
}
actual class W actual constructor() {
actual object X {
actual interface Y {
actual class Z actual constructor() {
actual enum class AA { FOO, BAR, BAZ }
}
}
}
}
actual class BB1 actual constructor() { actual companion object }
actual class BB2 actual constructor()
actual class CC1 actual constructor() { actual companion object DD1 }
actual class CC2 actual constructor() { companion object CompanionWithAnotherName }
actual class CC3 actual constructor() { companion object }
actual inline class EE1 actual constructor(actual val value: String)
class EE2(val value: String)
actual class FF1 actual constructor(actual val property1: String) {
actual val property2 = property1
actual val property3 get() = property1
actual val property4 = property1
actual fun function1() = property1
actual fun function2() = function1()
}
actual external class FF2 actual constructor()
actual sealed class GG1
actual sealed class GG2 {
actual class HH1 actual constructor(): GG2()
actual object HH2 : GG2()
class HH4 : GG2()
}
actual class HH5 actual constructor(): GG2()
actual object HH6 : GG2()
class HH8 : GG2()
actual enum class II1
actual enum class II2 { FOO, BAZ }
actual interface JJ {
actual val property: String
val property2: String
actual fun function(): String
}
actual class KK1 actual constructor(actual override val property: String) : JJ {
val property2 = property
actual override fun function() = property
}
actual class KK2 actual constructor(wrapped: JJ) : JJ by wrapped
actual data class LL1 actual constructor(actual val value: String)
actual class LL2 actual constructor(actual val value: String)
@@ -0,0 +1,133 @@
class A1
class A2
class A3
class A4
class A5
interface B1
interface B2
interface B3
interface B4
annotation class C1
annotation class C2
annotation class C3
object D1
object D2
enum class E1 { FOO, BAR, BAZ }
class F {
inner class G1
inner class G2
inner class G3
inner class G4
inner class G5
inner class G6
class H1
class H2
class H3
class H4
interface I1
interface I2
interface I3
object J1
object J2
enum class K1 { FOO, BAR, BAZ }
}
interface L {
class M1
class M2
class M3
class M4
class M5
interface N1
interface N2
interface N3
object O1
object O2
enum class P1 { FOO, BAR, BAZ }
}
object R {
class S1
class S2
class S3
class S4
interface T1
interface T2
interface T3
object U1
object U2
enum class V1 { FOO, BAR, BAZ }
}
class W {
object X {
interface Y {
class Z {
enum class AA { FOO, BAR, BAZ }
}
}
}
}
class BB1 { companion object }
class BB2 { companion object }
class CC1 { companion object DD1 }
class CC2 { companion object DD2 }
class CC3 { companion object DD3 }
inline class EE1(val value: String)
inline class EE2(val value: String)
external class FF1(val property1: String) {
val property2 = property1
val property3 get() = property1
val property4: String
fun function1() = property1
fun function2(): String
}
external class FF2()
sealed class GG1
sealed class GG2 {
class HH1 : GG2()
object HH2 : GG2()
class HH3 : GG2()
}
class HH5 : GG2()
object HH6 : GG2()
class HH7 : GG2()
enum class II1
enum class II2 { FOO, BAR }
interface JJ {
val property: String
fun function(): String
}
class KK1(override val property: String) : JJ {
override fun function() = property
}
class KK2(private val wrapped: JJ) : JJ by wrapped
data class LL1(val value: String)
data class LL2(val value: String)
@@ -0,0 +1,135 @@
class A1
interface A2
annotation class A3
object A4
enum class A5 { FOO, BAR, BAZ }
interface B1
annotation class B2
object B3
enum class B4 { FOO, BAR, BAZ }
annotation class C1
object C2
enum class C3 { FOO, BAR, BAZ }
object D1
enum class D2 { FOO, BAR, BAZ }
enum class E1 { FOO, BAR, BAZ }
class F {
inner class G1
class G2
interface G3
object G4
enum class G5 { FOO, BAR, BAZ }
companion object G6
class H1
interface H2
object H3
enum class H4 { FOO, BAR, BAZ }
interface I1
object I2
enum class I3 { FOO, BAR, BAZ }
object J1
enum class J2 { FOO, BAR, BAZ }
enum class K1 { FOO, BAR, BAZ }
}
interface L {
class M1
interface M2
object M3
enum class M4 { FOO, BAR, BAZ }
companion object M5
interface N1
object N2
enum class N3 { FOO, BAR, BAZ }
object O1
enum class O2 { FOO, BAR, BAZ }
enum class P1 { FOO, BAR, BAZ }
}
object R {
class S1
interface S2
object S3
enum class S4 { FOO, BAR, BAZ }
interface T1
object T2
enum class T3 { FOO, BAR, BAZ }
object U1
enum class U2 { FOO, BAR, BAZ }
enum class V1 { FOO, BAR, BAZ }
}
class W {
object X {
interface Y {
class Z {
enum class AA { FOO, BAR, BAZ }
}
}
}
}
class BB1 { companion object }
class BB2
class CC1 { companion object DD1 }
class CC2 { companion object CompanionWithAnotherName }
class CC3 { companion object }
inline class EE1(val value: String)
class EE2(val value: String)
class FF1(val property1: String) {
val property2 = property1
val property3 get() = property1
val property4 = property1
fun function1() = property1
fun function2() = function1()
}
external class FF2()
sealed class GG1
sealed class GG2 {
class HH1 : GG2()
object HH2 : GG2()
class HH4 : GG2()
}
class HH5 : GG2()
object HH6 : GG2()
class HH8 : GG2()
enum class II1
enum class II2 { FOO, BAZ }
interface JJ {
val property: String
val property2: String
fun function(): String
}
class KK1(override val property: String) : JJ {
val property2 = property
override fun function() = property
}
class KK2(wrapped: JJ) : JJ by wrapped
data class LL1(val value: String)
class LL2(val value: String)
@@ -0,0 +1,30 @@
expect class A1(text: String) { constructor(number: Int) }
expect class A2(text: String) { constructor(number: Int) }
expect class A3
expect class A4
expect class A5
expect class B1 protected constructor(text: String) { protected constructor(number: Int) }
expect class B2
expect class B3
expect class C1 internal constructor(text: String) { internal constructor(number: Int) }
expect class C2
expect class D1
expect class E {
constructor(a: Any)
constructor(a: Any, b: String)
constructor(a: Any, b: Int)
}
expect enum class F {
FOO,
BAR,
BAZ;
// no constructor allowed for enum class
val alias: String
}
@@ -0,0 +1,30 @@
actual class A1 actual constructor(text: String) { actual constructor(number: Int) : this(number.toString()) }
actual class A2 actual constructor(text: String) { actual constructor(number: Int) : this(number.toString()) }
actual class A3(text: String) { constructor(number: Int) : this(number.toString()) }
actual class A4(text: String) { constructor(number: Int) : this(number.toString()) }
actual class A5(text: String) { constructor(number: Int) : this(number.toString()) }
actual class B1 protected actual constructor(text: String) { protected actual constructor(number: Int) : this(number.toString()) }
actual class B2 protected constructor(text: String) { protected constructor(number: Int) : this(number.toString()) }
actual class B3 protected constructor(text: String) { protected constructor(number: Int) : this(number.toString()) }
actual class C1 internal actual constructor(text: String) { internal actual constructor(number: Int) : this(number.toString()) }
actual class C2 internal constructor(text: String) { internal constructor(number: Int) : this(number.toString()) }
actual class D1 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
actual class E {
constructor(a: Int)
actual constructor(a: Any)
constructor(a: Int, b: String)
constructor(a: Int, b: Any)
actual constructor(a: Any, b: String)
actual constructor(a: Any, b: Int)
}
actual enum class F(actual val alias: String) {
FOO("foo"),
BAR("bar"),
BAZ("baz")
}
@@ -0,0 +1,30 @@
actual class A1 actual constructor(text: String) { actual constructor(number: Int) : this(number.toString()) }
actual class A2 actual constructor(text: String) { actual constructor(number: Int) : this(number.toString()) }
actual class A3 protected constructor(text: String) { protected constructor(number: Int) : this(number.toString()) }
actual class A4 internal constructor(text: String) { internal constructor(number: Int) : this(number.toString()) }
actual class A5 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
actual class B1 protected actual constructor(text: String) { protected actual constructor(number: Int) : this(number.toString()) }
actual class B2 internal constructor(text: String) { internal constructor(number: Int) : this(number.toString()) }
actual class B3 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
actual class C1 internal actual constructor(text: String) { internal actual constructor(number: Int) : this(number.toString()) }
actual class C2 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
actual class D1 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
actual class E {
constructor(a: String)
actual constructor(a: Any)
constructor(a: String, b: Int)
constructor(a: String, b: Any)
actual constructor(a: Any, b: String)
actual constructor(a: Any, b: Int)
}
actual enum class F(actual val alias: String) {
FOO("foo"),
BAR("bar"),
BAZ("baz")
}
@@ -0,0 +1,30 @@
class A1(text: String) { constructor(number: Int) : this(number.toString()) }
class A2(text: String) { constructor(number: Int) : this(number.toString()) }
class A3(text: String) { constructor(number: Int) : this(number.toString()) }
class A4(text: String) { constructor(number: Int) : this(number.toString()) }
class A5(text: String) { constructor(number: Int) : this(number.toString()) }
class B1 protected constructor(text: String) { protected constructor(number: Int) : this(number.toString()) }
class B2 protected constructor(text: String) { protected constructor(number: Int) : this(number.toString()) }
class B3 protected constructor(text: String) { protected constructor(number: Int) : this(number.toString()) }
class C1 internal constructor(text: String) { internal constructor(number: Int) : this(number.toString()) }
class C2 internal constructor(text: String) { internal constructor(number: Int) : this(number.toString()) }
class D1 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
class E {
constructor(a: Int)
constructor(a: Any)
constructor(a: Int, b: String)
constructor(a: Int, b: Any)
constructor(a: Any, b: String)
constructor(a: Any, b: Int)
}
enum class F(val alias: String) {
FOO("foo"),
BAR("bar"),
BAZ("baz")
}
@@ -0,0 +1,30 @@
class A1(text: String) { constructor(number: Int) : this(number.toString()) }
class A2 constructor(text: String) { constructor(number: Int) : this(number.toString()) }
class A3 protected constructor(text: String) { protected constructor(number: Int) : this(number.toString()) }
class A4 internal constructor(text: String) { internal constructor(number: Int) : this(number.toString()) }
class A5 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
class B1 protected constructor(text: String) { protected constructor(number: Int) : this(number.toString()) }
class B2 internal constructor(text: String) { internal constructor(number: Int) : this(number.toString()) }
class B3 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
class C1 internal constructor(text: String) { internal constructor(number: Int) : this(number.toString()) }
class C2 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
class D1 private constructor(text: String) { private constructor(number: Int) : this(number.toString()) }
class E {
constructor(a: String)
constructor(a: Any)
constructor(a: String, b: Int)
constructor(a: String, b: Any)
constructor(a: Any, b: String)
constructor(a: Any, b: Int)
}
enum class F(val alias: String) {
FOO("foo"),
BAR("bar"),
BAZ("baz")
}
@@ -0,0 +1,17 @@
expect final class A1()
expect final class A2()
expect open class B1()
expect abstract class C1()
expect sealed class D1
expect abstract class E() {
final val p1: Int
final val p2: Int
open val p4: Int
abstract val p6: Int
final fun f1(): Int
final fun f2(): Int
open fun f4(): Int
abstract fun f6(): Int
}
@@ -0,0 +1,33 @@
actual final class A1 actual constructor()
actual final class A2 actual constructor()
final class A3
final class A4
actual open class B1 actual constructor()
open class B2
open class B3
actual abstract class C1 actual constructor()
abstract class C2
actual sealed class D1
actual abstract class E actual constructor() {
actual final val p1: Int = 1
actual final val p2: Int = 1
final val p3: Int = 1
actual open val p4: Int = 1
open val p5: Int = 1
actual abstract val p6: Int
actual final fun f1(): Int = 1
actual final fun f2(): Int = 1
final fun f3(): Int = 1
actual open fun f4(): Int = 1
open fun f5(): Int = 1
actual abstract fun f6(): Int
}
@@ -0,0 +1,33 @@
actual final class A1 actual constructor()
actual open class A2 actual constructor()
abstract class A3
sealed class A4
actual open class B1 actual constructor()
abstract class B2
sealed class B3
actual abstract class C1 actual constructor()
sealed class C2
actual sealed class D1
actual abstract class E actual constructor() {
actual final val p1: Int = 1
actual open val p2: Int = 1
abstract val p3: Int
actual open val p4: Int = 1
abstract val p5: Int
actual abstract val p6: Int
actual final fun f1(): Int = 1
actual open fun f2(): Int = 1
abstract fun f3(): Int
actual open fun f4(): Int = 1
abstract fun f5(): Int
actual abstract fun f6(): Int
}
@@ -0,0 +1,33 @@
final class A1
final class A2
final class A3
final class A4
open class B1
open class B2
open class B3
abstract class C1
abstract class C2
sealed class D1
abstract class E {
final val p1: Int = 1
final val p2: Int = 1
final val p3: Int = 1
open val p4: Int = 1
open val p5: Int = 1
abstract val p6: Int
final fun f1(): Int = 1
final fun f2(): Int = 1
final fun f3(): Int = 1
open fun f4(): Int = 1
open fun f5(): Int = 1
abstract fun f6(): Int
}
@@ -0,0 +1,33 @@
final class A1
open class A2
abstract class A3
sealed class A4
open class B1
abstract class B2
sealed class B3
abstract class C1
sealed class C2
sealed class D1
abstract class E {
final val p1: Int = 1
open val p2: Int = 1
abstract val p3: Int
open val p4: Int = 1
abstract val p5: Int
abstract val p6: Int
final fun f1(): Int = 1
open fun f2(): Int = 1
abstract fun f3(): Int
open fun f4(): Int = 1
abstract fun f5(): Int
abstract fun f6(): Int
}
@@ -0,0 +1,64 @@
expect interface A1 {
val property1: Int
fun function1(): Int
}
expect abstract class A2(): A1 {
abstract val property2: Int
abstract fun function2(): Int
}
expect class A3 (): A2 {
override val property1: Int
override val property2: Int
val property3: Int
override fun function1(): Int
override fun function2(): Int
fun function3(): Int
}
expect interface B1 {
val property1: Int
fun function1(): Int
}
expect class B3(): B1 {
override val property1: Int
open val property2: Int
val property3: Int
override fun function1(): Int
open fun function2(): Int
fun function3(): Int
}
expect interface C1 {
val property1: Int
fun function1(): Int
}
expect class C3 (): C1 {
override val property1: Int
val property2: Int
val property3: Int
override fun function1(): Int
fun function2(): Int
fun function3(): Int
}
expect interface D2 {
val property2: Int
fun function2(): Int
}
expect class D3(): D2 {
open val property1: Int
override val property2: Int
val property3: Int
open fun function1(): Int
override fun function2(): Int
fun function3(): Int
}
@@ -0,0 +1,79 @@
actual interface A1 {
actual val property1: Int
actual fun function1(): Int
}
actual abstract class A2 actual constructor(): A1 {
actual abstract val property2: Int
actual abstract fun function2(): Int
}
actual class A3 actual constructor(): A2() {
actual override val property1 = 1
actual override val property2 = 1
actual val property3 = 1
actual override fun function1() = 1
actual override fun function2() = 1
actual fun function3() = 1
}
actual interface B1 {
actual val property1: Int
actual fun function1(): Int
}
interface B2 {
val property2: Int
fun function2(): Int
}
actual class B3 actual constructor(): B1, B2 {
actual override val property1 = 1
actual override val property2 = 1
actual val property3 = 1
actual override fun function1() = 1
actual override fun function2() = 1
actual fun function3() = 1
}
actual interface C1 {
actual val property1: Int
actual fun function1(): Int
}
interface C2 {
val property2: Int
fun function2(): Int
}
actual class C3 actual constructor(): C1, C2 {
actual override val property1 = 1
actual override val property2 = 1
actual val property3 = 1
actual override fun function1() = 1
actual override fun function2() = 1
actual fun function3() = 1
}
interface D1 {
val property1: Int
fun function1(): Int
}
actual interface D2 {
actual val property2: Int
actual fun function2(): Int
}
actual class D3 actual constructor(): D1, D2 {
actual override val property1 = 1
actual override val property2 = 1
actual val property3 = 1
actual override fun function1() = 1
actual override fun function2() = 1
actual fun function3() = 1
}
@@ -0,0 +1,72 @@
actual interface A1 {
actual val property1: Int
actual fun function1(): Int
}
actual abstract class A2 actual constructor(): A1 {
actual abstract val property2: Int
actual abstract fun function2(): Int
}
actual class A3 actual constructor(): A2(), A1 {
actual override val property1 = 1
actual override val property2 = 1
actual val property3 = 1
actual override fun function1() = 1
actual override fun function2() = 1
actual fun function3() = 1
}
actual interface B1 {
actual val property1: Int
val property2: Int
actual fun function1(): Int
fun function2(): Int
}
actual class B3 actual constructor(): B1 {
actual override val property1 = 1
actual override val property2 = 1
actual val property3 = 1
actual override fun function1() = 1
actual override fun function2() = 1
actual fun function3() = 1
}
actual interface C1 {
actual val property1: Int
actual fun function1(): Int
}
actual class C3 actual constructor(): C1 {
actual override val property1 = 1
actual val property2 = 1
actual val property3 = 1
actual override fun function1() = 1
actual fun function2() = 1
actual fun function3() = 1
}
abstract class D1 {
abstract val property1: Int
abstract fun function1(): Int
}
actual interface D2 {
actual val property2: Int
actual fun function2(): Int
}
actual class D3 actual constructor(): D1(), D2 {
actual override val property1 = 1
actual override val property2 = 1
actual val property3 = 1
actual override fun function1() = 1
actual override fun function2() = 1
actual fun function3() = 1
}
@@ -0,0 +1,79 @@
interface A1 {
val property1: Int
fun function1(): Int
}
abstract class A2 : A1 {
abstract val property2: Int
abstract fun function2(): Int
}
class A3 : A2() {
override val property1 = 1
override val property2 = 1
val property3 = 1
override fun function1() = 1
override fun function2() = 1
fun function3() = 1
}
interface B1 {
val property1: Int
fun function1(): Int
}
interface B2 {
val property2: Int
fun function2(): Int
}
class B3 : B1, B2 {
override val property1 = 1
override val property2 = 1
val property3 = 1
override fun function1() = 1
override fun function2() = 1
fun function3() = 1
}
interface C1 {
val property1: Int
fun function1(): Int
}
interface C2 {
val property2: Int
fun function2(): Int
}
class C3 : C1, C2 {
override val property1 = 1
override val property2 = 1
val property3 = 1
override fun function1() = 1
override fun function2() = 1
fun function3() = 1
}
interface D1 {
val property1: Int
fun function1(): Int
}
interface D2 {
val property2: Int
fun function2(): Int
}
class D3 : D1, D2 {
override val property1 = 1
override val property2 = 1
val property3 = 1
override fun function1() = 1
override fun function2() = 1
fun function3() = 1
}
@@ -0,0 +1,72 @@
interface A1 {
val property1: Int
fun function1(): Int
}
abstract class A2 : A1 {
abstract val property2: Int
abstract fun function2(): Int
}
class A3 : A2(), A1 {
override val property1 = 1
override val property2 = 1
val property3 = 1
override fun function1() = 1
override fun function2() = 1
fun function3() = 1
}
interface B1 {
val property1: Int
val property2: Int
fun function1(): Int
fun function2(): Int
}
class B3 : B1 {
override val property1 = 1
override val property2 = 1
val property3 = 1
override fun function1() = 1
override fun function2() = 1
fun function3() = 1
}
interface C1 {
val property1: Int
fun function1(): Int
}
class C3 : C1 {
override val property1 = 1
val property2 = 1
val property3 = 1
override fun function1() = 1
fun function2() = 1
fun function3() = 1
}
abstract class D1 {
abstract val property1: Int
abstract fun function1(): Int
}
interface D2 {
val property2: Int
fun function2(): Int
}
class D3 : D1(), D2 {
override val property1 = 1
override val property2 = 1
val property3 = 1
override fun function1() = 1
override fun function2() = 1
fun function3() = 1
}
@@ -0,0 +1,2 @@
expect class A ()
expect class B
@@ -0,0 +1,8 @@
actual class A actual constructor()
actual typealias B = A
typealias C = B
typealias D = List<String>
typealias E<T> = List<T>
typealias F<R> = Function<R>
typealias G = () -> Unit
typealias H = (String) -> Int
@@ -0,0 +1,8 @@
actual class A actual constructor()
actual typealias B = A
typealias C = B
typealias D = List<String>
typealias E<T> = List<T>
typealias F<R> = Function<R>
typealias G = () -> Unit
typealias H = (String) -> Int
@@ -0,0 +1,8 @@
class A
typealias B = A
typealias C = B
typealias D = List<String>
typealias E<T> = List<T>
typealias F<R> = Function<R>
typealias G = () -> Unit
typealias H = (String) -> Int
@@ -0,0 +1,8 @@
class A
typealias B = A
typealias C = B
typealias D = List<String>
typealias E<T> = List<T>
typealias F<R> = Function<R>
typealias G = () -> Unit
typealias H = (String) -> Int
@@ -0,0 +1,126 @@
expect class A2<T : Any?>() {
val property: T
fun function(value: T): T
expect class Nested<T : Any?>() {
val property: T
fun function(value: T): T
}
expect inner class Inner() {
val property: T
fun function(value: T): T
}
}
expect class B4<T : Any>() {
val property: T
fun function(value: T): T
expect class Nested<T : Any>() {
val property: T
fun function(value: T): T
}
expect inner class Inner() {
val property: T
fun function(value: T): T
}
}
expect class C5<T : CharSequence>() {
val property: T
fun function(value: T): T
expect class Nested<T : CharSequence>() {
val property: T
fun function(value: T): T
}
expect inner class Inner() {
val property: T
fun function(value: T): T
}
}
expect class D6<T : String>() {
val property: T
fun function(value: T): T
expect class Nested<T : String>() {
val property: T
fun function(value: T): T
}
expect inner class Inner() {
val property: T
fun function(value: T): T
}
}
expect class E7<String>() {
val property: String
fun function(value: String): String
expect class Nested<String>() {
val property: String
fun function(value: String): String
}
expect inner class Inner() {
val property: String
fun function(value: String): String
}
}
expect class F1<T>() {
val property: T
fun function(value: T): T
expect class Nested<T>() {
val property: T
fun function(value: T): T
}
expect inner class Inner() {
val property: T
fun function(value: T): T
}
}
expect class G1<T, R>() {
val property1: T
val property2: R
fun function(value: T): R
expect class Nested<T, R>() {
val property1: T
val property2: R
fun function(value: T): R
}
expect inner class Inner() {
val property1: T
val property2: R
fun function(value: T): R
}
}
expect class H1<T>() {
val dependentProperty: T
fun dependentFunction(value: T): T
val T.dependentExtensionProperty: T
fun T.dependentExtensionFunction(): T
fun <T> independentFunction(): T
val <T> T.independentExtensionProperty: T
fun <T> T.independentExtensionFunction(): T
}
expect class H2<T>() {
val dependentProperty: T
fun dependentFunction(value: T): T
val T.dependentExtensionProperty: T
fun T.dependentExtensionFunction(): T
}
expect class I<T : I<T>>() {
val property: T
fun function(value: T): T
}
@@ -0,0 +1,636 @@
class A1<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
actual class A2<T> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class A3<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A4<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A5<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A6<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A7<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B1<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B2<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B3<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
actual class B4<T : Any> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T : Any> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class B5<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B6<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B7<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C1<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C2<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C3<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C4<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
actual class C5<T : CharSequence> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T : CharSequence> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class C6<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C7<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D1<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D2<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D3<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D4<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D5<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
actual class D6<T : String> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T : String> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class D7<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E1<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E2<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E3<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E4<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E5<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E6<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
actual class E7<String> actual constructor() {
actual val property: String get() = TODO()
actual fun function(value: String): String = value
actual class Nested<String> actual constructor() {
actual val property: String get() = TODO()
actual fun function(value: String): String = value
}
actual inner class Inner actual constructor() {
actual val property: String get() = TODO()
actual fun function(value: String): String = value
}
}
actual class F1<T> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class F2<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class F3<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
actual class G1<T, R> actual constructor() {
actual val property1: T get() = TODO()
actual val property2: R get() = TODO()
actual fun function(value: T): R = TODO()
actual class Nested<T, R> actual constructor() {
actual val property1: T get() = TODO()
actual val property2: R get() = TODO()
actual fun function(value: T): R = TODO()
}
actual inner class Inner actual constructor() {
actual val property1: T get() = TODO()
actual val property2: R get() = TODO()
actual fun function(value: T): R = TODO()
}
}
class G2<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
class G3<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
class G4<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
actual class H1<T> actual constructor() {
actual val dependentProperty: T get() = TODO()
actual fun dependentFunction(value: T): T = value
actual val T.dependentExtensionProperty: T get() = this
actual fun T.dependentExtensionFunction(): T = this
actual fun <T> independentFunction(): T = TODO()
actual val <T> T.independentExtensionProperty: T get() = this
actual fun <T> T.independentExtensionFunction(): T = this
}
actual class H2<T> actual constructor() {
actual val dependentProperty: T get() = TODO()
actual fun dependentFunction(value: T): T = value
actual val T.dependentExtensionProperty: T get() = this
actual fun T.dependentExtensionFunction(): T = this
fun <T> independentFunction(): T = TODO()
val <T> T.independentExtensionProperty: T get() = this
fun <T> T.independentExtensionFunction(): T = this
}
actual class I<T : I<T>> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
@@ -0,0 +1,636 @@
class A1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
actual class A2<T : Any?> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T : Any?> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class A3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class A4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class B1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class B2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
actual class B4<T : Any> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T : Any> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class B5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class C1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class C2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?>{
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class C4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
actual class C5<T : CharSequence> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T : CharSequence> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class C6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class D1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class D2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class D4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
actual class D6<T : String> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T : String> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class D7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class E2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class E4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
actual class E7<String> actual constructor() {
actual val property: String get() = TODO()
actual fun function(value: String): String = value
actual class Nested<String> actual constructor() {
actual val property: String get() = TODO()
actual fun function(value: String): String = value
}
actual inner class Inner actual constructor() {
actual val property: String get() = TODO()
actual fun function(value: String): String = value
}
}
actual class F1<T> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
actual class Nested<T> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
actual inner class Inner actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
}
class F2<in T> {
val property: String get() = TODO()
fun function(value: T): Any = TODO()
class Nested<in T> {
val property: String get() = TODO()
fun function(value: T): Any = TODO()
}
inner class Inner {
val property: String get() = TODO()
fun function(value: T): Any = TODO()
}
}
class F3<out T> {
val property: T get() = TODO()
fun function(value: Any): T = TODO()
class Nested<out T> {
val property: T get() = TODO()
fun function(value: Any): T = TODO()
}
inner class Inner {
val property: T get() = TODO()
fun function(value: Any): T = TODO()
}
}
actual class G1<T, R> actual constructor() {
actual val property1: T get() = TODO()
actual val property2: R get() = TODO()
actual fun function(value: T): R = TODO()
actual class Nested<T, R> actual constructor() {
actual val property1: T get() = TODO()
actual val property2: R get() = TODO()
actual fun function(value: T): R = TODO()
}
actual inner class Inner actual constructor() {
actual val property1: T get() = TODO()
actual val property2: R get() = TODO()
actual fun function(value: T): R = TODO()
}
}
class G2<T> {
val property1: T get() = TODO()
val property2: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property1: T get() = TODO()
val property2: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property1: T get() = TODO()
val property2: T get() = TODO()
fun function(value: T): T = value
}
}
class G3<R> {
val property1: R get() = TODO()
val property2: R get() = TODO()
fun function(value: R): R = value
class Nested<R> {
val property1: R get() = TODO()
val property2: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property1: R get() = TODO()
val property2: R get() = TODO()
fun function(value: R): R = value
}
}
class G4<R, T> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<R, T> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
actual class H1<T> actual constructor() {
actual val dependentProperty: T get() = TODO()
actual fun dependentFunction(value: T): T = value
actual val T.dependentExtensionProperty: T get() = this
actual fun T.dependentExtensionFunction(): T = this
actual fun <T> independentFunction(): T = TODO()
actual val <T> T.independentExtensionProperty: T get() = this
actual fun <T> T.independentExtensionFunction(): T = this
}
actual class H2<T> actual constructor() {
actual val dependentProperty: T get() = TODO()
actual fun dependentFunction(value: T): T = value
actual val T.dependentExtensionProperty: T get() = this
actual fun T.dependentExtensionFunction(): T = this
fun independentFunction(): T = TODO()
val T.independentExtensionProperty: T get() = this
fun T.independentExtensionFunction(): T = this
}
actual class I<T : I<T>> actual constructor() {
actual val property: T get() = TODO()
actual fun function(value: T): T = value
}
@@ -0,0 +1,636 @@
class A1<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A2<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A3<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A4<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A5<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A6<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A7<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B1<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B2<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B3<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B5<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B6<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B7<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C1<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C2<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C3<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C4<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C6<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C7<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D1<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D2<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D3<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D4<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D5<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D7<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E1<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E2<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E3<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E4<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E5<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E6<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class F1<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class F2<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class F3<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class G1<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
class G2<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
class G3<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
class G4<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
class H1<T> {
val dependentProperty: T get() = TODO()
fun dependentFunction(value: T): T = value
val T.dependentExtensionProperty: T get() = this
fun T.dependentExtensionFunction(): T = this
fun <T> independentFunction(): T = TODO()
val <T> T.independentExtensionProperty: T get() = this
fun <T> T.independentExtensionFunction(): T = this
}
class H2<T> {
val dependentProperty: T get() = TODO()
fun dependentFunction(value: T): T = value
val T.dependentExtensionProperty: T get() = this
fun T.dependentExtensionFunction(): T = this
fun <T> independentFunction(): T = TODO()
val <T> T.independentExtensionProperty: T get() = this
fun <T> T.independentExtensionFunction(): T = this
}
class I<T : I<T>> {
val property: T get() = TODO()
fun function(value: T): T = value
}
@@ -0,0 +1,636 @@
class A1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class A2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class A4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class A7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class B1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class B2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class B4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class B7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class C1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class C2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?>{
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class C4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class C7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class D1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class D2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class D4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class D7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class E1 {
val property: Any get() = TODO()
fun function(value: Any): Any = value
class Nested {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
inner class Inner {
val property: Any get() = TODO()
fun function(value: Any): Any = value
}
}
class E2<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any?> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E3<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
class Nested<R : Any?> {
val property: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property: R get() = TODO()
fun function(value: R): R = value
}
}
class E4<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : Any> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E5<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : CharSequence> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E6<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T : String> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class E7<String> {
val property: String get() = TODO()
fun function(value: String): String = value
class Nested<String> {
val property: String get() = TODO()
fun function(value: String): String = value
}
inner class Inner {
val property: String get() = TODO()
fun function(value: String): String = value
}
}
class F1<T> {
val property: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property: T get() = TODO()
fun function(value: T): T = value
}
}
class F2<in T> {
val property: String get() = TODO()
fun function(value: T): Any = TODO()
class Nested<in T> {
val property: String get() = TODO()
fun function(value: T): Any = TODO()
}
inner class Inner {
val property: String get() = TODO()
fun function(value: T): Any = TODO()
}
}
class F3<out T> {
val property: T get() = TODO()
fun function(value: Any): T = TODO()
class Nested<out T> {
val property: T get() = TODO()
fun function(value: Any): T = TODO()
}
inner class Inner {
val property: T get() = TODO()
fun function(value: Any): T = TODO()
}
}
class G1<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<T, R> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
class G2<T> {
val property1: T get() = TODO()
val property2: T get() = TODO()
fun function(value: T): T = value
class Nested<T> {
val property1: T get() = TODO()
val property2: T get() = TODO()
fun function(value: T): T = value
}
inner class Inner {
val property1: T get() = TODO()
val property2: T get() = TODO()
fun function(value: T): T = value
}
}
class G3<R> {
val property1: R get() = TODO()
val property2: R get() = TODO()
fun function(value: R): R = value
class Nested<R> {
val property1: R get() = TODO()
val property2: R get() = TODO()
fun function(value: R): R = value
}
inner class Inner {
val property1: R get() = TODO()
val property2: R get() = TODO()
fun function(value: R): R = value
}
}
class G4<R, T> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
class Nested<R, T> {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
inner class Inner {
val property1: T get() = TODO()
val property2: R get() = TODO()
fun function(value: T): R = TODO()
}
}
class H1<T> {
val dependentProperty: T get() = TODO()
fun dependentFunction(value: T): T = value
val T.dependentExtensionProperty: T get() = this
fun T.dependentExtensionFunction(): T = this
fun <T> independentFunction(): T = TODO()
val <T> T.independentExtensionProperty: T get() = this
fun <T> T.independentExtensionFunction(): T = this
}
class H2<T> {
val dependentProperty: T get() = TODO()
fun dependentFunction(value: T): T = value
val T.dependentExtensionProperty: T get() = this
fun T.dependentExtensionFunction(): T = this
fun independentFunction(): T = TODO()
val T.independentExtensionProperty: T get() = this
fun T.independentExtensionFunction(): T = this
}
class I<T : I<T>> {
val property: T get() = TODO()
fun function(value: T): T = value
}
@@ -0,0 +1,20 @@
expect public class A1()
expect protected class B1()
expect internal class C1()
expect public class E1
expect protected class E2
expect internal class E3
expect private class E4
expect protected class F1
expect private class F3
expect internal class G1
expect private class G2
expect private class H1
expect public class I1
expect public class I2
expect public class I3
@@ -0,0 +1,32 @@
actual public class A1 actual constructor()
public class A2
public class A3
public class A4
actual protected class B1 actual constructor()
protected class B2
protected class B3
actual internal class C1 actual constructor()
internal class C2
private class D1
actual public typealias E1 = A1
actual public typealias E2 = A1
actual public typealias E3 = A1
actual public typealias E4 = A1
actual protected typealias F1 = A1
protected typealias F2 = A1
actual protected typealias F3 = A1
actual internal typealias G1 = A1
actual internal typealias G2 = A1
actual private typealias H1 = A1
actual public typealias I1 = A1 // points to public
actual public typealias I2 = B1 // points to protected
actual public typealias I3 = C1 // points to internal
public typealias I4 = D1 // points to private
@@ -0,0 +1,32 @@
actual public class A1 actual constructor()
protected class A2
internal class A3
private class A4
actual protected class B1 actual constructor()
internal class B2
private class B3
actual internal class C1 actual constructor()
private class C2
private class D1
actual public typealias E1 = A1
actual protected typealias E2 = A1
actual internal typealias E3 = A1
actual private typealias E4 = A1
actual protected typealias F1 = A1
internal typealias F2 = A1
actual private typealias F3 = A1
actual internal typealias G1 = A1
actual private typealias G2 = A1
actual private typealias H1 = A1
actual public typealias I1 = A1 // points to public
actual public typealias I2 = B1 // points to protected
actual public typealias I3 = C1 // points to internal
public typealias I4 = D1 // points to private
@@ -0,0 +1,32 @@
public class A1
public class A2
public class A3
public class A4
protected class B1
protected class B2
protected class B3
internal class C1
internal class C2
private class D1
public typealias E1 = A1
public typealias E2 = A1
public typealias E3 = A1
public typealias E4 = A1
protected typealias F1 = A1
protected typealias F2 = A1
protected typealias F3 = A1
internal typealias G1 = A1
internal typealias G2 = A1
private typealias H1 = A1
public typealias I1 = A1 // points to public
public typealias I2 = B1 // points to protected
public typealias I3 = C1 // points to internal
public typealias I4 = D1 // points to private
@@ -0,0 +1,32 @@
public class A1
protected class A2
internal class A3
private class A4
protected class B1
internal class B2
private class B3
internal class C1
private class C2
private class D1
public typealias E1 = A1
protected typealias E2 = A1
internal typealias E3 = A1
private typealias E4 = A1
protected typealias F1 = A1
internal typealias F2 = A1
private typealias F3 = A1
internal typealias G1 = A1
private typealias G2 = A1
private typealias H1 = A1
public typealias I1 = A1 // points to public
public typealias I2 = B1 // points to protected
public typealias I3 = C1 // points to internal
public typealias I4 = D1 // points to private
@@ -1,3 +1,6 @@
expect annotation class CommonAnnotationForAnnotationClassesOnly(text: String) { val text: String }
expect annotation class CommonAnnotation(text: String) { val text: String }
expect var propertyWithoutBackingField: Double
expect val propertyWithBackingField: Double
expect val propertyWithDelegateField: Int
@@ -5,3 +8,6 @@ expect val <T : CharSequence> T.propertyWithExtensionReceiver: Int
expect fun function1(text: String): String
expect fun <Q : Number> Q.function2(): Q
expect class AnnotatedClass(value: String) { val value: String }
expect class AnnotatedTypeAlias
@@ -1,27 +1,50 @@
import kotlin.annotation.AnnotationTarget.*
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER)
annotation class Foo(val text: String)
@Target(ANNOTATION_CLASS)
actual annotation class CommonAnnotationForAnnotationClassesOnly actual constructor(actual val text: String)
@property:Foo("property")
@get:Foo("getter")
@set:Foo("setter")
@setparam:Foo("parameter")
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JsAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")
actual annotation class CommonAnnotation actual constructor(actual val text: String)
@Target(ANNOTATION_CLASS)
annotation class JsAnnotationForAnnotationClassesOnly(val text: String)
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JsAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")
annotation class JsAnnotation(val text: String)
@JsAnnotation("property")
@CommonAnnotation("property")
actual var propertyWithoutBackingField
get() = 3.14
set(value) = Unit
@JsAnnotation("getter") @CommonAnnotation("getter") get() = 3.14
@JsAnnotation("setter") @CommonAnnotation("setter") set(@JsAnnotation("parameter") @CommonAnnotation("parameter") value) = Unit
@field:Foo("field")
@field:JsAnnotation("field")
@field:CommonAnnotation("field")
actual val propertyWithBackingField = 3.14
@delegate:Foo("field")
@delegate:JsAnnotation("field")
@delegate:CommonAnnotation("field")
actual val propertyWithDelegateField: Int by lazy { 42 }
actual val <@Foo("type-parameter") T : CharSequence> @receiver:Foo("receiver") T.propertyWithExtensionReceiver: Int
actual val <@JsAnnotation("type-parameter") @CommonAnnotation("type-parameter") T : CharSequence> @receiver:JsAnnotation("receiver") @receiver:CommonAnnotation("receiver") T.propertyWithExtensionReceiver: Int
get() = length
@Foo("function")
actual fun function1(@Foo("parameter") text: String) = text
@JsAnnotation("function")
@CommonAnnotation("function")
actual fun function1(@JsAnnotation("parameter") @CommonAnnotation("parameter") text: String) = text
@Foo("function")
actual fun <@Foo("type-parameter") Q : Number> @receiver:Foo("receiver") Q.function2() = this
@JsAnnotation("function")
@CommonAnnotation("function")
actual fun <@JsAnnotation("type-parameter") @CommonAnnotation("type-parameter") Q : @JsAnnotation("type1") @CommonAnnotation("type1") Number> @receiver:JsAnnotation("receiver") @receiver:CommonAnnotation("receiver") Q.function2(): @JsAnnotation("type2") @CommonAnnotation("type2") Q = this
@JsAnnotation("class")
@CommonAnnotation("class")
actual class AnnotatedClass @JsAnnotation("constructor") @CommonAnnotation("constructor") actual constructor(actual val value: String)
@JsAnnotation("type-alias")
@CommonAnnotation("type-alias")
actual typealias AnnotatedTypeAlias = AnnotatedClass
@@ -1,24 +1,50 @@
import kotlin.annotation.AnnotationTarget.*
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER)
annotation class Bar(val text: String)
@Target(ANNOTATION_CLASS)
actual annotation class CommonAnnotationForAnnotationClassesOnly actual constructor(actual val text: String)
@Bar("property")
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JvmAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")
actual annotation class CommonAnnotation actual constructor(actual val text: String)
@Target(ANNOTATION_CLASS)
annotation class JvmAnnotationForAnnotationClassesOnly(val text: String)
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JvmAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")
annotation class JvmAnnotation(val text: String)
@JvmAnnotation("property")
@CommonAnnotation("property")
actual var propertyWithoutBackingField
@Bar("getter") get() = 3.14
@Bar("setter") set(@Bar("parameter") value) = Unit
@JvmAnnotation("getter") @CommonAnnotation("getter") get() = 3.14
@JvmAnnotation("setter") @CommonAnnotation("setter") set(@JvmAnnotation("parameter") @CommonAnnotation("parameter") value) = Unit
@field:Bar("field")
@field:JvmAnnotation("field")
@field:CommonAnnotation("field")
actual val propertyWithBackingField = 3.14
@delegate:Bar("field")
@delegate:JvmAnnotation("field")
@delegate:CommonAnnotation("field")
actual val propertyWithDelegateField: Int by lazy { 42 }
actual val <@Bar("type-parameter") T : CharSequence> @receiver:Bar("receiver") T.propertyWithExtensionReceiver: Int
actual val <@JvmAnnotation("type-parameter") @CommonAnnotation("type-parameter") T : CharSequence> @receiver:JvmAnnotation("receiver") @receiver:CommonAnnotation("receiver") T.propertyWithExtensionReceiver: Int
get() = length
@Bar("function")
actual fun function1(@Bar("parameter") text: String) = text
@JvmAnnotation("function")
@CommonAnnotation("function")
actual fun function1(@JvmAnnotation("parameter") @CommonAnnotation("parameter") text: String) = text
@Bar("function")
actual fun <@Bar("type-parameter") Q : Number> @receiver:Bar("receiver") Q.function2() = this
@JvmAnnotation("function")
@CommonAnnotation("function")
actual fun <@JvmAnnotation("type-parameter") @CommonAnnotation("type-parameter") Q : @JvmAnnotation("type1") @CommonAnnotation("type1") Number> @receiver:JvmAnnotation("receiver") @receiver:CommonAnnotation("receiver") Q.function2(): @JvmAnnotation("type2") @CommonAnnotation("type2") Q = this
@JvmAnnotation("class")
@CommonAnnotation("class")
actual class AnnotatedClass @JvmAnnotation("constructor") @CommonAnnotation("constructor") actual constructor(actual val value: String)
@JvmAnnotation("type-alias")
@CommonAnnotation("type-alias")
actual typealias AnnotatedTypeAlias = AnnotatedClass
@@ -1,24 +1,50 @@
import kotlin.annotation.AnnotationTarget.*
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION)
annotation class Foo(val text: String)
@Target(ANNOTATION_CLASS)
annotation class CommonAnnotationForAnnotationClassesOnly(val text: String)
@Foo("property")
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JsAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")
annotation class CommonAnnotation(val text: String)
@Target(ANNOTATION_CLASS)
annotation class JsAnnotationForAnnotationClassesOnly(val text: String)
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JsAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")
annotation class JsAnnotation(val text: String)
@JsAnnotation("property")
@CommonAnnotation("property")
var propertyWithoutBackingField
@Foo("getter") get() = 3.14
@Foo("setter") set(@Foo("parameter") value) = Unit
@JsAnnotation("getter") @CommonAnnotation("getter") get() = 3.14
@JsAnnotation("setter") @CommonAnnotation("setter") set(@JsAnnotation("parameter") @CommonAnnotation("parameter") value) = Unit
@field:Foo("field")
@field:JsAnnotation("field")
@field:CommonAnnotation("field")
val propertyWithBackingField = 3.14
@delegate:Foo("field")
@delegate:JsAnnotation("field")
@delegate:CommonAnnotation("field")
val propertyWithDelegateField: Int by lazy { 42 }
val <@Foo("type-parameter") T : CharSequence> @receiver:Foo("receiver") T.propertyWithExtensionReceiver: Int
val <@JsAnnotation("type-parameter") @CommonAnnotation("type-parameter") T : CharSequence> @receiver:JsAnnotation("receiver") @receiver:CommonAnnotation("receiver") T.propertyWithExtensionReceiver: Int
get() = length
@Foo("function")
fun function1(@Foo("parameter") text: String) = text
@JsAnnotation("function")
@CommonAnnotation("function")
fun function1(@JsAnnotation("parameter") @CommonAnnotation("parameter") text: String) = text
@Foo("function")
fun <@Foo("type-parameter") Q : Number> @receiver:Foo("receiver") Q.function2() = this
@JsAnnotation("function")
@CommonAnnotation("function")
fun <@JsAnnotation("type-parameter") @CommonAnnotation("type-parameter") Q : @JsAnnotation("type1") @CommonAnnotation("type1") Number> @receiver:JsAnnotation("receiver") @receiver:CommonAnnotation("receiver") Q.function2(): @JsAnnotation("type2") @CommonAnnotation("type2") Q = this
@JsAnnotation("class")
@CommonAnnotation("class")
class AnnotatedClass @JsAnnotation("constructor") @CommonAnnotation("constructor") constructor(val value: String)
@JsAnnotation("type-alias")
@CommonAnnotation("type-alias")
typealias AnnotatedTypeAlias = AnnotatedClass
@@ -1,24 +1,50 @@
import kotlin.annotation.AnnotationTarget.*
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER)
annotation class Bar(val text: String)
@Target(ANNOTATION_CLASS)
annotation class CommonAnnotationForAnnotationClassesOnly(val text: String)
@Bar("property")
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JvmAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")
annotation class CommonAnnotation(val text: String)
@Target(ANNOTATION_CLASS)
annotation class JvmAnnotationForAnnotationClassesOnly(val text: String)
@Target(PROPERTY, PROPERTY_GETTER, PROPERTY_SETTER, FIELD, VALUE_PARAMETER, TYPE_PARAMETER, FUNCTION, CLASS, CONSTRUCTOR, TYPEALIAS, TYPE)
@JvmAnnotationForAnnotationClassesOnly("annotation-class")
@CommonAnnotationForAnnotationClassesOnly("annotation-class")
annotation class JvmAnnotation(val text: String)
@JvmAnnotation("property")
@CommonAnnotation("property")
var propertyWithoutBackingField
@Bar("getter") get() = 3.14
@Bar("setter") set(@Bar("parameter") value) = Unit
@JvmAnnotation("getter") @CommonAnnotation("getter") get() = 3.14
@JvmAnnotation("setter") @CommonAnnotation("setter") set(@JvmAnnotation("parameter") @CommonAnnotation("parameter") value) = Unit
@field:Bar("field")
@field:JvmAnnotation("field")
@field:CommonAnnotation("field")
val propertyWithBackingField = 3.14
@delegate:Bar("field")
@delegate:JvmAnnotation("field")
@delegate:CommonAnnotation("field")
val propertyWithDelegateField: Int by lazy { 42 }
val <@Bar("type-parameter") T : CharSequence> @receiver:Bar("receiver") T.propertyWithExtensionReceiver: Int
val <@JvmAnnotation("type-parameter") @CommonAnnotation("type-parameter") T : CharSequence> @receiver:JvmAnnotation("receiver") @receiver:CommonAnnotation("receiver") T.propertyWithExtensionReceiver: Int
get() = length
@Bar("function")
fun function1(@Bar("parameter") text: String) = text
@JvmAnnotation("function")
@CommonAnnotation("function")
fun function1(@JvmAnnotation("parameter") @CommonAnnotation("parameter") text: String) = text
@Bar("function")
fun <@Bar("type-parameter") Q : Number> @receiver:Bar("receiver") Q.function2() = this
@JvmAnnotation("function")
@CommonAnnotation("function")
fun <@JvmAnnotation("type-parameter") @CommonAnnotation("type-parameter") Q : @JvmAnnotation("type1") @CommonAnnotation("type1") Number> @receiver:JvmAnnotation("receiver") @receiver:CommonAnnotation("receiver") Q.function2(): @JvmAnnotation("type2") @CommonAnnotation("type2") Q = this
@JvmAnnotation("class")
@CommonAnnotation("class")
class AnnotatedClass @JvmAnnotation("constructor") @CommonAnnotation("constructor") constructor(val value: String)
@JvmAnnotation("type-alias")
@CommonAnnotation("type-alias")
typealias AnnotatedTypeAlias = AnnotatedClass
@@ -12,6 +12,10 @@ import org.jetbrains.kotlin.cli.jvm.compiler.KotlinCoreEnvironment
import org.jetbrains.kotlin.config.CommonConfigurationKeys
import org.jetbrains.kotlin.config.languageVersionSettings
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.jetbrains.kotlin.descriptors.commonizer.utils.assertCommonizationPerformed
import org.jetbrains.kotlin.descriptors.commonizer.utils.assertIsDirectory
import org.jetbrains.kotlin.descriptors.commonizer.utils.assertModulesAreEqual
import org.jetbrains.kotlin.descriptors.commonizer.utils.assertValidModule
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.psi.KtPsiFactory
import org.jetbrains.kotlin.test.KotlinTestUtils.*
@@ -130,6 +134,8 @@ abstract class AbstractCommonizationFromSourcesTest : KtUsefulTestCase() {
val commonModuleAsExpected = commonizedModules.getValue("common")
val commonModuleByCommonizer = result.commonModules.single()
assertValidModule(commonModuleAsExpected)
assertValidModule(commonModuleByCommonizer)
assertModulesAreEqual(commonModuleAsExpected, commonModuleByCommonizer, "\"common\" target")
val concreteTargetNames = commonizedModules.keys - "common"
@@ -139,6 +145,8 @@ abstract class AbstractCommonizationFromSourcesTest : KtUsefulTestCase() {
val targetModuleAsExpected = commonizedModules.getValue(targetName)
val targetModuleByCommonizer = result.modulesByTargets.getValue(targetName).single()
assertValidModule(targetModuleAsExpected)
assertValidModule(targetModuleByCommonizer)
assertModulesAreEqual(targetModuleAsExpected, targetModuleByCommonizer, "\"$targetName\" target")
}
}
@@ -15,7 +15,4 @@ class CallableMemberCommonizationFromSourcesTest : AbstractCommonizationFromSour
fun testReturnTypes() = doTestSuccessfulCommonization()
fun testExtensionReceivers() = doTestSuccessfulCommonization()
// TODO: test modality (possible only inside classes)
// TODO: test virtual val/fun visibility commonization (possible only inside classes)
}
@@ -0,0 +1,26 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.descriptors.commonizer
import kotlin.contracts.ExperimentalContracts
@ExperimentalContracts
class ClassifierCommonizationFromSourcesTest : AbstractCommonizationFromSourcesTest() {
fun testClassKindAndModifiers() = doTestSuccessfulCommonization()
fun testModality() = doTestSuccessfulCommonization()
fun testVisibility() = doTestSuccessfulCommonization()
fun testConstructors() = doTestSuccessfulCommonization()
fun testTypeParameters() = doTestSuccessfulCommonization()
fun testSupertypes() = doTestSuccessfulCommonization()
fun testTypeAliases() = doTestSuccessfulCommonization()
}
@@ -6,9 +6,11 @@
package org.jetbrains.kotlin.descriptors.commonizer
import org.jetbrains.kotlin.descriptors.ModuleDescriptor
import org.junit.Assert.*
import kotlin.test.*
import org.junit.Test
import org.jetbrains.kotlin.descriptors.commonizer.AbstractCommonizationFromSourcesTest.Companion.eachModuleAsTarget
import org.jetbrains.kotlin.descriptors.commonizer.utils.assertCommonizationPerformed
import org.jetbrains.kotlin.descriptors.commonizer.utils.mockEmptyModule
import kotlin.contracts.ExperimentalContracts
@ExperimentalContracts
@@ -5,8 +5,8 @@
package org.jetbrains.kotlin.descriptors.commonizer.core
import org.junit.Assert.*
import org.junit.Test
import kotlin.test.*
abstract class AbstractCommonizerTest<T, R> {
@@ -6,9 +6,9 @@
package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.commonizer.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.utils.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.ExtensionReceiver
import org.jetbrains.kotlin.descriptors.commonizer.mockClassType
import org.jetbrains.kotlin.descriptors.commonizer.utils.mockClassType
import org.jetbrains.kotlin.types.UnwrappedType
import org.jetbrains.kotlin.types.refinement.TypeRefinement
import org.junit.Test
@@ -11,8 +11,8 @@ import org.jetbrains.kotlin.descriptors.commonizer.CommonizedGroupMap
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.RootNode.ClassifiersCacheImpl
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.buildClassNode
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.buildTypeAliasNode
import org.jetbrains.kotlin.descriptors.commonizer.mockClassType
import org.jetbrains.kotlin.descriptors.commonizer.mockTAType
import org.jetbrains.kotlin.descriptors.commonizer.utils.mockClassType
import org.jetbrains.kotlin.descriptors.commonizer.utils.mockTAType
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.storage.LockBasedStorageManager
@@ -5,10 +5,10 @@
package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.commonizer.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.utils.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.CommonTypeParameter
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.TypeParameter
import org.jetbrains.kotlin.descriptors.commonizer.mockClassType
import org.jetbrains.kotlin.descriptors.commonizer.utils.mockClassType
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.Variance
import org.jetbrains.kotlin.types.refinement.TypeRefinement
@@ -5,7 +5,7 @@
package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.commonizer.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.utils.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.TypeParameter
import org.jetbrains.kotlin.types.refinement.TypeRefinement
import org.junit.Test
@@ -6,11 +6,11 @@
package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.commonizer.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.utils.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.core.TestValueParameter.Companion.areEqual
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.ClassifiersCache
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.ValueParameter
import org.jetbrains.kotlin.descriptors.commonizer.mockClassType
import org.jetbrains.kotlin.descriptors.commonizer.utils.mockClassType
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.UnwrappedType
import org.jetbrains.kotlin.types.refinement.TypeRefinement
@@ -5,7 +5,7 @@
package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.commonizer.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.utils.EMPTY_CLASSIFIERS_CACHE
import org.jetbrains.kotlin.descriptors.commonizer.core.TestValueParameter.Companion.areEqual
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.ValueParameter
import org.jetbrains.kotlin.types.refinement.TypeRefinement
@@ -7,8 +7,10 @@ package org.jetbrains.kotlin.descriptors.commonizer.core
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.Visibilities.*
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.DeclarationWithVisibility
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.MaybeVirtualCallableMember
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.ir.*
import org.jetbrains.kotlin.name.Name
import org.jetbrains.kotlin.types.UnwrappedType
import org.junit.Test
abstract class LoweringVisibilityCommonizerTest(
@@ -30,9 +32,19 @@ abstract class LoweringVisibilityCommonizerTest(
final override fun createCommonizer() = VisibilityCommonizer.lowering(allowPrivate = allowPrivate)
protected fun Visibility.toMock() = object : MaybeVirtualCallableMember {
protected fun Visibility.toMock() = object : FunctionOrProperty {
override val visibility: Visibility = this@toMock
override val isVirtual: Boolean = !isPrivate(visibility) && areMembersVirtual
override val modality: Modality get() = if (areMembersVirtual) Modality.OPEN else Modality.FINAL
override val containingClassModality: Modality? get() = if (areMembersVirtual) Modality.OPEN else null
override val containingClassKind: ClassKind? get() = if (areMembersVirtual) ClassKind.CLASS else null
override val isExternal: Boolean get() = unsupported()
override val extensionReceiver: ExtensionReceiver? get() = unsupported()
override val returnType: UnwrappedType get() = unsupported()
override val kind: CallableMemberDescriptor.Kind get() = unsupported()
override val annotations: Annotations get() = unsupported()
override val name: Name get() = unsupported()
override val containingClassIsData: Boolean? get() = unsupported()
override val typeParameters: List<TypeParameter> get() = unsupported()
}
class PrivateMembers : LoweringVisibilityCommonizerTest(true, false) {
@@ -3,47 +3,25 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.descriptors.commonizer
package org.jetbrains.kotlin.descriptors.commonizer.utils
import junit.framework.TestCase.fail
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations
import org.jetbrains.kotlin.descriptors.commonizer.fqName
import org.jetbrains.kotlin.descriptors.commonizer.fqNameWithTypeParameters
import org.jetbrains.kotlin.descriptors.commonizer.isNull
import org.jetbrains.kotlin.descriptors.commonizer.mergedtree.*
import org.jetbrains.kotlin.name.FqName
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
import org.jetbrains.kotlin.resolve.scopes.MemberScope
import org.jetbrains.kotlin.types.KotlinType
import org.jetbrains.kotlin.types.getAbbreviation
import java.io.File
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.reflect.KCallable
fun assertIsDirectory(file: File) {
if (!file.isDirectory)
fail("Not a directory: $file")
}
import kotlin.test.fail
@ExperimentalContracts
fun assertCommonizationPerformed(result: CommonizationResult) {
contract {
returns() implies (result is CommonizationPerformed)
}
if (result !is CommonizationPerformed)
fail("$result is not instance of ${CommonizationPerformed::class}")
}
@ExperimentalContracts
fun assertModulesAreEqual(expected: ModuleDescriptor, actual: ModuleDescriptor, designatorMessage: String) {
val visitor = ComparingDeclarationsVisitor(designatorMessage)
val context = visitor.Context(actual)
expected.accept(visitor, context)
}
@ExperimentalContracts
private class ComparingDeclarationsVisitor(
internal class ComparingDeclarationsVisitor(
val designatorMessage: String
) : DeclarationDescriptorVisitor<Unit, ComparingDeclarationsVisitor.Context> {
@@ -91,7 +69,7 @@ private class ComparingDeclarationsVisitor(
}
}
fun visitMemberScopes(expected: MemberScope, actual: MemberScope, context: Context) {
private fun visitMemberScopes(expected: MemberScope, actual: MemberScope, context: Context) {
val expectedProperties = mutableMapOf<PropertyApproximationKey, PropertyDescriptor>()
val expectedFunctions = mutableMapOf<FunctionApproximationKey, SimpleFunctionDescriptor>()
val expectedClasses = mutableMapOf<FqName, ClassDescriptor>()
@@ -162,10 +140,16 @@ private class ComparingDeclarationsVisitor(
context.assertFieldsEqual(expected::isSuspend, actual::isSuspend)
context.assertFieldsEqual(expected::isExternal, actual::isExternal)
context.assertFieldsEqual(expected::isExpect, actual::isExpect)
context.assertFieldsEqual(expected::isActual, actual::isActual)
context.assertFieldsEqual(expected::hasStableParameterNames, actual::hasStableParameterNames)
context.assertFieldsEqual(expected::hasSynthesizedParameterNames, actual::hasSynthesizedParameterNames)
if (!expected.isActual || actual.kind != CallableMemberDescriptor.Kind.DELEGATION) {
context.assertFieldsEqual(expected::isActual, actual::isActual)
} /* else {
// don't check, because there can be any value in expect.isActual
// see org.jetbrains.kotlin.resolve.DelegationResolver
} */
visitType(expected.returnType, actual.returnType, context.nextLevel("Function type"))
visitValueParameterDescriptorList(expected.valueParameters, actual.valueParameters, context.nextLevel("Function value parameters"))
@@ -176,7 +160,7 @@ private class ComparingDeclarationsVisitor(
visitTypeParameters(expected.typeParameters, actual.typeParameters, context.nextLevel("Function type parameters"))
}
fun visitValueParameterDescriptorList(
private fun visitValueParameterDescriptorList(
expected: List<ValueParameterDescriptor>,
actual: List<ValueParameterDescriptor>,
context: Context
@@ -339,9 +323,17 @@ private class ComparingDeclarationsVisitor(
context.assertFieldsEqual(expected::isConst, actual::isConst)
context.assertFieldsEqual(expected::isExternal, actual::isExternal)
context.assertFieldsEqual(expected::isExpect, actual::isExpect)
context.assertFieldsEqual(expected::isActual, actual::isActual)
if (!expected.isActual || actual.kind != CallableMemberDescriptor.Kind.DELEGATION) {
context.assertFieldsEqual(expected::isActual, actual::isActual)
} /* else {
// don't check, because there can be any value in expect.isActual
// see org.jetbrains.kotlin.resolve.DelegationResolver
} */
@Suppress("DEPRECATION")
context.assertFieldsEqual(expected::isDelegated, actual::isDelegated)
visitAnnotations(
expected.delegateField?.annotations,
actual.delegateField?.annotations,
@@ -352,6 +344,7 @@ private class ComparingDeclarationsVisitor(
actual.backingField?.annotations,
context.nextLevel("Property backing field annotations")
)
context.assertEquals(expected.compileTimeInitializer.isNull(), actual.compileTimeInitializer.isNull(), "compile-time initializers")
visitType(expected.type, actual.type, context.nextLevel("Property type"))
@@ -0,0 +1,76 @@
/*
* Copyright 2010-2019 JetBrains s.r.o. and Kotlin Programming Language contributors.
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.descriptors.commonizer.utils
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.commonizer.CommonizationPerformed
import org.jetbrains.kotlin.descriptors.commonizer.CommonizationResult
import org.jetbrains.kotlin.test.util.DescriptorValidator.*
import org.jetbrains.kotlin.types.ErrorUtils
import java.io.File
import kotlin.contracts.ExperimentalContracts
import kotlin.contracts.contract
import kotlin.test.assertFalse
import kotlin.test.fail
fun assertIsDirectory(file: File) {
if (!file.isDirectory)
fail("Not a directory: $file")
}
@ExperimentalContracts
fun assertCommonizationPerformed(result: CommonizationResult) {
contract {
returns() implies (result is CommonizationPerformed)
}
if (result !is CommonizationPerformed)
fail("$result is not instance of ${CommonizationPerformed::class}")
}
@ExperimentalContracts
fun assertModulesAreEqual(expected: ModuleDescriptor, actual: ModuleDescriptor, designatorMessage: String) {
val visitor = ComparingDeclarationsVisitor(designatorMessage)
val context = visitor.Context(actual)
expected.accept(visitor, context)
}
fun assertValidModule(module: ModuleDescriptor) = validate(
object : ValidationVisitor() {
override fun visitModuleDeclaration(descriptor: ModuleDescriptor, collector: DiagnosticCollector): Boolean {
assertValid(descriptor)
return super.visitModuleDeclaration(descriptor, collector)
}
override fun visitClassDescriptor(descriptor: ClassDescriptor, collector: DiagnosticCollector): Boolean {
assertValid(descriptor)
return super.visitClassDescriptor(descriptor, collector)
}
override fun visitFunctionDescriptor(descriptor: FunctionDescriptor, collector: DiagnosticCollector): Boolean {
assertValid(descriptor)
return super.visitFunctionDescriptor(descriptor, collector)
}
override fun visitPropertyDescriptor(descriptor: PropertyDescriptor, collector: DiagnosticCollector): Boolean {
assertValid(descriptor)
return super.visitPropertyDescriptor(descriptor, collector)
}
override fun visitConstructorDescriptor(constructorDescriptor: ConstructorDescriptor, collector: DiagnosticCollector): Boolean {
assertValid(constructorDescriptor)
return super.visitConstructorDescriptor(constructorDescriptor, collector)
}
},
module
)
@Suppress("NOTHING_TO_INLINE")
private inline fun assertValid(descriptor: DeclarationDescriptor) = when (descriptor) {
is ModuleDescriptor -> descriptor.assertValid()
else -> assertFalse(ErrorUtils.isError(descriptor), "$descriptor is error")
}
@@ -3,7 +3,7 @@
* Use of this source code is governed by the Apache 2.0 license that can be found in the license/LICENSE.txt file.
*/
package org.jetbrains.kotlin.descriptors.commonizer
package org.jetbrains.kotlin.descriptors.commonizer.utils
import org.jetbrains.kotlin.descriptors.*
import org.jetbrains.kotlin.descriptors.annotations.Annotations