mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
26 lines
482 B
TypeScript
26 lines
482 B
TypeScript
//// [tests/cases/conformance/interfaces/interfacesExtendingClasses/interfaceExtendingClassWithProtecteds.ts] ////
|
|
|
|
//// [interfaceExtendingClassWithProtecteds.ts]
|
|
class Foo {
|
|
protected x!: string;
|
|
}
|
|
|
|
interface I extends Foo { // error
|
|
x: string;
|
|
}
|
|
|
|
interface I2 extends Foo {
|
|
y: string;
|
|
}
|
|
|
|
declare var i: I2;
|
|
var r = i.y;
|
|
var r2 = i.x; // error
|
|
|
|
//// [interfaceExtendingClassWithProtecteds.js]
|
|
"use strict";
|
|
class Foo {
|
|
}
|
|
var r = i.y;
|
|
var r2 = i.x; // error
|