aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/cmd/compile/internal/syntax/parser.go2
-rw-r--r--test/fixedbugs/issue19056.go9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/syntax/parser.go b/src/cmd/compile/internal/syntax/parser.go
index a11be9717c..79d6c8c14d 100644
--- a/src/cmd/compile/internal/syntax/parser.go
+++ b/src/cmd/compile/internal/syntax/parser.go
@@ -799,7 +799,7 @@ loop:
p.syntax_error("expecting name or (")
p.advance(_Semi, _Rparen)
}
- if gcCompat {
+ if gcCompat && x != nil {
x.init(p)
}
diff --git a/test/fixedbugs/issue19056.go b/test/fixedbugs/issue19056.go
new file mode 100644
index 0000000000..e4e8d07905
--- /dev/null
+++ b/test/fixedbugs/issue19056.go
@@ -0,0 +1,9 @@
+// errorcheck
+
+// Copyright 2017 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 p
+
+var _ = ... . // ERROR "unexpected ..."