Skip to content

cmd/compile: ugly error message for weird invalid program #20771

@josharian

Description

@josharian
package p

var r = newReader()

func newReader() r
$ go tool compile x.go 
x.go:3:9: typechecking loop involving newReader
	x.go:3:18 newReader()
	x.go:3:5 r = newReader()
	x.go:3:5 r
	x.go:5:15 <T>
	x.go:5:18 newReader
	x.go:5:6 <node DCLFUNC>
x.go:5:18: r is not a type

This error message is ugly and inscrutable.

The same program features in #20770.

Marking as unplanned, because of the oddity and unlikeliness of the program.

Found with go-fuzz.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions