diff --git a/go/types/testdata/constdecl.src b/go/types/testdata/constdecl.src index 8577cb92c3..6de9b13d6e 100644 --- a/go/types/testdata/constdecl.src +++ b/go/types/testdata/constdecl.src @@ -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" */ ) diff --git a/go/types/testdata/vardecl.src b/go/types/testdata/vardecl.src index 329f4ffe26..fb6b5f7838 100644 --- a/go/types/testdata/vardecl.src +++ b/go/types/testdata/vardecl.src @@ -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" */