[GHC] #6139: Data.Time.Day read instance too liberal

GHC cvs-ghc at haskell.org
Mon Jun 4 07:02:11 CEST 2012


#6139: Data.Time.Day read instance too liberal
-----------------------------------------+----------------------------------
 Reporter:  guest                        |          Owner:                  
     Type:  bug                          |         Status:  new             
 Priority:  normal                       |      Component:  libraries/base  
  Version:  7.0.3                        |       Keywords:                  
       Os:  Unknown/Multiple             |   Architecture:  Unknown/Multiple
  Failure:  Incorrect result at runtime  |       Testcase:                  
Blockedby:                               |       Blocking:                  
  Related:                               |  
-----------------------------------------+----------------------------------

Comment(by altaic):

 This looks to be fixed in 7.4.1:
 {{{
 $ ghci
 GHCi, version 7.4.1: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Prelude> :module Data.Time
 Prelude Data.Time> read "0001-22-01" :: Day 0001-12-01

 <interactive>:3:26: parse error on input `0001'
 }}}

 as well as in git master:
 {{{
 $ ./inplace/bin/ghc-stage2 --interactive
 GHCi, version 7.5.20120602: http://www.haskell.org/ghc/  :? for help
 Loading package ghc-prim ... linking ... done.
 Loading package integer-gmp ... linking ... done.
 Loading package base ... linking ... done.
 Prelude> :module Data.Time
 Prelude Data.Time> read "0001-22-01" :: Day 0001-12-01

 <interactive>:3:26:
     Illegal literal in type (use -XDataKinds to enable): 1
 }}}

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/6139#comment:2>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler



More information about the Glasgow-haskell-bugs mailing list