TypeScript/tests/cases/compiler/classStaticPropertyAccess.ts
Alexander T 37b9a6bca4 25840 - Add a more meaningful error message to the case when calling a public static method on an instance (#25922)
* add a more meaningful error message to the case when calling a public static method on an instance

* Fix tests
2018-08-06 10:24:48 -07:00

16 lines
235 B
TypeScript

// @strict: true
// @target: ES5
class A {
public static x: number = 1;
public static y: number = 1;
private static _b: number = 2;
}
const a = new A();
a['y'] // Error
a.y // Error
A._b // Error
A.a