MCPcopy
hub / github.com/google/go-jsonnet / newSimpleFuncType

Method newSimpleFuncType

linter/internal/types/graph.go:39–54  ·  view source on GitHub ↗
(returnType placeholderID, argNames ...ast.Identifier)

Source from the content-addressed store, hash-verified

37type exprTypes map[ast.Node]TypeDesc
38
39func (g *typeGraph) newSimpleFuncType(returnType placeholderID, argNames ...ast.Identifier) placeholderID {
40 p := g.newPlaceholder()
41 params := []ast.Parameter{}
42 for _, argName := range argNames {
43 params = append(params, ast.Parameter{Name: argName})
44 }
45 g._placeholders[p] = concreteTP(TypeDesc{
46 FunctionDesc: &functionDesc{
47 resultContains: []placeholderID{returnType},
48 params: params,
49 minArity: len(argNames),
50 maxArity: len(argNames),
51 },
52 })
53 return p
54}
55
56func (g *typeGraph) newFuncType(returnType placeholderID, params []ast.Parameter) placeholderID {
57 p := g.newPlaceholder()

Callers 1

prepareStdlibFunction · 0.80

Calls 2

newPlaceholderMethod · 0.95
concreteTPFunction · 0.85

Tested by

no test coverage detected