go.tools/go/types: print meaningful panic for unknown expressions
LGTM=iant R=iant CC=golang-codereviews https://golang.org/cl/81310045
This commit is contained in:
parent
f35b5691f3
commit
069e8474de
|
@ -7,6 +7,7 @@
|
|||
package types
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"go/ast"
|
||||
"go/token"
|
||||
"math"
|
||||
|
@ -1386,10 +1387,7 @@ func (check *checker) exprInternal(x *operand, e ast.Expr, hint Type) exprKind {
|
|||
// types, which are comparatively rare.
|
||||
|
||||
default:
|
||||
if debug {
|
||||
check.dump("expr = %v (%T)", e, e)
|
||||
}
|
||||
unreachable()
|
||||
panic(fmt.Sprintf("%s: unknown expression type %T", check.fset.Position(e.Pos()), e))
|
||||
}
|
||||
|
||||
// everything went well
|
||||
|
|
Loading…
Reference in New Issue