Skip to content

cmd/compile: assignment errors have become overly verbose #79785

@griesemer

Description

@griesemer

Some of the assignment errors have become overly verbose. Examples:

package p

func f(int) (int, string) { return 0, "foo" }

func _() {
	f("foo")            // ERROR: cannot use "foo" (untyped string constant) as int value in argument to f
	var _, _ int = f(0) // ERROR: cannot use 2nd function result (value of type string) as int value in multiple assignment
}

We should produce more concise errors.
See also #78884 for some examples and former (1.16) error messages.

Metadata

Metadata

Labels

BadErrorMessageIssues related compiler error messages that should be better.FeatureRequestIssues asking for a new feature that does not need a proposal.compiler/runtimeIssues related to the Go compiler and/or runtime.
No fields configured for Feature.

Projects

Status
Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions