aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/api.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/types/api.go')
-rw-r--r--src/go/types/api.go17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/go/types/api.go b/src/go/types/api.go
index ec12fcf380..436c23099b 100644
--- a/src/go/types/api.go
+++ b/src/go/types/api.go
@@ -101,6 +101,13 @@ type ImporterFrom interface {
// A Config specifies the configuration for type checking.
// The zero value for Config is a ready-to-use default configuration.
type Config struct {
+ // GoVersion describes the accepted Go language version. The string
+ // must follow the format "go%d.%d" (e.g. "go1.12") or it must be
+ // empty; an empty string indicates the latest language version.
+ // If the format is invalid, invoking the type checker will cause a
+ // panic.
+ GoVersion string
+
// If IgnoreFuncBodies is set, function bodies are not
// type-checked.
IgnoreFuncBodies bool
@@ -177,11 +184,11 @@ type Info struct {
// qualified identifiers are collected in the Uses map.
Types map[ast.Expr]TypeAndValue
- // Inferred maps calls of parameterized functions that use
- // type inference to the inferred type arguments and signature
+ // _Inferred maps calls of parameterized functions that use
+ // type inference to the _Inferred type arguments and signature
// of the function called. The recorded "call" expression may be
// an *ast.CallExpr (as in f(x)), or an *ast.IndexExpr (s in f[T]).
- Inferred map[ast.Expr]Inferred
+ _Inferred map[ast.Expr]_Inferred
// Defs maps identifiers to the objects they define (including
// package names, dots "." of dot-imports, and blank "_" identifiers).
@@ -339,9 +346,9 @@ func (tv TypeAndValue) HasOk() bool {
return tv.mode == commaok || tv.mode == mapindex
}
-// Inferred reports the inferred type arguments and signature
+// _Inferred reports the _Inferred type arguments and signature
// for a parameterized function call that uses type inference.
-type Inferred struct {
+type _Inferred struct {
Targs []Type
Sig *Signature
}