Fix precedence for records in derived Read
authorsimonpj@microsoft.com <unknown>
Thu, 4 May 2006 11:18:04 +0000 (11:18 +0000)
committersimonpj@microsoft.com <unknown>
Thu, 4 May 2006 11:18:04 +0000 (11:18 +0000)
commit381b1a6243eba79b27e089a0ad677d82c8955165
treed8c96834c018e70fc94862187e9d0bb651677ddf
parentdd09857f4b1bb6375ca807ca06f13ab0625e463d
Fix precedence for records in derived Read

The derived instance for Read of records wasn't quite right.
Consider
data T = T1 T | T2 { x::Int }

The string "T1 T2 { x=2 }" should parse correctly as
T1 (T2 {x=2})
because of Haskell's odd precedence rules (record construction binds
even more tightly than application), but the derived Read didn't take
account of that.

drvrun020 is the regression test
compiler/typecheck/TcGenDeriv.lhs