Closed
Description
I have:
class Vector2 {
public constructor(
public x: f64 = 0,
public y: f64 = 0
) {}
get X(): f64 {
return this.x
}
set X(val: f64) {
this.x = val
}
}
const v = new Vector2(1, 2)
const x: string = v.x.toString() // works fine
const X: string = v.X.toString() // ERROR TS2339: Property 'toString' does not exist on type 'f64'.
The use of toString
doesn't work on the result of the getter.