Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow function types in records without parentheses #2180

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

## Bug fixes

* Function types in records no longer require gratuitous parentheses.
(#1994)

* Unexpected special-case type behavior of monad binds in the
syntactic top level has been removed.
(This was _not_ specifically associated with the TopLevel monad, so
Expand Down
1 change: 1 addition & 0 deletions intTests/test1994/test.saw
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
let thing : { fn: Int -> Int } = { fn = \x -> x };
3 changes: 3 additions & 0 deletions intTests/test1994/test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
set -e

$SAW test.saw
2 changes: 1 addition & 1 deletion src/SAWScript/Parser.y
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ Type :: { Type }
| BaseType '->' Type { tFun (maxSpan [$1, $3]) $1 $3 }

FieldType :: { (Name, Type) }
: name ':' BaseType { (tokStr $1, $3) }
: name ':' Type { (tokStr $1, $3) }

BaseType :: { Type }
: name { tVar (getPos $1) (tokStr $1) }
Expand Down
Loading