Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion gopls/internal/golang/implementation.go
Original file line number Diff line number Diff line change
Expand Up @@ -940,7 +940,7 @@ func implFuncs(pkg *cache.Package, curSel inspector.Cursor, start, end token.Pos
if inToken(n.Lparen, "(", start, end) {
t := dynamicFuncCallType(info, n)
if t == nil {
return nil, fmt.Errorf("not a dynamic function call")
return nil, errNotHandled
}
// Case 2b: dynamic call of function value.
// Report declarations of corresponding concrete functions.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ go 1.18
-- a/a.go --
package a

var _ = undefined() //@ diag("undefined", re"undefined"), implementation("(", err="not a dynamic function call")
var _ = undefined() //@ diag("undefined", re"undefined"), implementation("(", err="no identifier found")
11 changes: 5 additions & 6 deletions gopls/internal/test/marker/testdata/implementation/signature.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,11 @@ func _(
struct{x Nullary}{}.x() //@ loc(fieldCall, "("), implementation("(", nullaryFunc)

// Calls that are not dynamic function calls:
_ = len("") //@ implementation("(", err="not a dynamic function call")
_ = int(0) //@ implementation("(", err="not a dynamic function call")
_ = error.Error(nil) //@ implementation("(", err="not a dynamic function call")
_ = err.Error() //@ implementation("(", err="not a dynamic function call")
_ = f4(0) //@ implementation("(", err="not a dynamic function call"), loc(f4Call, "(")
_ = len("") //@ implementation("(", err="no identifier found")
_ = int(0) //@ implementation("(", err="no identifier found")
_ = error.Error(nil) //@ implementation("(", err="no identifier found")
_ = err.Error() //@ implementation("(", err="no identifier found")
_ = f4(0) //@ implementation("(", err="no identifier found"), loc(f4Call, "(")
}