Added tests.
This commit is contained in:
parent
c9170b81a8
commit
1ab10adbdc
3 changed files with 145 additions and 0 deletions
|
@ -0,0 +1,47 @@
|
||||||
|
// @noImplicitAny: true
|
||||||
|
|
||||||
|
interface A {
|
||||||
|
numProp: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
strProp: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
method1(arg: A): void;
|
||||||
|
method2(arg: B): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo1(): Foo {
|
||||||
|
return class {
|
||||||
|
static method1(arg) {
|
||||||
|
arg.numProp = 10;
|
||||||
|
}
|
||||||
|
static method2(arg) {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo2(): Foo {
|
||||||
|
return class {
|
||||||
|
static method1 = (arg) => {
|
||||||
|
arg.numProp = 10;
|
||||||
|
}
|
||||||
|
static method2 = (arg) => {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo3(): Foo {
|
||||||
|
return class {
|
||||||
|
static method1 = function (arg) {
|
||||||
|
arg.numProp = 10;
|
||||||
|
}
|
||||||
|
static method2 = function (arg) {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,51 @@
|
||||||
|
// @noImplicitAny: true
|
||||||
|
|
||||||
|
interface A {
|
||||||
|
numProp: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
strProp: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
new (): Bar;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Bar {
|
||||||
|
method1(arg: A): void;
|
||||||
|
method2(arg: B): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo1(): Foo {
|
||||||
|
return class {
|
||||||
|
method1(arg) {
|
||||||
|
arg.numProp = 10;
|
||||||
|
}
|
||||||
|
method2(arg) {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo2(): Foo {
|
||||||
|
return class {
|
||||||
|
method1 = (arg) => {
|
||||||
|
arg.numProp = 10;
|
||||||
|
}
|
||||||
|
method2 = (arg) => {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo3(): Foo {
|
||||||
|
return class {
|
||||||
|
method1 = function (arg) {
|
||||||
|
arg.numProp = 10;
|
||||||
|
}
|
||||||
|
method2 = function (arg) {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
// @noImplicitAny: true
|
||||||
|
|
||||||
|
interface A {
|
||||||
|
numProp: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface B {
|
||||||
|
strProp: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Foo {
|
||||||
|
method1(arg: A): void;
|
||||||
|
method2(arg: B): void;
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo1(): Foo {
|
||||||
|
return {
|
||||||
|
method1(arg) {
|
||||||
|
arg.numProp = 10;
|
||||||
|
},
|
||||||
|
method2(arg) {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo2(): Foo {
|
||||||
|
return {
|
||||||
|
method1: (arg) => {
|
||||||
|
arg.numProp = 10;
|
||||||
|
},
|
||||||
|
method2: (arg) => {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function getFoo3(): Foo {
|
||||||
|
return {
|
||||||
|
method1: function (arg) {
|
||||||
|
arg.numProp = 10;
|
||||||
|
},
|
||||||
|
method2: function (arg) {
|
||||||
|
arg.strProp = "hello";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue