mirror of
https://github.com/golang/go
synced 2024-11-18 18:04:46 -07:00
go/types: update testdata (fix build)
Change-Id: Ifd38444c7c22f65f6e85fe6233b01703d1d14b4f Reviewed-on: https://go-review.googlesource.com/3540 Reviewed-by: Alan Donovan <adonovan@google.com>
This commit is contained in:
parent
39a2d013be
commit
1afe783e9f
19
go/types/testdata/constdecl.src
vendored
19
go/types/testdata/constdecl.src
vendored
@ -20,17 +20,20 @@ func _() {
|
||||
}
|
||||
|
||||
// Identifier and expression arity must match.
|
||||
const _ /* ERROR "missing init expr for _" */
|
||||
// The first error message is produced by the parser.
|
||||
// In a real-world scenario, the type-checker would not be run
|
||||
// in this case and the 2nd error message would not appear.
|
||||
const _ /* ERROR "missing constant value" */ /* ERROR "missing init expr for _" */
|
||||
const _ = 1, 2 /* ERROR "extra init expr 2" */
|
||||
|
||||
const _ /* ERROR "missing init expr for _" */ int
|
||||
const _ /* ERROR "missing constant value" */ /* ERROR "missing init expr for _" */ int
|
||||
const _ int = 1, 2 /* ERROR "extra init expr 2" */
|
||||
|
||||
const (
|
||||
_ /* ERROR "missing init expr for _" */
|
||||
_ /* ERROR "missing constant value" */ /* ERROR "missing init expr for _" */
|
||||
_ = 1, 2 /* ERROR "extra init expr 2" */
|
||||
|
||||
_ /* ERROR "missing init expr for _" */ int
|
||||
_ /* ERROR "missing constant value" */ /* ERROR "missing init expr for _" */ int
|
||||
_ int = 1, 2 /* ERROR "extra init expr 2" */
|
||||
)
|
||||
|
||||
@ -51,17 +54,17 @@ const (
|
||||
)
|
||||
|
||||
func _() {
|
||||
const _ /* ERROR "missing init expr for _" */
|
||||
const _ /* ERROR "missing constant value" */ /* ERROR "missing init expr for _" */
|
||||
const _ = 1, 2 /* ERROR "extra init expr 2" */
|
||||
|
||||
const _ /* ERROR "missing init expr for _" */ int
|
||||
const _ /* ERROR "missing constant value" */ /* ERROR "missing init expr for _" */ int
|
||||
const _ int = 1, 2 /* ERROR "extra init expr 2" */
|
||||
|
||||
const (
|
||||
_ /* ERROR "missing init expr for _" */
|
||||
_ /* ERROR "missing constant value" */ /* ERROR "missing init expr for _" */
|
||||
_ = 1, 2 /* ERROR "extra init expr 2" */
|
||||
|
||||
_ /* ERROR "missing init expr for _" */ int
|
||||
_ /* ERROR "missing constant value" */ /* ERROR "missing init expr for _" */ int
|
||||
_ int = 1, 2 /* ERROR "extra init expr 2" */
|
||||
)
|
||||
|
||||
|
9
go/types/testdata/vardecl.src
vendored
9
go/types/testdata/vardecl.src
vendored
@ -14,9 +14,12 @@ var m map[string]int
|
||||
var _ int
|
||||
var _, _ int
|
||||
|
||||
var _ /* ERROR "missing type or init expr" */
|
||||
var _ /* ERROR "missing type or init expr" */, _
|
||||
var _ /* ERROR "missing type or init expr" */, _, _
|
||||
// The first error message is produced by the parser.
|
||||
// In a real-world scenario, the type-checker would not be run
|
||||
// in this case and the 2nd error message would not appear.
|
||||
var _ /* ERROR "missing variable type" */ /* ERROR "missing type or init expr" */
|
||||
var _ /* ERROR "missing variable type" */ /* ERROR "missing type or init expr" */, _
|
||||
var _ /* ERROR "missing variable type" */ /* ERROR "missing type or init expr" */, _, _
|
||||
|
||||
// The initializer must be an expression.
|
||||
var _ = int /* ERROR "not an expression" */
|
||||
|
Loading…
Reference in New Issue
Block a user