#2738: Regression in type checking of sections in records
---------------------------------+------------------------------------------
Reporter: dons | Owner:
Type: bug | Status: new
Priority: normal | Component: Compiler (Type checker)
Version: 6.10.1 | Severity: normal
Keywords: | Testcase:
Architecture: Unknown/Multiple | Os: Unknown/Multiple
---------------------------------+------------------------------------------
Looks like a GHC 6.10 regression.
The following code, from xmonad-contrib, fails with an error under 6.10,
but not under other compilers,
{{{
[ 74 of 138] Compiling XMonad.Hooks.UrgencyHook (
XMonad/Hooks/UrgencyHook.hs, dist/build/XMonad/Hooks/UrgencyHook.o )
XMonad/Hooks/UrgencyHook.hs:424:48:
The section `5 `seconds`' takes one argument,
but its type `Int' has none
In the `duration' field of a record
In the expression:
DzenUrgencyHook {duration = (5 `seconds`), args = []}
In the definition of `dzenUrgencyHook':
dzenUrgencyHook = DzenUrgencyHook
{duration = (5 `seconds`), args = []}
}}}
The relevant code is:
{{{
-- | Flashes when a window requests your attention and you can't see it.
-- Defaults to a duration of five seconds, and no extra args to dzen.
-- See 'DzenUrgencyHook'.
dzenUrgencyHook :: DzenUrgencyHook
dzenUrgencyHook = DzenUrgencyHook { duration = (5 `seconds`), args = [] }
}}}
Which looks harmless enough. In fact, rearranging the section let's it
pass type checking:
{{{
dzenUrgencyHook = DzenUrgencyHook { duration = seconds 5, args = [] }
}}}
The relevant code can be found here:
http://code.haskell.org/XMonadContrib/XMonad/Hooks/UrgencyHook.hs, line
424.
To reproduce, assuming ghc 6.10 is installed, and X11,
{{{
$ cd XMonadContrib
$ cabal install
}}}
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/2738>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler_______________________________________________
Glasgow-haskell-bugs mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs