godot.entrygenerator.exceptions.WrongAnnotationUsageException.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of godot-kotlin-entry-generator Show documentation
Show all versions of godot-kotlin-entry-generator Show documentation
Godot Kotlin entry code generator.
The newest version!
package godot.entrygenerator.exceptions
import org.jetbrains.kotlin.descriptors.PropertyDescriptor
import org.jetbrains.kotlin.descriptors.annotations.AnnotationDescriptor
import org.jetbrains.kotlin.resolve.descriptorUtil.fqNameSafe
class WrongAnnotationUsageException(
propertyDescriptor: PropertyDescriptor,
propertyHintAnnotation: AnnotationDescriptor?,
effectiveType: String? = null
) : Exception(
"You annotated ${propertyDescriptor.fqNameSafe} with @${propertyHintAnnotation?.fqName?.asString()?.split(".")?.last()} which ${if (effectiveType != null) "is only applicable to properties of type $effectiveType" else "cannot be applied on properties of type ${propertyDescriptor.type}"}"
)