#3409: type variable out of scope in worker/wrapper transformation
---------------------------------+------------------------------------------
    Reporter:  judahj            |        Owner:  chak            
        Type:  bug               |       Status:  new             
    Priority:  normal            |    Milestone:                  
   Component:  Compiler          |      Version:  6.10.3          
    Severity:  normal            |   Resolution:                  
    Keywords:                    |   Difficulty:  Unknown         
    Testcase:                    |           Os:  Unknown/Multiple
Architecture:  Unknown/Multiple  |  
---------------------------------+------------------------------------------
Comment (by judahj):

 Actually, I think there's something more serious going on.  I saved your
 above module as `ArrayExt.hs`, and created a new file named `MyCopy.hs`:
 {{{
 module MyCopy where

 import ArrayExt

 mycopy :: Array1 a -> Array1 a
 mycopy = copy 0
 }}}

 Compiling each module separately produces an error:
 {{{
 $ ghc --make -O2 ArrayExt.hs -fglasgow-exts
 [...]
 $ ghc --make -O2 MyCopy.hs
 [2 of 2] Compiling MyCopy           ( MyCopy.hs, MyCopy.o )
 The interface for `main:ArrayExt'
 Declaration for copy
 Unfolding of ArrayExt.copy:
   Iface type variable out of scope:  s
 }}}

 Strangely, if I compile them both with one call to `ghc --make` then the
 error doesn't occur.

 Also, I'm not sure whether in the above case the error actually stops the
 compilation, but if I do something similar with my original example then
 it very clearly stops ghc, with a message like the one in this bug's
 description.

 I'm pretty sure this is something to do with type functions, since I was
 able to work around the problem using fundeps.

-- 
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/3409#comment:4>
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

Reply via email to