mirror of
https://github.com/golang/go
synced 2024-11-23 06:30:06 -07:00
[dev.typeparams] go/types: fix panic with nil package name
This is a straightforward port of CL 320490 to go/types. Change-Id: I763c806c777f926a563d8f9384764e5b3f7f083c Reviewed-on: https://go-review.googlesource.com/c/go/+/324732 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
cd6e9df446
commit
e32fab145b
@ -276,7 +276,7 @@ func (check *Checker) collectObjects() {
|
||||
}
|
||||
|
||||
if name == "init" {
|
||||
check.errorf(d.spec.Name, _InvalidInitDecl, "cannot import package as init - init must be a func")
|
||||
check.errorf(d.spec, _InvalidInitDecl, "cannot import package as init - init must be a func")
|
||||
return
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user