File tree Expand file tree Collapse file tree 2 files changed +22
-12
lines changed
src/com/goide/inspections Expand file tree Collapse file tree 2 files changed +22
-12
lines changed Original file line number Diff line number Diff line change @@ -56,20 +56,19 @@ public void visitCallExpr(@NotNull GoCallExpr o) {
5656 expectedSize += size == 0 ? 1 : size ;
5757 }
5858
59- if (expectedSize != actualSize ) {
60- if (actualSize == 1 ) {
61- GoExpression first = ContainerUtil .getFirstItem (list );
62- PsiReference firstRef = GoPsiImplUtil .getCallReference (first );
63- PsiElement firstResolve = firstRef != null ? firstRef .resolve () : null ;
64- if (firstResolve instanceof GoFunctionOrMethodDeclaration ) {
65- int resultCount = GoInspectionUtil .getFunctionResultCount ((GoFunctionOrMethodDeclaration )firstResolve );
66- if (resultCount == expectedSize ) return ;
67- }
59+ if (actualSize == 1 ) {
60+ GoExpression first = ContainerUtil .getFirstItem (list );
61+ PsiReference firstRef = GoPsiImplUtil .getCallReference (first );
62+ PsiElement firstResolve = firstRef != null ? firstRef .resolve () : null ;
63+ if (firstResolve instanceof GoFunctionOrMethodDeclaration ) {
64+ actualSize = GoInspectionUtil .getFunctionResultCount ((GoFunctionOrMethodDeclaration )firstResolve );
6865 }
69-
70- String tail = " arguments in call to " + expression .getText ();
71- holder .registerProblem (o .getArgumentList (), actualSize > expectedSize ? "too many" + tail : "not enough" + tail );
7266 }
67+
68+ if (actualSize == expectedSize ) return ;
69+
70+ String tail = " arguments in call to " + expression .getText ();
71+ holder .registerProblem (o .getArgumentList (), actualSize > expectedSize ? "too many" + tail : "not enough" + tail );
7372 }
7473 }
7574 }
Original file line number Diff line number Diff line change @@ -134,4 +134,15 @@ func demo23(a *d, err error) string {
134134
135135func < warning > main23 < / warning > () {
136136 _ = demo23 (de ("1" ).Func ())
137+ }
138+
139+ func foo_m (_ int ) {
140+ }
141+
142+ func bar_m () (int , int ) {
143+ return 0 , 0
144+ }
145+
146+ func < warning > main127 < / warning > () {
147+ foo_m < error > (bar_m ())< / error >
137148}
You can’t perform that action at this time.
0 commit comments