TypeScript/tests/baselines/reference/derivedClassWithPrivateStaticShadowingPublicStatic.errors.txt

65 lines
4 KiB
Text
Raw Normal View History

tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(7,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(8,23): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(19,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(20,24): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(13,7): error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'.
Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'.
2014-09-19 15:37:55 +02:00
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(24,10): error TS2341: Property 'x' is private and only accessible within class 'Derived'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(27,10): error TS2341: Property 'fn' is private and only accessible within class 'Derived'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(32,10): error TS2341: Property 'a' is private and only accessible within class 'Derived'.
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts(33,1): error TS2341: Property 'a' is private and only accessible within class 'Derived'.
2014-07-13 01:04:16 +02:00
==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateStaticShadowingPublicStatic.ts (9 errors) ====
class Base {
public static x: string;
public static fn(): string {
return '';
}
public static get a() { return 1; }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
public static set a(v) { }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
}
// BUG 847404
// should be error
class Derived extends Base {
~~~~~~~
!!! error TS2417: Class static side 'typeof Derived' incorrectly extends base class static side 'typeof Base'.
!!! error TS2417: Property 'x' is private in type 'typeof Derived' but not in type 'typeof Base'.
2014-07-13 01:04:16 +02:00
private static x: string;
private static fn(): string {
return '';
}
private static get a() { return 1; }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
private static set a(v) { }
~
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
2014-07-13 01:04:16 +02:00
}
var r = Base.x; // ok
var r2 = Derived.x; // error
~~~~~~~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'x' is private and only accessible within class 'Derived'.
2014-07-13 01:04:16 +02:00
var r3 = Base.fn(); // ok
var r4 = Derived.fn(); // error
~~~~~~~~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'fn' is private and only accessible within class 'Derived'.
2014-07-13 01:04:16 +02:00
var r5 = Base.a; // ok
Base.a = 2; // ok
var r6 = Derived.a; // error
~~~~~~~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'a' is private and only accessible within class 'Derived'.
2014-07-13 01:04:16 +02:00
Derived.a = 2; // error
~~~~~~~~~
2014-09-19 15:37:55 +02:00
!!! error TS2341: Property 'a' is private and only accessible within class 'Derived'.