@@ -346,6 +346,38 @@ describe('convert', () => {
346
346
expect ( ts ) . toContain ( 'class ShapeFilterJS extends ShapeFilter {' )
347
347
expect ( ts ) . toContain ( 'ShouldCollide(inShape2: number, inSubShapeIDOfShape2: number): boolean;' )
348
348
} )
349
+
350
+ it ( 'implements statement should take precedence over JSImplementation for inheritance' , async ( ) => {
351
+ const idl = multiLine (
352
+ 'interface PathConstraintPath {' ,
353
+ ' boolean IsLooping();' ,
354
+ ' void SetIsLooping(boolean inIsLooping);' ,
355
+ ' unsigned long GetRefCount();' ,
356
+ ' void AddRef();' ,
357
+ ' void Release();' ,
358
+ '};' ,
359
+ '' ,
360
+ 'interface PathConstraintPathEm {' ,
361
+ '};' ,
362
+ '' ,
363
+ 'PathConstraintPathJS implements PathConstraintPath;' ,
364
+ '' ,
365
+ '[JSImplementation="PathConstraintPathEm"]' ,
366
+ 'interface PathConstraintPathJS {' ,
367
+ ' [Const] void PathConstraintPathJS();' ,
368
+ ' [Const] float GetPathMaxFraction();' ,
369
+ ' [Const] float GetClosestPoint([Const] Vec3 inPosition, float inFractionHint);' ,
370
+ ' [Const] void GetPointOnPath(float inFraction, Vec3 outPathPosition, Vec3 outPathTangent, Vec3 outPathNormal, Vec3 outPathBinormal);' ,
371
+ '};' ,
372
+ )
373
+
374
+ const ts = await convert ( idl , { emscripten : true } )
375
+
376
+ console . log ( ts )
377
+
378
+ expect ( ts ) . toContain ( 'class PathConstraintPath {' )
379
+ expect ( ts ) . toContain ( 'class PathConstraintPathJS extends PathConstraintPath {' )
380
+ } )
349
381
} )
350
382
} )
351
383
0 commit comments