Skip to content

Commit

Permalink
Fix argument label of synthetic function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
SupunS committed Jan 24, 2025
1 parent 85172b0 commit 269e3d6
Showing 1 changed file with 10 additions and 3 deletions.
13 changes: 10 additions & 3 deletions bbq/compiler/desugar.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func (d *Desugar) desugarConditions(
continue
}

// If the inheritted function has pre-conditions, then add an invocation
// If the inherited function has pre-conditions, then add an invocation
// to call the generated pre-condition-function of the interface.

// Generate: `FooInterface.bar.&preCondition(a1, a2)`
Expand Down Expand Up @@ -759,7 +759,7 @@ func (d *Desugar) interfaceDelegationMethodCall(
arguments := make([]*ast.Argument, 0)
for _, param := range inheritedFunc.ParameterList.Parameters {
var arg *ast.Argument
if param.Label == "" {
if param.Label == "_" {
arg = ast.NewUnlabeledArgument(
d.memoryGauge,
ast.NewIdentifierExpression(
Expand All @@ -768,9 +768,16 @@ func (d *Desugar) interfaceDelegationMethodCall(
),
)
} else {
var label string
if param.Label == "" {
label = param.Identifier.Identifier
} else {
label = param.Label
}

arg = ast.NewArgument(
d.memoryGauge,
param.Label,
label,
&param.StartPos,
&param.StartPos,
ast.NewIdentifierExpression(
Expand Down

0 comments on commit 269e3d6

Please sign in to comment.