From 87bb1affdde575fd8b8ba920553f9d2c20e2cded Mon Sep 17 00:00:00 2001 From: Tom Date: Sun, 6 Jan 2019 08:36:48 -0700 Subject: [PATCH] changed static methods and lambda-properties to take a context parameter by default --- src/TSHelper.ts | 14 +- test/translation/lua/namespaceMerge.lua | 8 +- test/unit/assignments.spec.ts | 228 ++++++++++++------------ 3 files changed, 124 insertions(+), 126 deletions(-) diff --git a/src/TSHelper.ts b/src/TSHelper.ts index b1778bed5..603143019 100644 --- a/src/TSHelper.ts +++ b/src/TSHelper.ts @@ -401,16 +401,14 @@ export class TSHelper { return thisParameter.type && thisParameter.type.kind === ts.SyntaxKind.VoidKeyword ? ContextType.Void : ContextType.NonVoid; } - if ((ts.isMethodDeclaration(signatureDeclaration) || ts.isMethodSignature(signatureDeclaration)) - && !(ts.getCombinedModifierFlags(signatureDeclaration) & ts.ModifierFlags.Static)) { - // Non-static method + if (ts.isMethodDeclaration(signatureDeclaration) || ts.isMethodSignature(signatureDeclaration)) { + // Method return ContextType.NonVoid; } - if ((ts.isPropertySignature(signatureDeclaration.parent) - || ts.isPropertyDeclaration(signatureDeclaration.parent) - || ts.isPropertyAssignment(signatureDeclaration.parent)) - && !(ts.getCombinedModifierFlags(signatureDeclaration.parent) & ts.ModifierFlags.Static)) { - // Non-static lambda property + if (ts.isPropertySignature(signatureDeclaration.parent) + || ts.isPropertyDeclaration(signatureDeclaration.parent) + || ts.isPropertyAssignment(signatureDeclaration.parent)) { + // Lambda property return ContextType.NonVoid; } if (ts.isBinaryExpression(signatureDeclaration.parent)) { diff --git a/test/translation/lua/namespaceMerge.lua b/test/translation/lua/namespaceMerge.lua index ab110d69c..58e982078 100644 --- a/test/translation/lua/namespaceMerge.lua +++ b/test/translation/lua/namespaceMerge.lua @@ -9,10 +9,10 @@ end end function MergedClass.constructor(self) end -function MergedClass.staticMethodA() +function MergedClass.staticMethodA(self) end -function MergedClass.staticMethodB() - self.staticMethodA(); +function MergedClass.staticMethodB(self) + self:staticMethodA(); end function MergedClass.methodA(self) end @@ -29,5 +29,5 @@ end local mergedClass = MergedClass.new(true); mergedClass:methodB(); mergedClass:propertyFunc(); -MergedClass.staticMethodB(); +MergedClass:staticMethodB(); MergedClass.namespaceFunc(); diff --git a/test/unit/assignments.spec.ts b/test/unit/assignments.spec.ts index e7c1b75ec..6e62b68e4 100644 --- a/test/unit/assignments.spec.ts +++ b/test/unit/assignments.spec.ts @@ -16,10 +16,10 @@ export class AssignmentTests { lambdaProp: (s: string) => string = s => s + "+lambdaProp"; voidMethod(this: void, s: string): string { return s + "+voidMethod"; } voidLambdaProp: (this: void, s: string) => string = s => s + "+voidLambdaProp"; + static voidStaticMethod(this: void, s: string): string { return s + "+voidStaticMethod"; } + static voidStaticLambdaProp: (this: void, s: string) => string = s => s + "+voidStaticLambdaProp"; static staticMethod(s: string): string { return s + "+staticMethod"; } static staticLambdaProp: (s: string) => string = s => s + "+staticLambdaProp"; - static thisStaticMethod(this: Foo, s: string): string { return s + "+thisStaticMethod"; } - static thisStaticLambdaProp: (this: Foo, s: string) => string = s => s + "+thisStaticLambdaProp"; } const foo = new Foo();`; @@ -209,8 +209,8 @@ export class AssignmentTests { @TestCase("func", "function(this: void, s: string) { return s; }", "foo") @TestCase("func", "s => foo.method(s)", "foo+method") @TestCase("func", "s => foo.lambdaProp(s)", "foo+lambdaProp") - @TestCase("func", "Foo.staticMethod", "foo+staticMethod") - @TestCase("func", "Foo.staticLambdaProp", "foo+staticLambdaProp") + @TestCase("func", "Foo.voidStaticMethod", "foo+voidStaticMethod") + @TestCase("func", "Foo.voidStaticLambdaProp", "foo+voidStaticLambdaProp") @TestCase("func", "foo.voidMethod", "foo+voidMethod") @TestCase("func", "foo.voidLambdaProp", "foo+voidLambdaProp") @TestCase("lambda", "func", "foo+func") @@ -219,30 +219,30 @@ export class AssignmentTests { @TestCase("lambda", "function(this: void, s: string) { return s; }", "foo") @TestCase("lambda", "s => foo.method(s)", "foo+method") @TestCase("lambda", "s => foo.lambdaProp(s)", "foo+lambdaProp") - @TestCase("lambda", "Foo.staticMethod", "foo+staticMethod") - @TestCase("lambda", "Foo.staticLambdaProp", "foo+staticLambdaProp") + @TestCase("lambda", "Foo.voidStaticMethod", "foo+voidStaticMethod") + @TestCase("lambda", "Foo.voidStaticLambdaProp", "foo+voidStaticLambdaProp") @TestCase("lambda", "foo.voidMethod", "foo+voidMethod") @TestCase("lambda", "foo.voidLambdaProp", "foo+voidLambdaProp") - @TestCase("Foo.staticMethod", "func", "foo+func") - @TestCase("Foo.staticMethod", "lambda", "foo+lambda") - @TestCase("Foo.staticMethod", "s => s", "foo") - @TestCase("Foo.staticMethod", "function(s) { return s; }", "foo") - @TestCase("Foo.staticMethod", "function(this: void, s: string) { return s; }", "foo") - @TestCase("Foo.staticMethod", "s => foo.method(s)", "foo+method") - @TestCase("Foo.staticMethod", "s => foo.lambdaProp(s)", "foo+lambdaProp") - @TestCase("Foo.staticMethod", "Foo.staticLambdaProp", "foo+staticLambdaProp") - @TestCase("Foo.staticMethod", "foo.voidMethod", "foo+voidMethod") - @TestCase("Foo.staticMethod", "foo.voidLambdaProp", "foo+voidLambdaProp") - @TestCase("Foo.staticLambdaProp", "func", "foo+func") - @TestCase("Foo.staticLambdaProp", "lambda", "foo+lambda") - @TestCase("Foo.staticLambdaProp", "s => s", "foo") - @TestCase("Foo.staticLambdaProp", "function(s) { return s; }", "foo") - @TestCase("Foo.staticLambdaProp", "function(this: void, s: string) { return s; }", "foo") - @TestCase("Foo.staticLambdaProp", "s => foo.method(s)", "foo+method") - @TestCase("Foo.staticLambdaProp", "s => foo.lambdaProp(s)", "foo+lambdaProp") - @TestCase("Foo.staticLambdaProp", "Foo.staticMethod", "foo+staticMethod") - @TestCase("Foo.staticLambdaProp", "foo.voidMethod", "foo+voidMethod") - @TestCase("Foo.staticLambdaProp", "foo.voidLambdaProp", "foo+voidLambdaProp") + @TestCase("Foo.voidStaticMethod", "func", "foo+func") + @TestCase("Foo.voidStaticMethod", "lambda", "foo+lambda") + @TestCase("Foo.voidStaticMethod", "s => s", "foo") + @TestCase("Foo.voidStaticMethod", "function(s) { return s; }", "foo") + @TestCase("Foo.voidStaticMethod", "function(this: void, s: string) { return s; }", "foo") + @TestCase("Foo.voidStaticMethod", "s => foo.method(s)", "foo+method") + @TestCase("Foo.voidStaticMethod", "s => foo.lambdaProp(s)", "foo+lambdaProp") + @TestCase("Foo.voidStaticMethod", "Foo.voidStaticLambdaProp", "foo+voidStaticLambdaProp") + @TestCase("Foo.voidStaticMethod", "foo.voidMethod", "foo+voidMethod") + @TestCase("Foo.voidStaticMethod", "foo.voidLambdaProp", "foo+voidLambdaProp") + @TestCase("Foo.voidStaticLambdaProp", "func", "foo+func") + @TestCase("Foo.voidStaticLambdaProp", "lambda", "foo+lambda") + @TestCase("Foo.voidStaticLambdaProp", "s => s", "foo") + @TestCase("Foo.voidStaticLambdaProp", "function(s) { return s; }", "foo") + @TestCase("Foo.voidStaticLambdaProp", "function(this: void, s: string) { return s; }", "foo") + @TestCase("Foo.voidStaticLambdaProp", "s => foo.method(s)", "foo+method") + @TestCase("Foo.voidStaticLambdaProp", "s => foo.lambdaProp(s)", "foo+lambdaProp") + @TestCase("Foo.voidStaticLambdaProp", "Foo.voidStaticMethod", "foo+voidStaticMethod") + @TestCase("Foo.voidStaticLambdaProp", "foo.voidMethod", "foo+voidMethod") + @TestCase("Foo.voidStaticLambdaProp", "foo.voidLambdaProp", "foo+voidLambdaProp") @TestCase("foo.voidMethod", "func", "foo+func") @TestCase("foo.voidMethod", "lambda", "foo+lambda") @TestCase("foo.voidMethod", "s => s", "foo") @@ -250,8 +250,8 @@ export class AssignmentTests { @TestCase("foo.voidMethod", "function(this: void, s: string) { return s; }", "foo") @TestCase("foo.voidMethod", "s => foo.method(s)", "foo+method") @TestCase("foo.voidMethod", "s => foo.lambdaProp(s)", "foo+lambdaProp") - @TestCase("foo.voidMethod", "Foo.staticMethod", "foo+staticMethod") - @TestCase("foo.voidMethod", "Foo.staticLambdaProp", "foo+staticLambdaProp") + @TestCase("foo.voidMethod", "Foo.voidStaticMethod", "foo+voidStaticMethod") + @TestCase("foo.voidMethod", "Foo.voidStaticLambdaProp", "foo+voidStaticLambdaProp") @TestCase("foo.voidMethod", "foo.voidLambdaProp", "foo+voidLambdaProp") @TestCase("foo.voidLambdaProp", "func", "foo+func") @TestCase("foo.voidLambdaProp", "lambda", "foo+lambda") @@ -260,8 +260,8 @@ export class AssignmentTests { @TestCase("foo.voidLambdaProp", "function(this: void, s: string) { return s; }", "foo") @TestCase("foo.voidLambdaProp", "s => foo.method(s)", "foo+method") @TestCase("foo.voidLambdaProp", "s => foo.lambdaProp(s)", "foo+lambdaProp") - @TestCase("foo.voidLambdaProp", "Foo.staticMethod", "foo+staticMethod") - @TestCase("foo.voidLambdaProp", "Foo.staticLambdaProp", "foo+staticLambdaProp") + @TestCase("foo.voidLambdaProp", "Foo.voidStaticMethod", "foo+voidStaticMethod") + @TestCase("foo.voidLambdaProp", "Foo.voidStaticLambdaProp", "foo+voidStaticLambdaProp") @TestCase("foo.voidLambdaProp", "foo.voidMethod", "foo+voidMethod") @TestCase("func", "(func as (string | ((s: string) => string)))", "foo+func") @TestCase("func", "<(s: string) => string>lambda", "foo+lambda") @@ -275,8 +275,8 @@ export class AssignmentTests { @TestCase("func", "foo+func") @TestCase("lambda", "foo+lambda") - @TestCase("Foo.staticMethod", "foo+staticMethod") - @TestCase("Foo.staticLambdaProp", "foo+staticLambdaProp") + @TestCase("Foo.voidStaticMethod", "foo+voidStaticMethod") + @TestCase("Foo.voidStaticLambdaProp", "foo+voidStaticLambdaProp") @TestCase("foo.voidMethod", "foo+voidMethod") @TestCase("foo.voidLambdaProp", "foo+voidLambdaProp") @TestCase("s => s", "foo") @@ -316,8 +316,8 @@ export class AssignmentTests { @TestCase("func", "foo+func") @TestCase("lambda", "foo+lambda") - @TestCase("Foo.staticMethod", "foo+staticMethod") - @TestCase("Foo.staticLambdaProp", "foo+staticLambdaProp") + @TestCase("Foo.voidStaticMethod", "foo+voidStaticMethod") + @TestCase("Foo.voidStaticLambdaProp", "foo+voidStaticLambdaProp") @TestCase("foo.voidMethod", "foo+voidMethod") @TestCase("foo.voidLambdaProp", "foo+voidLambdaProp") @TestCase("s => s", "foo") @@ -348,8 +348,8 @@ export class AssignmentTests { @TestCase("foo.method", "function(this: Foo, s: string) { return s; }", "foo") @TestCase("foo.method", "s => func(s)", "foo+func") @TestCase("foo.method", "s => lambda(s)", "foo+lambda") - @TestCase("foo.method", "Foo.thisStaticMethod", "foo+thisStaticMethod") - @TestCase("foo.method", "Foo.thisStaticLambdaProp", "foo+thisStaticLambdaProp") + @TestCase("foo.method", "Foo.staticMethod", "foo+staticMethod") + @TestCase("foo.method", "Foo.staticLambdaProp", "foo+staticLambdaProp") @TestCase("foo.method", "thisFunc", "foo+thisFunc") @TestCase("foo.method", "thisLambda", "foo+thisLambda") @TestCase("foo.lambdaProp", "foo.method", "foo+method") @@ -358,30 +358,30 @@ export class AssignmentTests { @TestCase("foo.lambdaProp", "function(this: Foo, s: string) { return s; }", "foo") @TestCase("foo.lambdaProp", "s => func(s)", "foo+func") @TestCase("foo.lambdaProp", "s => lambda(s)", "foo+lambda") - @TestCase("foo.lambdaProp", "Foo.thisStaticMethod", "foo+thisStaticMethod") - @TestCase("foo.lambdaProp", "Foo.thisStaticLambdaProp", "foo+thisStaticLambdaProp") + @TestCase("foo.lambdaProp", "Foo.staticMethod", "foo+staticMethod") + @TestCase("foo.lambdaProp", "Foo.staticLambdaProp", "foo+staticLambdaProp") @TestCase("foo.lambdaProp", "thisFunc", "foo+thisFunc") @TestCase("foo.lambdaProp", "thisLambda", "foo+thisLambda") - @TestCase("Foo.thisStaticMethod", "foo.method", "foo+method") - @TestCase("Foo.thisStaticMethod", "foo.lambdaProp", "foo+lambdaProp") - @TestCase("Foo.thisStaticMethod", "s => s", "foo") - @TestCase("Foo.thisStaticMethod", "function(s) { return s; }", "foo") - @TestCase("foo.thisStaticMethod", "function(this: Foo, s: string) { return s; }", "foo") - @TestCase("Foo.thisStaticMethod", "s => func(s)", "foo+func") - @TestCase("Foo.thisStaticMethod", "s => lambda(s)", "foo+lambda") - @TestCase("Foo.thisStaticMethod", "Foo.thisStaticLambdaProp", "foo+thisStaticLambdaProp") - @TestCase("Foo.thisStaticMethod", "thisFunc", "foo+thisFunc") - @TestCase("Foo.thisStaticMethod", "thisLambda", "foo+thisLambda") - @TestCase("Foo.thisStaticLambdaProp", "foo.method", "foo+method") - @TestCase("Foo.thisStaticLambdaProp", "foo.lambdaProp", "foo+lambdaProp") - @TestCase("Foo.thisStaticLambdaProp", "s => s", "foo") - @TestCase("Foo.thisStaticLambdaProp", "function(s) { return s; }", "foo") - @TestCase("foo.thisStaticLambdaProp", "function(this: Foo, s: string) { return s; }", "foo") - @TestCase("Foo.thisStaticLambdaProp", "s => func(s)", "foo+func") - @TestCase("Foo.thisStaticLambdaProp", "s => lambda(s)", "foo+lambda") - @TestCase("Foo.thisStaticLambdaProp", "Foo.thisStaticMethod", "foo+thisStaticMethod") - @TestCase("Foo.thisStaticLambdaProp", "thisFunc", "foo+thisFunc") - @TestCase("Foo.thisStaticLambdaProp", "thisLambda", "foo+thisLambda") + @TestCase("Foo.staticMethod", "foo.method", "foo+method") + @TestCase("Foo.staticMethod", "foo.lambdaProp", "foo+lambdaProp") + @TestCase("Foo.staticMethod", "s => s", "foo") + @TestCase("Foo.staticMethod", "function(s) { return s; }", "foo") + @TestCase("foo.staticMethod", "function(this: Foo, s: string) { return s; }", "foo") + @TestCase("Foo.staticMethod", "s => func(s)", "foo+func") + @TestCase("Foo.staticMethod", "s => lambda(s)", "foo+lambda") + @TestCase("Foo.staticMethod", "Foo.staticLambdaProp", "foo+staticLambdaProp") + @TestCase("Foo.staticMethod", "thisFunc", "foo+thisFunc") + @TestCase("Foo.staticMethod", "thisLambda", "foo+thisLambda") + @TestCase("Foo.staticLambdaProp", "foo.method", "foo+method") + @TestCase("Foo.staticLambdaProp", "foo.lambdaProp", "foo+lambdaProp") + @TestCase("Foo.staticLambdaProp", "s => s", "foo") + @TestCase("Foo.staticLambdaProp", "function(s) { return s; }", "foo") + @TestCase("foo.staticLambdaProp", "function(this: Foo, s: string) { return s; }", "foo") + @TestCase("Foo.staticLambdaProp", "s => func(s)", "foo+func") + @TestCase("Foo.staticLambdaProp", "s => lambda(s)", "foo+lambda") + @TestCase("Foo.staticLambdaProp", "Foo.staticMethod", "foo+staticMethod") + @TestCase("Foo.staticLambdaProp", "thisFunc", "foo+thisFunc") + @TestCase("Foo.staticLambdaProp", "thisLambda", "foo+thisLambda") @TestCase("thisFunc", "foo.method", "foo+method") @TestCase("thisFunc", "foo.lambdaProp", "foo+lambdaProp") @TestCase("thisFunc", "s => s", "foo") @@ -389,8 +389,8 @@ export class AssignmentTests { @TestCase("thisFunc", "function(this: Foo, s: string) { return s; }", "foo") @TestCase("thisFunc", "s => func(s)", "foo+func") @TestCase("thisFunc", "s => lambda(s)", "foo+lambda") - @TestCase("thisFunc", "Foo.thisStaticMethod", "foo+thisStaticMethod") - @TestCase("thisFunc", "Foo.thisStaticLambdaProp", "foo+thisStaticLambdaProp") + @TestCase("thisFunc", "Foo.staticMethod", "foo+staticMethod") + @TestCase("thisFunc", "Foo.staticLambdaProp", "foo+staticLambdaProp") @TestCase("thisFunc", "thisLambda", "foo+thisLambda") @TestCase("thisLambda", "foo.method", "foo+method") @TestCase("thisLambda", "foo.lambdaProp", "foo+lambdaProp") @@ -399,8 +399,8 @@ export class AssignmentTests { @TestCase("thisLambda", "function(this: Foo, s: string) { return s; }", "foo") @TestCase("thisLambda", "s => func(s)", "foo+func") @TestCase("thisLambda", "s => lambda(s)", "foo+lambda") - @TestCase("thisLambda", "Foo.thisStaticMethod", "foo+thisStaticMethod") - @TestCase("thisLambda", "Foo.thisStaticLambdaProp", "foo+thisStaticLambdaProp") + @TestCase("thisLambda", "Foo.staticMethod", "foo+staticMethod") + @TestCase("thisLambda", "Foo.staticLambdaProp", "foo+staticLambdaProp") @TestCase("thisLambda", "thisFunc", "foo+thisFunc") @TestCase("foo.method", "(foo.method as (string | ((this: Foo, s: string) => string))", "foo+method") @TestCase("foo.method", "<(this: Foo, s: string) => string>foo.lambdaProp", "foo+lambdaProp") @@ -414,8 +414,8 @@ export class AssignmentTests { @TestCase("foo.method", "foo+method") @TestCase("foo.lambdaProp", "foo+lambdaProp") - @TestCase("Foo.thisStaticMethod", "foo+thisStaticMethod") - @TestCase("Foo.thisStaticLambdaProp", "foo+thisStaticLambdaProp") + @TestCase("Foo.staticMethod", "foo+staticMethod") + @TestCase("Foo.staticLambdaProp", "foo+staticLambdaProp") @TestCase("thisFunc", "foo+thisFunc") @TestCase("thisLambda", "foo+thisLambda") @TestCase("s => s", "foo") @@ -442,8 +442,8 @@ export class AssignmentTests { @TestCase("foo.method", "foo+method") @TestCase("foo.lambdaProp", "foo+lambdaProp") - @TestCase("Foo.thisStaticMethod", "foo+thisStaticMethod") - @TestCase("Foo.thisStaticLambdaProp", "foo+thisStaticLambdaProp") + @TestCase("Foo.staticMethod", "foo+staticMethod") + @TestCase("Foo.staticLambdaProp", "foo+staticLambdaProp") @TestCase("thisFunc", "foo+thisFunc") @TestCase("thisLambda", "foo+thisLambda") @TestCase("s => s", "foo") @@ -470,34 +470,34 @@ export class AssignmentTests { @TestCase("func", "foo.method") @TestCase("func", "foo.lambdaProp") - @TestCase("func", "Foo.thisStaticMethod") - @TestCase("func", "Foo.thisStaticLambdaProp") + @TestCase("func", "Foo.staticMethod") + @TestCase("func", "Foo.staticLambdaProp") @TestCase("func", "function(this: Foo, s: string) { return s; }") @TestCase("lambda", "foo.method") @TestCase("lambda", "foo.lambdaProp") - @TestCase("lambda", "Foo.thisStaticMethod") - @TestCase("lambda", "Foo.thisStaticLambdaProp") + @TestCase("lambda", "Foo.staticMethod") + @TestCase("lambda", "Foo.staticLambdaProp") @TestCase("lambda", "function(this: Foo, s: string) { return s; }") @TestCase("foo.voidMethod", "foo.method") @TestCase("foo.voidMethod", "foo.lambdaProp") - @TestCase("foo.voidMethod", "Foo.thisStaticMethod") - @TestCase("foo.voidMethod", "Foo.thisStaticLambdaProp") + @TestCase("foo.voidMethod", "Foo.staticMethod") + @TestCase("foo.voidMethod", "Foo.staticLambdaProp") @TestCase("foo.voidMethod", "function(this: Foo, s: string) { return s; }") @TestCase("foo.voidLambdaProp", "foo.method") @TestCase("foo.voidLambdaProp", "foo.lambdaProp") - @TestCase("foo.voidLambdaProp", "Foo.thisStaticMethod") - @TestCase("foo.voidLambdaProp", "Foo.thisStaticLambdaProp") + @TestCase("foo.voidLambdaProp", "Foo.staticMethod") + @TestCase("foo.voidLambdaProp", "Foo.staticLambdaProp") @TestCase("foo.voidLambdaProp", "function(this: Foo, s: string) { return s; }") - @TestCase("Foo.staticMethod", "foo.method") - @TestCase("Foo.staticMethod", "foo.lambdaProp") - @TestCase("Foo.staticMethod", "Foo.thisStaticMethod") - @TestCase("Foo.staticMethod", "Foo.thisStaticLambdaProp") - @TestCase("Foo.staticMethod", "function(this: Foo, s: string) { return s; }") - @TestCase("Foo.staticLambdaProp", "foo.method") - @TestCase("Foo.staticLambdaProp", "foo.lambdaProp") - @TestCase("Foo.staticLambdaProp", "Foo.thisStaticMethod") - @TestCase("Foo.staticLambdaProp", "Foo.thisStaticLambdaProp") - @TestCase("Foo.staticLambdaProp", "function(this: Foo, s: string) { return s; }") + @TestCase("Foo.voidStaticMethod", "foo.method") + @TestCase("Foo.voidStaticMethod", "foo.lambdaProp") + @TestCase("Foo.voidStaticMethod", "Foo.staticMethod") + @TestCase("Foo.voidStaticMethod", "Foo.staticLambdaProp") + @TestCase("Foo.voidStaticMethod", "function(this: Foo, s: string) { return s; }") + @TestCase("Foo.voidStaticLambdaProp", "foo.method") + @TestCase("Foo.voidStaticLambdaProp", "foo.lambdaProp") + @TestCase("Foo.voidStaticLambdaProp", "Foo.staticMethod") + @TestCase("Foo.voidStaticLambdaProp", "Foo.staticLambdaProp") + @TestCase("Foo.voidStaticLambdaProp", "function(this: Foo, s: string) { return s; }") @TestCase("func", "(foo.method as (string | ((this: Foo, s: string) => string)))") @TestCase("func", "<(s: string) => string>foo.method") @TestCase("func", "foo.method as ((s: string) => string)") @@ -511,8 +511,8 @@ export class AssignmentTests { @TestCase("foo.method") @TestCase("foo.lambdaProp") - @TestCase("Foo.thisStaticMethod") - @TestCase("Foo.thisStaticLambdaProp") + @TestCase("Foo.staticMethod") + @TestCase("Foo.staticLambdaProp") @TestCase("thisFunc") @TestCase("thisLambda") @TestCase("function(this: Foo, s: string) { return s; }") @@ -545,8 +545,8 @@ export class AssignmentTests { @TestCase("foo.method") @TestCase("foo.lambdaProp") - @TestCase("Foo.thisStaticMethod") - @TestCase("Foo.thisStaticLambdaProp") + @TestCase("Foo.staticMethod") + @TestCase("Foo.staticLambdaProp") @TestCase("thisFunc") @TestCase("thisLambda") @TestCase("function(this: Foo, s: string) { return s; }") @@ -570,43 +570,43 @@ export class AssignmentTests { @TestCase("foo.method", "func") @TestCase("foo.method", "lambda") - @TestCase("foo.method", "Foo.staticMethod") - @TestCase("foo.method", "Foo.staticLambdaProp") + @TestCase("foo.method", "Foo.voidStaticMethod") + @TestCase("foo.method", "Foo.voidStaticLambdaProp") @TestCase("foo.method", "foo.voidMethod") @TestCase("foo.method", "foo.voidLambdaProp") @TestCase("foo.method", "function(this: void, s: string) { return s; }") @TestCase("foo.lambdaProp", "func") @TestCase("foo.lambdaProp", "lambda") - @TestCase("foo.lambdaProp", "Foo.staticMethod") - @TestCase("foo.lambdaProp", "Foo.staticLambdaProp") + @TestCase("foo.lambdaProp", "Foo.voidStaticMethod") + @TestCase("foo.lambdaProp", "Foo.voidStaticLambdaProp") @TestCase("foo.lambdaProp", "foo.voidMethod") @TestCase("foo.lambdaProp", "foo.voidLambdaProp") @TestCase("foo.lambdaProp", "function(this: void, s: string) { return s; }") - @TestCase("Foo.thisStaticMethod", "func") - @TestCase("Foo.thisStaticMethod", "lambda") - @TestCase("Foo.thisStaticMethod", "Foo.staticMethod") - @TestCase("Foo.thisStaticMethod", "Foo.staticLambdaProp") - @TestCase("Foo.thisStaticMethod", "foo.voidMethod") - @TestCase("Foo.thisStaticMethod", "foo.voidLambdaProp") - @TestCase("Foo.thisStaticMethod", "function(this: void, s: string) { return s; }") - @TestCase("Foo.thisStaticLambdaProp", "func") - @TestCase("Foo.thisStaticLambdaProp", "lambda") - @TestCase("Foo.thisStaticLambdaProp", "Foo.staticMethod") - @TestCase("Foo.thisStaticLambdaProp", "Foo.staticLambdaProp") - @TestCase("Foo.thisStaticLambdaProp", "foo.voidMethod") - @TestCase("Foo.thisStaticLambdaProp", "foo.voidLambdaProp") - @TestCase("Foo.thisStaticLambdaProp", "function(this: void, s: string) { return s; }") + @TestCase("Foo.staticMethod", "func") + @TestCase("Foo.staticMethod", "lambda") + @TestCase("Foo.staticMethod", "Foo.voidStaticMethod") + @TestCase("Foo.staticMethod", "Foo.voidStaticLambdaProp") + @TestCase("Foo.staticMethod", "foo.voidMethod") + @TestCase("Foo.staticMethod", "foo.voidLambdaProp") + @TestCase("Foo.staticMethod", "function(this: void, s: string) { return s; }") + @TestCase("Foo.staticLambdaProp", "func") + @TestCase("Foo.staticLambdaProp", "lambda") + @TestCase("Foo.staticLambdaProp", "Foo.voidStaticMethod") + @TestCase("Foo.staticLambdaProp", "Foo.voidStaticLambdaProp") + @TestCase("Foo.staticLambdaProp", "foo.voidMethod") + @TestCase("Foo.staticLambdaProp", "foo.voidLambdaProp") + @TestCase("Foo.staticLambdaProp", "function(this: void, s: string) { return s; }") @TestCase("thisFunc", "func") @TestCase("thisFunc", "lambda") - @TestCase("thisFunc", "Foo.staticMethod") - @TestCase("thisFunc", "Foo.staticLambdaProp") + @TestCase("thisFunc", "Foo.voidStaticMethod") + @TestCase("thisFunc", "Foo.voidStaticLambdaProp") @TestCase("thisFunc", "foo.voidMethod") @TestCase("thisFunc", "foo.voidLambdaProp") @TestCase("thisFunc", "function(this: void, s: string) { return s; }") @TestCase("thisLambda", "func") @TestCase("thisLambda", "lambda") - @TestCase("thisLambda", "Foo.staticMethod") - @TestCase("thisLambda", "Foo.staticLambdaProp") + @TestCase("thisLambda", "Foo.voidStaticMethod") + @TestCase("thisLambda", "Foo.voidStaticLambdaProp") @TestCase("thisLambda", "foo.voidMethod") @TestCase("thisLambda", "foo.voidLambdaProp") @TestCase("thisLambda", "function(this: void, s: string) { return s; }") @@ -624,8 +624,8 @@ export class AssignmentTests { @TestCase("func") @TestCase("lambda") - @TestCase("Foo.staticMethod") - @TestCase("Foo.staticLambdaProp") + @TestCase("Foo.voidStaticMethod") + @TestCase("Foo.voidStaticLambdaProp") @TestCase("foo.voidMethod") @TestCase("foo.voidLambdaProp") @TestCase("function(this: void, s: string) { return s; }") @@ -661,8 +661,8 @@ export class AssignmentTests { @TestCase("func") @TestCase("lambda") - @TestCase("Foo.staticMethod") - @TestCase("Foo.staticLambdaProp") + @TestCase("Foo.voidStaticMethod") + @TestCase("Foo.voidStaticLambdaProp") @TestCase("foo.voidMethod") @TestCase("foo.voidLambdaProp") @TestCase("function(this: void, s: string) { return s; }")