godotjs / godotjs/javascript

Typescript complains when trying to use operators such as += on Vector2

Aperta
#96 3 commenti 0 reazioni 0 assegnatari Vedi su GitHub
documentation investigation
Lingua principale
C++
Stelle
1.1k
Fork
80
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

e.g. Something like this:

```typescript
this.position += new godot.Vector2(this.velocity * delta)
```

Will generate the following error in typescript:

```error
Operator '+=' cannot be applied to types 'godot.Vector2' and this.position + 'godot.
—————————————————
The left-hand side of an arithmetic operation must be of type godot.register_property 'any', 'number', 'bigint' or an enum type.
```

Is this an error on my part of a problem wit the type declaration?

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.