Skip to content

cmd/compile: confusing error message "not enough arguments in call to F" #76487

@yansal

Description

@yansal

What version of Go are you using (go version)?

$ go version
go version go1.25.4 linux/amd64

Does this issue reproduce with the latest release?

yes

What operating system and processor architecture are you using (go env)?

go env Output
$ go env
AR='ar'
CC='gcc'
CGO_CFLAGS='-O2 -g'
CGO_CPPFLAGS=''
CGO_CXXFLAGS='-O2 -g'
CGO_ENABLED='1'
CGO_FFLAGS='-O2 -g'
CGO_LDFLAGS='-O2 -g'
CXX='g++'
GCCGO='gccgo'
GO111MODULE=''
GOAMD64='v1'
GOARCH='amd64'
GOAUTH='netrc'
GOBIN=''
GOCACHE='/home/ysalaun/.cache/go-build'
GOCACHEPROG=''
GODEBUG=''
GOENV='/home/ysalaun/.config/go/env'
GOEXE=''
GOEXPERIMENT=''
GOFIPS140='off'
GOFLAGS=''
GOGCCFLAGS='-fPIC -m64 -pthread -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=/tmp/go-build3938636047=/tmp/go-build -gno-record-gcc-switches'
GOHOSTARCH='amd64'
GOHOSTOS='linux'
GOINSECURE=''
GOMOD='/home/ysalaun/z/gobug/go.mod'
GOMODCACHE='/home/ysalaun/go/pkg/mod'
GONOPROXY='gitlab.ateme.net'
GONOSUMDB='gitlab.ateme.net'
GOOS='linux'
GOPATH='/home/ysalaun/go'
GOPRIVATE='gitlab.ateme.net'
GOPROXY='https://proxy.golang.org,direct'
GOROOT='/usr/local/go'
GOSUMDB='sum.golang.org'
GOTELEMETRY='on'
GOTELEMETRYDIR='/home/ysalaun/.config/go/telemetry'
GOTMPDIR=''
GOTOOLCHAIN='auto'
GOTOOLDIR='/usr/local/go/pkg/tool/linux_amd64'
GOVCS=''
GOVERSION='go1.25.1'
GOWORK=''
PKG_CONFIG='pkg-config'
uname -sr: Linux 6.8.0-87-generic
Distributor ID:	Ubuntu
Description:	Ubuntu 22.04.5 LTS
Release:	22.04
Codename:	jammy
/lib/x86_64-linux-gnu/libc.so.6: GNU C Library (Ubuntu GLIBC 2.35-0ubuntu3.11) stable release version 2.35.
gdb --version: GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1

What did you do?

Try to call a method that is undefined.

https://go.dev/play/p/X1HN2CRqe6N

What did you expect to see?

Only the second error message saying the method is undefined

./prog.go:14:6: v.f undefined (type T1 has no field or method f)

What did you see instead?

Two error messages.

./prog.go:14:4: not enough arguments in call to F
	have (T1)
	want (T, error)
./prog.go:14:6: v.f undefined (type T1 has no field or method f)

The first error message is confusing

Metadata

Metadata

Assignees

No one assigned

    Labels

    BadErrorMessageIssues related compiler error messages that should be better.BugReportIssues describing a possible bug in the Go implementation.NeedsInvestigationSomeone must examine and confirm this is a valid issue and not a duplicate of an existing one.compiler/runtimeIssues related to the Go compiler and/or runtime.

    Type

    No type

    Projects

    Status

    No status

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions