]> Cypherpunks.ru repositories - gostls13.git/blobdiff - src/go/types/api.go
[dev.typeparams] merge master (2f0da6d) into dev.typeparams
[gostls13.git] / src / go / types / api.go
index b5bbb2d97dc7ee383f6abcea5e0e220570e18ff5..09ac65b81f1117a00946dbb92713989e5ef26964 100644 (file)
@@ -184,6 +184,12 @@ 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
+       // 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
+
        // Defs maps identifiers to the objects they define (including
        // package names, dots "." of dot-imports, and blank "_" identifiers).
        // For identifiers that do not denote objects (e.g., the package name
@@ -340,6 +346,13 @@ func (tv TypeAndValue) HasOk() bool {
        return tv.mode == commaok || tv.mode == mapindex
 }
 
+// Inferred reports the inferred type arguments and signature
+// for a parameterized function call that uses type inference.
+type Inferred struct {
+       Targs []Type
+       Sig   *Signature
+}
+
 // An Initializer describes a package-level variable, or a list of variables in case
 // of a multi-valued initialization expression, and the corresponding initialization
 // expression.