aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types2/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/types2/api.go')
-rw-r--r--src/cmd/compile/internal/types2/api.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types2/api.go b/src/cmd/compile/internal/types2/api.go
index ae4fb6ad10..f268508825 100644
--- a/src/cmd/compile/internal/types2/api.go
+++ b/src/cmd/compile/internal/types2/api.go
@@ -55,6 +55,18 @@ func (err Error) FullError() string {
return fmt.Sprintf("%s: %s", err.Pos, err.Full)
}
+// An ArgumentError holds an error that is associated with an argument.
+type ArgumentError struct {
+ index int
+ error
+}
+
+// Index returns the positional index of the argument associated with the
+// error.
+func (e ArgumentError) Index() int {
+ return e.index
+}
+
// An Importer resolves import paths to Packages.
//
// CAUTION: This interface does not support the import of locally