Ticket #46 (closed defect: fixed)

Opened 7 years ago

Last modified 7 years ago

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

Changed 7 years ago by ross

  • status changed from new to closed
  • resolution set to fixed

now fixed in CVS (but see #48).

Note: See TracTickets for help on using tickets.