diff --git a/ts2panda/src/base/typeSystem.ts b/ts2panda/src/base/typeSystem.ts index 331e4f9dedbfdcb4dc80e1485bd6c12db4efe9e5..18a04e51326805ea38334dfe9ec5af7fe4c5001e 100644 --- a/ts2panda/src/base/typeSystem.ts +++ b/ts2panda/src/base/typeSystem.ts @@ -400,8 +400,8 @@ export class ClassType extends BaseType { // Then, get the typeIndex and fill in the methods array let typeIndex = this.tryGetTypeIndex(member); - let funcModifier = funcType.getModifier(); - if (funcModifier) { + let isStatic = funcType.hasModifier(Modifier.STATIC); + if (isStatic) { this.staticMethods.set(funcType.getFunctionName(), typeIndex!); } else { this.methods.set(funcType.getFunctionName(), typeIndex!); @@ -605,6 +605,10 @@ export class FunctionType extends BaseType { return this.modifiers; } + hasModifier(modifier: Modifier) { + return (this.modifiers & modifier) ? true : false; + } + transfer2LiteralBuffer(): LiteralBuffer { let funcTypeBuf = new LiteralBuffer(); let funcTypeLiterals: Array = new Array();