Skip to content

Commit

Permalink
Fix define-case-lambda-to-define size issue (#238)
Browse files Browse the repository at this point in the history
Fixes #226.
  • Loading branch information
jackfirth authored Aug 22, 2024
1 parent 668084b commit 165dccf
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
16 changes: 16 additions & 0 deletions default-recommendations/function-definition-shortcuts-test.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,22 @@ test: "case-lambda with default arg not refactorable when required args out of o
------------------------------


test: "case-lambda with default arg not refactorable when default is a multiline expression"
------------------------------
(define f
(case-lambda
[(a b c)
(f a
b
c
(let ([x 42])
(displayln x)
x))]
[(a b c x)
1]))
------------------------------


test: "case-lambda with default arg and multiple body forms"
------------------------------
(define f
Expand Down
1 change: 1 addition & 0 deletions default-recommendations/function-definition-shortcuts.rkt
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@
(usage:id usage1:id ... default:expr)]
[(case2-arg:id ... bonus-arg:id)
body ...]))
#:when (oneline-syntax? #'default)
#:when (free-identifier=? #'id #'usage)
#:when (free-identifiers=? #'(case1-arg ...) #'(case2-arg ...))
#:when (free-identifiers=? #'(case1-arg ...) #'(usage1 ...))
Expand Down

0 comments on commit 165dccf

Please sign in to comment.