
#13068: GHC should not allow modules to define instances of abstract type classes -------------------------------------+------------------------------------- Reporter: ezyang | Owner: Type: bug | Status: new Priority: low | Milestone: Component: Compiler | Version: 8.1 (Type checker) | Keywords: backpack | Operating System: Unknown/Multiple Architecture: | Type of failure: GHC accepts Unknown/Multiple | invalid program Test Case: | Blocked By: Blocking: | Related Tickets: Differential Rev(s): | Wiki Page: -------------------------------------+------------------------------------- hs-boot files permit a type class to be given "abstractly", in which case any implementation of the type class is permissible. But it does not reject instances defined for such a class. {{{ -- A.hs-boot module A where class C a -- B.hs module B where import {-# SOURCE #-} A instance C Int where -- A.hs module A where import B class C a where f :: a -- Main.hs import A main = print (f :: Int) }}} I get this when I build with `--make`: {{{ ezyang@sabre:~$ ghc-head --make C.hs -fforce-recomp [1 of 4] Compiling A[boot] ( A.hs-boot, A.o-boot ) [2 of 4] Compiling B ( B.hs, B.o ) [3 of 4] Compiling A ( A.hs, A.o ) [4 of 4] Compiling Main ( C.hs, C.o ) Linking C ... ./B.o:(.data+0x0): undefined reference to `A_CZCC_con_info' collect2: error: ld returned 1 exit status }}} -- Ticket URL: http://ghc.haskell.org/trac/ghc/ticket/13068 GHC http://www.haskell.org/ghc/ The Glasgow Haskell Compiler