All Downloads are FREE. Search and download functionalities are using the official Maven repository.

godot.annotation.processor.ext.ksValueParameterExt.kt Maven / Gradle / Ivy

There is a newer version: 0.10.0-4.3.0
Show newest version
package godot.annotation.processor.ext

import com.google.devtools.ksp.symbol.KSValueParameter
import godot.annotation.processor.Settings
import godot.entrygenerator.model.ValueParameter

internal fun KSValueParameter.mapToValueParameter(
    settings: Settings,
): ValueParameter {
    val resolvedType = type.resolve()
    return ValueParameter(
        requireNotNull(name?.asString()) {
            "name cannot be null for parameter"
        },
        requireNotNull(type.mapToType(settings)) {
            "type cannot be null for parameter"
        },
        resolvedType.arguments.map {
            requireNotNull(it.type) {
                "typeArgument's type of type $type cannot be null"
            }.mapToType(settings)
        }
    )
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy