Ticket #46 (closed defect: fixed)
Records aren't working properly when declared using 'newtype' syntax.
| Reported by: | Elifant | Owned by: | nobody |
|---|---|---|---|
| Priority: | major | Milestone: | next release |
| Component: | hugs | Version: | 200609 |
| Keywords: | newtype record | Cc: |
Description
Test code:
newtype Test = Test { var :: String }
main = print (var x)
where x = Test { var = "a" }
Output:
" Program error: pattern match failure: instShow_v16_v1443 (Test_Test "a")
Records update is also broken:
newtype Test = Test { var :: String }
main = print (var x{var="b"})
where x = Test "a"
Output:
" Program error: pattern match failure: instShow_v16_v1443 (Test_Test "b")
It I change "newtype" with "data", all is OK.
Change History
Note: See
TracTickets for help on using
tickets.
