Skip to content

copy

context(session: KaSession)
fun <T : KaClassType> T.copy(init: KaClassTypeBuilder.() -> Unit): KaClassType

Creates a copy of this KaClassType with modifications applied via the init block.

The builder is pre-populated with the properties of the original type. The init block can then selectively override these properties.

Example:

val nullableListOfString = listOfStringType.copy {
    isMarkedNullable = true
}

See also

Creates a copy of this KaUsualClassType with modifications applied via the init block.

The builder is pre-populated with the properties of the original type. The init block can then selectively override these properties.

Example:

val nullableListOfString = listOfStringType.copy {
    isMarkedNullable = true
}

See also

Creates a copy of this KaFunctionType with modifications applied via the init block.

The builder is pre-populated with the properties of the original type. The init block can then selectively override these properties.

Example:

val suspendVersion = functionType.copy {
    isSuspend = true
}

See also

Creates a copy of this KaTypeParameterType with modifications applied via the init block.

The builder is pre-populated with the properties of the original type. The init block can then selectively override these properties.

Example:

val nullableT = typeParameterType.copy {
    isMarkedNullable = true
}

See also