@@ -175,7 +175,9 @@ function transformClassLikeDeclaration(
175175 for ( const member of classDeclaration . members ) {
176176 if ( ts . isAccessor ( member ) ) {
177177 // Accessors
178- const accessors = getAllAccessorDeclarations ( classDeclaration ) ;
178+ const symbol = context . checker . getSymbolAtLocation ( member . name ) ;
179+ if ( ! symbol ) continue ;
180+ const accessors = getAllAccessorDeclarations ( classDeclaration , symbol , context ) ;
179181 if ( accessors . firstAccessor !== member ) continue ;
180182
181183 const accessorsResult = transformAccessorDeclarations ( context , accessors , localClassName ) ;
@@ -227,9 +229,19 @@ function transformClassLikeDeclaration(
227229 return { statements : result , name : className } ;
228230}
229231
230- function getAllAccessorDeclarations ( classDeclaration : ts . ClassLikeDeclaration ) : AllAccessorDeclarations {
231- const getAccessor = classDeclaration . members . find ( ts . isGetAccessor ) ;
232- const setAccessor = classDeclaration . members . find ( ts . isSetAccessor ) ;
232+ function getAllAccessorDeclarations (
233+ classDeclaration : ts . ClassLikeDeclaration ,
234+ symbol : ts . Symbol ,
235+ context : TransformationContext
236+ ) : AllAccessorDeclarations {
237+ const getAccessor = classDeclaration . members . find (
238+ ( m ) : m is ts . GetAccessorDeclaration =>
239+ ts . isGetAccessor ( m ) && context . checker . getSymbolAtLocation ( m . name ) === symbol
240+ ) ;
241+ const setAccessor = classDeclaration . members . find (
242+ ( m ) : m is ts . SetAccessorDeclaration =>
243+ ts . isSetAccessor ( m ) && context . checker . getSymbolAtLocation ( m . name ) === symbol
244+ ) ;
233245
234246 // Get the first of the two (that is not undefined)
235247 const firstAccessor =
0 commit comments