From c0c8b5ffff4a0bf1dd5c19397419ae9fa8d44d13 Mon Sep 17 00:00:00 2001 From: zhangrengao Date: Sat, 28 May 2022 12:07:14 +0800 Subject: [PATCH] fix dupliate method name of class Signed-off-by: zhangrengao Change-Id: I231f301b74eac4c199c65d363ebf5695caed41eb --- ts2panda/src/statement/classStatement.ts | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/ts2panda/src/statement/classStatement.ts b/ts2panda/src/statement/classStatement.ts index ed9498afbf..f9026f049e 100644 --- a/ts2panda/src/statement/classStatement.ts +++ b/ts2panda/src/statement/classStatement.ts @@ -785,8 +785,20 @@ function checkAndUpdateProperty(namedPropertyMap: Map, name: s prop!.setSetter(valueNode); } } else { - if (!scalarArrayEquals(prop!.getValue(), valueNode)) { - return false; + if (prop!.getKind() == PropertyKind.Accessor) { + if (prop!.getGetter()) { + if (!scalarArrayEquals(prop!.getGetter(), valueNode)) { + return false; + } + } else if (prop!.getSetter()) { + if (!scalarArrayEquals(prop!.getSetter(), valueNode)) { + return false; + } + } + } else { + if (!scalarArrayEquals(prop!.getValue(), valueNode)) { + return false; + } } prop!.setValue(valueNode); prop!.setKind(propKind); -- Gitee