MCPcopy Create free account
hub / github.com/brimdata/super / resolveVariant

Method resolveVariant

compiler/semantic/resolver.go:119–134  ·  view source on GitHub ↗
(d *funcDecl, variant *funcDef, inType super.Type)

Source from the content-addressed store, hash-verified

117}
118
119func (r *resolver) resolveVariant(d *funcDecl, variant *funcDef, inType super.Type) {
120 save := r.t.scope
121 r.t.scope = NewScope(d.scope)
122 defer func() {
123 r.t.scope = save
124 }()
125 r.t.enterScope()
126 for _, lambda := range variant.lambdas {
127 r.t.scope.BindSymbol(lambda.param, &funcParamLambda{param: lambda.param, id: lambda.id})
128 }
129 for _, param := range variant.params {
130 r.t.scope.BindSymbol(param, funcParamValue{})
131 }
132 variant.body, _ = r.t.expr(d.lambda.Expr, inType)
133 r.t.exitScope()
134}
135
136func (r *resolver) resolveFixed(d *funcDecl, tag string, inType super.Type) *funcDef {
137 save := r.t.scope

Callers 1

getVariantMethod · 0.95

Calls 5

NewScopeFunction · 0.85
enterScopeMethod · 0.80
BindSymbolMethod · 0.80
exitScopeMethod · 0.80
exprMethod · 0.45

Tested by

no test coverage detected