typescript unresolved variable "x" on a child class Atribute
Hi,
I have these TS files:
Vehicle.ts:
class Vehicle {
....
public name:string;
....
}
Car.ts:
}
Car.ts:
class Car extends Vehicle {
constructor() {
super();
this.name = "Car";
...
}
...
}
Every thing compiles perfect on TS but PHPStorm is marking all reference to name (that is declared on parent's (Vehicle)) as an error telling me that "unresolved variable name".
Same thing if a use a method declared on parent it marks as an error if I try to use it on child class.
I try then to uncheck the "Unresolved Javascript variable" on inspector's pannel, but errors are still there
Am'I doing something wrong ???
constructor() {
super();
this.name = "Car";
...
}
...
}
Every thing compiles perfect on TS but PHPStorm is marking all reference to name (that is declared on parent's (Vehicle)) as an error telling me that "unresolved variable name".
Same thing if a use a method declared on parent it marks as an error if I try to use it on child class.
I try then to uncheck the "Unresolved Javascript variable" on inspector's pannel, but errors are still there
Am'I doing something wrong ???
Please sign in to leave a comment.
//car.ts
///<reference path='vehicle.ts'/>
class Car extends Vehicle {
constructor() {
super();
this.name = "Car";
}
}
//vehicle.ts
class Vehicle {
public name:string;
}
Works fine for me in the latest Webstorm
Hi Joshua,
just to clarify: do you mean that the problem has gone after upgrading to the latest Webstorm?
Best regards,
Lena
OP didn't mention which version they were using. But I
attempted to recreate in Webstorm EAP with no errors. Just wanting to help out "fellow" typescripters. I'm really wanting WS to be a solid typescript product.