Skip to content

cmd/compile: missing return value for undefined type mentions <T> #58742

Closed
@dominikh

Description

@dominikh

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

$ go version
go version devel go1.21-e7201cfa9f Sat Feb 25 20:14:38 2023 +0000 linux/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

package main

func foo() UnknownType {
	return
}

What did you expect to see?

A compile error that doesn't mention <T>

What did you see instead?

$ go build foo.go
# command-line-arguments
./foo.go:3:12: undefined: UnknownType
./foo.go:4:2: not enough return values
	have ()
	want (<T>)

Metadata

Metadata

Assignees

No one assigned

    Labels

    FrozenDueToAgeNeedsInvestigationSomeone 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.help wanted

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions