mirror of
https://github.com/hanzoai/tsgo.git
synced 2026-10-30 19:37:15 +00:00
37 lines
675 B
TypeScript
37 lines
675 B
TypeScript
//// [tests/cases/compiler/classSideInheritance2.ts] ////
|
|
|
|
//// [classSideInheritance2.ts]
|
|
interface IText {
|
|
foo: number;
|
|
}
|
|
|
|
interface TextSpan {}
|
|
|
|
class SubText extends TextBase {
|
|
|
|
constructor(text: IText, span: TextSpan) {
|
|
super();
|
|
}
|
|
}
|
|
|
|
class TextBase implements IText {
|
|
public foo: number;
|
|
public subText(span: TextSpan): IText {
|
|
|
|
return new SubText(this, span);
|
|
}
|
|
}
|
|
|
|
//// [classSideInheritance2.js]
|
|
"use strict";
|
|
class SubText extends TextBase {
|
|
constructor(text, span) {
|
|
super();
|
|
}
|
|
}
|
|
class TextBase {
|
|
subText(span) {
|
|
return new SubText(this, span);
|
|
}
|
|
}
|