From 9e89b246f1340c119b75a0e333ec1d969c76289e Mon Sep 17 00:00:00 2001 From: Patrick Oscar Boykin Date: Sun, 17 Sep 2023 09:33:22 -1000 Subject: [PATCH] minor code improvement --- core/src/main/scala/org/bykn/bosatsu/DefRecursionCheck.scala | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/src/main/scala/org/bykn/bosatsu/DefRecursionCheck.scala b/core/src/main/scala/org/bykn/bosatsu/DefRecursionCheck.scala index 4c85d8258..e27f0a639 100644 --- a/core/src/main/scala/org/bykn/bosatsu/DefRecursionCheck.scala +++ b/core/src/main/scala/org/bykn/bosatsu/DefRecursionCheck.scala @@ -420,7 +420,9 @@ object DefRecursionCheck { checkDecl(t) *> checkDecl(c) *> checkDecl(f) case Lambda(args, body) => // these args create new bindings: - checkForIllegalBindsSt(args.patternNames, decl) *> filterNames(args.patternNames)(checkDecl(body)) + val newBinds = args.patternNames + checkForIllegalBindsSt(newBinds, decl) *> + filterNames(newBinds)(checkDecl(body)) case Literal(_) => unitSt case Match(RecursionKind.NonRecursive, arg, cases) =>