End-users are not expected to deal with the details of panics,
so providing extra information such as an "internal error" prefix
is not helpful.
Matches the types2 changes made in https://golang.org/cl/339969 .
Change-Id: Icb34a9daab981a84f41f8ae7ae5dc1b85b2d2c81
Reviewed-on: https://go-review.googlesource.com/c/go/+/339904
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Robert Findley <rfindley@google.com>
} else {
// x is the array length expression
if debug && x == nil {
- panic("internal error: nil expression")
+ panic("length expression is nil")
}
d.Type = p.arrayType(pos, x)
}
for m := n; ; {
switch n := m.(type) {
case nil:
- panic("internal error: nil")
+ panic("nil node")
// packages
case *File:
for m := n; ; {
switch n := m.(type) {
case nil:
- panic("internal error: nil")
+ panic("nil node")
// packages
case *File:
func (w walker) node(n Node) {
if n == nil {
- panic("invalid syntax tree: nil node")
+ panic("nil node")
}
w.v = w.v.Visit(n)