@@ -2337,17 +2337,19 @@ Nodes:
2337
2337
return inf
2338
2338
}
2339
2339
2340
- targs := c .getTypeArgs (node )
2341
- res := inferExpectedResultTypes (c , i )
2342
- substs := reverseInferTypeArgs (sig , targs , res )
2343
- inst := instantiate (sig , substs )
2344
- if inst != nil {
2345
- // TODO(jacobz): If partial signature instantiation becomes possible,
2346
- // make needsExactType only true if necessary.
2347
- // Currently ambigious cases resolve to a correct, but occassionally,
2348
- // superfluous conversion expression wrapping the completion.
2349
- inf .needsExactType = true
2350
- sig = inst
2340
+ if sig .TypeParams ().Len () > 0 {
2341
+ targs := c .getTypeArgs (node )
2342
+ res := inferExpectedResultTypes (c , i )
2343
+ substs := reverseInferTypeArgs (sig , targs , res )
2344
+ inst := instantiate (sig , substs )
2345
+ if inst != nil {
2346
+ // TODO(jacobz): If partial signature instantiation becomes possible,
2347
+ // make needsExactType only true if necessary.
2348
+ // Currently, ambigious cases always resolve to a conversion expression
2349
+ // wrapping the completion, which is occassionally superfluous.
2350
+ inf .needsExactType = true
2351
+ sig = inst
2352
+ }
2351
2353
}
2352
2354
2353
2355
inf = c .expectedCallParamType (inf , node , sig )
0 commit comments