mirror of
https://github.com/golang/go
synced 2024-11-02 11:50:30 +00:00
go/types, types2: add a test for invalid import of "init"
This error reporting code path did not have test coverage, and panics in 1.17 (filed as #48082). Add a test that would have reproduced the panic, for both go/types and cmd/compile/internal/types2. Change-Id: Icd5f54f8407e4ab57d432f44a129ecf6b2755feb Reviewed-on: https://go-review.googlesource.com/c/go/+/346309 Trust: Robert Findley <rfindley@google.com> Run-TryBot: Robert Findley <rfindley@google.com> Reviewed-by: Robert Griesemer <gri@golang.org> TryBot-Result: Go Bot <gobot@golang.org>
This commit is contained in:
parent
3342aa5f51
commit
7622e41c84
2 changed files with 14 additions and 0 deletions
7
src/cmd/compile/internal/types2/testdata/fixedbugs/issue48082.src
vendored
Normal file
7
src/cmd/compile/internal/types2/testdata/fixedbugs/issue48082.src
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Copyright 2021 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package issue48082
|
||||
|
||||
import "init" /* ERROR init must be a func */ /* ERROR could not import init */
|
7
src/go/types/testdata/fixedbugs/issue48082.src
vendored
Normal file
7
src/go/types/testdata/fixedbugs/issue48082.src
vendored
Normal file
|
@ -0,0 +1,7 @@
|
|||
// Copyright 2021 The Go Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package issue48082
|
||||
|
||||
import "init" /* ERROR init must be a func */ /* ERROR could not import init */
|
Loading…
Reference in a new issue