@@ -2338,26 +2338,53 @@ public void VisitNode (JSInvocationExpression invocation) {
23382338 } ;
23392339
23402340 if ( isOverloaded ) {
2341- ReferenceContext . InvokingMethod = jsm . Reference ;
2342- SignatureCacher . WriteQualifiedSignatureToOutput (
2343- Output , this , Stack . OfType < JSFunctionExpression > ( ) . FirstOrDefault ( ) ,
2344- jsm ,
2345- ReferenceContext
2346- ) ;
2341+ if ( ! method . DeclaringType . IsInterface ) {
2342+ if ( isStatic ) {
2343+ Visit ( invocation . Type ) ;
2344+ } else {
2345+ Visit ( invocation . ThisReference , "ThisReference" ) ;
2346+ }
23472347
2348- Output . Dot ( ) ;
2349- Output . WriteRaw ( isStatic ? "CallStatic" : invocation . ExplicitThis ? "CallNonVirtual" : "Call" ) ;
2348+ Output . OpenBracket ( ) ;
2349+ ReferenceContext . InvokingMethod = jsm . Reference ;
2350+ SignatureCacher . WriteQualifiedSignatureToOutput (
2351+ Output , this , Stack . OfType < JSFunctionExpression > ( ) . FirstOrDefault ( ) ,
2352+ jsm ,
2353+ ReferenceContext
2354+ ) ;
2355+ Output . Dot ( ) ;
2356+ Output . WriteRaw ( isStatic ? "methodNonQualifiedKey" : ( invocation . ExplicitThis ? "methodKeyNonVirtual" : "methodKey" ) ) ;
2357+ Output . CloseBracket ( ) ;
23502358
2351- Output . LPar ( ) ;
2352- if ( ! isStatic ) {
2353- Visit ( invocation . ThisReference , "ThisReference" ) ;
2354- Output . Comma ( ) ;
2355- }
2359+ Output . LPar ( ) ;
2360+ if ( hasGenericArguments ) {
2361+ Output . CommaSeparatedList ( invocation . GenericArguments , ReferenceContext , ListValueType . TypeIdentifier ) ;
23562362
2357- genericArgs ( ) ;
2363+ if ( hasArguments )
2364+ Output . Comma ( ) ;
2365+ }
2366+ } else {
2367+ ReferenceContext . InvokingMethod = jsm . Reference ;
2368+ SignatureCacher . WriteQualifiedSignatureToOutput (
2369+ Output , this , Stack . OfType < JSFunctionExpression > ( ) . FirstOrDefault ( ) ,
2370+ jsm ,
2371+ ReferenceContext
2372+ ) ;
23582373
2359- if ( hasArguments )
2360- Output . Comma ( ) ;
2374+ Output . Dot ( ) ;
2375+ Output . WriteRaw ( isStatic ? "CallStatic" : invocation . ExplicitThis ? "CallNonVirtual" : "Call" ) ;
2376+
2377+ Output . LPar ( ) ;
2378+ if ( ! isStatic ) {
2379+ Visit ( invocation . ThisReference , "ThisReference" ) ;
2380+ Output . Comma ( ) ;
2381+ }
2382+
2383+ genericArgs ( ) ;
2384+
2385+ if ( hasArguments )
2386+ Output . Comma ( ) ;
2387+ }
23612388 } else {
23622389 if ( isStatic ) {
23632390 if ( ! invocation . Type . IsNull ) {
0 commit comments