Fixes #19667.
Change-Id: Iaa71e2020af123c1bd3ac25e0b760956688e8bdf
Reviewed-on: https://go-review.googlesource.com/38458
Run-TryBot: Robert Griesemer <gri@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
func (p *printer) printRawNode(n Node) {
switch n := n.(type) {
+ case nil:
+ // we should not reach here but don't crash
+
// expressions and types
case *Name:
p.print(_Name, n.Value) // _Name requires actual value following immediately
--- /dev/null
+// 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.
+
+// Make sure we don't crash when reporting this error.
+
+package p
+
+func f() {
+ if err := http.ListenAndServe(
+} // ERROR "unexpected }, expecting expression"