utopia-rise / godot-kotlin-jvm

Godot Kotlin JVM Module
MIT License
562 stars 38 forks source link

False-positive warning on CoreTypes value copy #604

Open gabryon99 opened 3 months ago

gabryon99 commented 3 months ago

When creating a copy of property from a Godot CoreType, I get the following warning:

You're modifying a copy of a CoreType. Reassign it directly or use a core type modification helper. For more information, visit the documentation. This warning is experimental! If you encounter any false positives, please write an issue with a minimal reproduction project

This is the code that triggers the warning is the following:

@RegisterClass
class Simple : Node() {
    @Export
    @RegisterProperty
    lateinit var myNode: Node3D

    @RegisterFunction
    override fun _process(delta: Double) {
        val myNodeAngle = myNode.rotation.y // ⬅️ WARNING HERE!!!
    }
}