Skip to content

Commit

Permalink
Merge pull request #2180 from GaloisInc/1994-functions-in-records
Browse files Browse the repository at this point in the history
Allow function types in records without parentheses
  • Loading branch information
sauclovian-g authored Jan 15, 2025
2 parents fce73f3 + 01ecfd2 commit da1cf80
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 1 deletion.
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

0 comments on commit da1cf80

Please sign in to comment.