From 22ace9f550470d0ecd20db4f3300ae1449f017ae Mon Sep 17 00:00:00 2001 From: ctw-ian Date: Thu, 24 Nov 2022 03:58:22 +0000 Subject: [PATCH] Fix incorrect static method type recording Issue:I62UUS Signed-off-by: ctw-ian Change-Id: I7671d4fe17e4e0f4c6077f4515454fd1feeff3c9 --- ts2panda/src/base/typeSystem.ts | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ts2panda/src/base/typeSystem.ts b/ts2panda/src/base/typeSystem.ts index 331e4f9ded..18a04e5132 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(); -- Gitee