Skip to content

Commit

Permalink
Merge pull request #1599 from xushiwei/q
Browse files Browse the repository at this point in the history
infer lambda params
  • Loading branch information
xushiwei authored Jan 6, 2024
2 parents 7b32e03 + e25dcc1 commit 56af4d2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion cl/expr.go
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,11 @@ func makeLambdaParams(ctx *blockCtx, pos token.Pos, lhs []*ast.Ident, in *types.
}
params := make([]*types.Var, n)
for i, name := range lhs {
params[i] = pkg.NewParam(name.Pos(), name.Name, in.At(i).Type())
param := pkg.NewParam(name.Pos(), name.Name, in.At(i).Type())
params[i] = param
if rec := ctx.recorder(); rec != nil {
rec.Def(name, param)
}
}
return types.NewTuple(params...)
}
Expand Down

0 comments on commit 56af4d2

Please sign in to comment.