f1a2e41a8a
This was we don't get noisy baselines just because a different phase of the compiler reported the diagnostic. This helps with Yui's refactoring work to move grammar checks into the type checker.
76 lines
4.8 KiB
Plaintext
76 lines
4.8 KiB
Plaintext
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(7,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(8,16): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(12,7): error TS2415: Class 'Derived' incorrectly extends base class 'Base'.
|
|
Property 'x' is private in type 'Derived' but not in type 'Base'.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(18,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(19,17): error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(22,14): error TS2339: Property 'x' does not exist on type 'typeof Base'.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(23,18): error TS2339: Property 'x' does not exist on type 'typeof Derived'.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(25,15): error TS2339: Property 'fn' does not exist on type 'typeof Base'.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(26,18): error TS2339: Property 'fn' does not exist on type 'typeof Derived'.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(28,15): error TS2339: Property 'a' does not exist on type 'typeof Base'.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(29,6): error TS2339: Property 'a' does not exist on type 'typeof Base'.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(31,18): error TS2339: Property 'a' does not exist on type 'typeof Derived'.
|
|
tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts(32,9): error TS2339: Property 'a' does not exist on type 'typeof Derived'.
|
|
|
|
|
|
==== tests/cases/conformance/classes/members/inheritanceAndOverriding/derivedClassWithPrivateInstanceShadowingPublicInstance.ts (13 errors) ====
|
|
class Base {
|
|
public x: string;
|
|
public fn(): string {
|
|
return '';
|
|
}
|
|
|
|
public get a() { return 1; }
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
public set a(v) { }
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
}
|
|
|
|
// error, not a subtype
|
|
class Derived extends Base {
|
|
~~~~~~~
|
|
!!! error TS2415: Class 'Derived' incorrectly extends base class 'Base'.
|
|
!!! error TS2415: Property 'x' is private in type 'Derived' but not in type 'Base'.
|
|
private x: string;
|
|
private fn(): string {
|
|
return '';
|
|
}
|
|
|
|
private get a() { return 1; }
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
private set a(v) { }
|
|
~
|
|
!!! error TS1056: Accessors are only available when targeting ECMAScript 5 and higher.
|
|
}
|
|
|
|
var r = Base.x; // ok
|
|
~
|
|
!!! error TS2339: Property 'x' does not exist on type 'typeof Base'.
|
|
var r2 = Derived.x; // error
|
|
~
|
|
!!! error TS2339: Property 'x' does not exist on type 'typeof Derived'.
|
|
|
|
var r3 = Base.fn(); // ok
|
|
~~
|
|
!!! error TS2339: Property 'fn' does not exist on type 'typeof Base'.
|
|
var r4 = Derived.fn(); // error
|
|
~~
|
|
!!! error TS2339: Property 'fn' does not exist on type 'typeof Derived'.
|
|
|
|
var r5 = Base.a; // ok
|
|
~
|
|
!!! error TS2339: Property 'a' does not exist on type 'typeof Base'.
|
|
Base.a = 2; // ok
|
|
~
|
|
!!! error TS2339: Property 'a' does not exist on type 'typeof Base'.
|
|
|
|
var r6 = Derived.a; // error
|
|
~
|
|
!!! error TS2339: Property 'a' does not exist on type 'typeof Derived'.
|
|
Derived.a = 2; // error
|
|
~
|
|
!!! error TS2339: Property 'a' does not exist on type 'typeof Derived'. |