mirror of
https://github.com/golang/go
synced 2024-11-22 16:34:47 -07:00
[dev.typeparams] cmd/compile/internal/syntax: cleanup panic calls
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>
This commit is contained in:
parent
c3b57af8bc
commit
3a9fd99849
@ -604,7 +604,7 @@ func (p *parser) typeDecl(group *Group) Decl {
|
||||
} 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)
|
||||
}
|
||||
|
@ -12,7 +12,7 @@ func StartPos(n Node) Pos {
|
||||
for m := n; ; {
|
||||
switch n := m.(type) {
|
||||
case nil:
|
||||
panic("internal error: nil")
|
||||
panic("nil node")
|
||||
|
||||
// packages
|
||||
case *File:
|
||||
@ -124,7 +124,7 @@ func EndPos(n Node) Pos {
|
||||
for m := n; ; {
|
||||
switch n := m.(type) {
|
||||
case nil:
|
||||
panic("internal error: nil")
|
||||
panic("nil node")
|
||||
|
||||
// packages
|
||||
case *File:
|
||||
|
@ -70,7 +70,7 @@ type walker struct {
|
||||
|
||||
func (w walker) node(n Node) {
|
||||
if n == nil {
|
||||
panic("invalid syntax tree: nil node")
|
||||
panic("nil node")
|
||||
}
|
||||
|
||||
w.v = w.v.Visit(n)
|
||||
|
Loading…
Reference in New Issue
Block a user