Skip to content

Commit 9325c8a

Browse files
committed
refactor(compiler): rename call arg type helper
Rename callArgType to valType to reflect that the helper strips one pointer-storage layer when inferring value types.
1 parent c5ea2d0 commit 9325c8a

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

compiler/compiler.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ func (c *Compiler) callNeedsTempOutputs(info *ExprInfo, dest []*ast.Identifier)
211211
return outputTypesDiffer(info.OutTypes, c.resolvedDestTypes(dest, info.OutTypes))
212212
}
213213

214-
func callArgType(sym *Symbol) Type {
214+
func valType(sym *Symbol) Type {
215215
if ptr, ok := sym.Type.(Ptr); ok {
216216
return ptr.Elem
217217
}
@@ -242,7 +242,7 @@ func (c *Compiler) inferCallParamTypes(ce *ast.CallExpression, info *ExprInfo) (
242242
if useBoundScalars {
243243
if ident, ok := arg.(*ast.Identifier); ok {
244244
if sym, exists := c.getRawSymbol(ident.Value); exists {
245-
paramTypes = append(paramTypes, callArgType(sym))
245+
paramTypes = append(paramTypes, valType(sym))
246246
continue
247247
}
248248
}
@@ -255,7 +255,7 @@ func (c *Compiler) inferCallParamTypes(ce *ast.CallExpression, info *ExprInfo) (
255255
if !exists {
256256
return nil, c.reportMissingCallTypeInfo(arg.Tok(), fmt.Sprintf("could not resolve type information for call argument %q", ident.Value))
257257
}
258-
paramTypes = append(paramTypes, callArgType(sym))
258+
paramTypes = append(paramTypes, valType(sym))
259259
continue
260260
}
261261
return nil, c.reportMissingCallTypeInfo(arg.Tok(), "could not resolve type information for call argument")

0 commit comments

Comments
 (0)