mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
43 lines
709 B
TypeScript
43 lines
709 B
TypeScript
//// [tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds2.ts] ////
|
|
|
|
//// [interfaceExtendingClassWithProtecteds2.ts]
|
|
class Foo {
|
|
protected x!: string;
|
|
}
|
|
|
|
class Bar {
|
|
protected x!: string;
|
|
}
|
|
|
|
interface I3 extends Foo, Bar { // error
|
|
}
|
|
|
|
interface I4 extends Foo, Bar { // error
|
|
x: string;
|
|
}
|
|
|
|
class Baz {
|
|
protected y!: string;
|
|
}
|
|
|
|
interface I5 extends Foo, Baz {
|
|
z: string;
|
|
}
|
|
|
|
declare var i: I5;
|
|
var r: string = i.z;
|
|
var r2 = i.x; // error
|
|
var r3 = i.y; // error
|
|
|
|
//// [interfaceExtendingClassWithProtecteds2.js]
|
|
"use strict";
|
|
class Foo {
|
|
}
|
|
class Bar {
|
|
}
|
|
class Baz {
|
|
}
|
|
var r = i.z;
|
|
var r2 = i.x; // error
|
|
var r3 = i.y; // error
|