blob: a04e5e5c7b9f3aadf428467c93f4149b5de69a1c [file] [log] [blame]
// Copyright 2016 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 generic
import "reflect"
type TypeError struct {
Type1, Type2 reflect.Type
Extra string
}
func (e TypeError) Error() string {
msg := e.Type1.String()
if e.Type2 != nil {
msg += " and " + e.Type2.String()
}
msg += " " + e.Extra
return msg
}