#5910: Holes with other constraints
----------------------------------------+-----------------------------------
    Reporter:  xnyhps                   |       Owner:                          
         
        Type:  feature request          |      Status:  new                     
         
    Priority:  normal                   |   Milestone:                          
         
   Component:  Compiler (Type checker)  |     Version:  7.5                     
         
    Keywords:  holes                    |          Os:  Unknown/Multiple        
         
Architecture:  Unknown/Multiple         |     Failure:  Incorrect warning at 
compile-time
  Difficulty:  Unknown                  |    Testcase:                          
         
   Blockedby:                           |    Blocking:                          
         
     Related:                           |  
----------------------------------------+-----------------------------------

Comment(by dreixel):

 You might have to treat ambiguity errors in a special way. They can still
 be deferred with `-fdefer-type-errors`, and the error message adequately
 says there are two possible instances:
 {{{
     No instance for (Show (Foo a0)) arising from a use of `show'
     The type variable `a0' is ambiguous
     Possible fix: add a type signature that fixes these type variable(s)
     Note: there are several potential instances:
       instance Show (Foo Bar1) -- Defined at Holes.hs:7:11
       instance Show (Foo Bar2) -- Defined at Holes.hs:8:11
     Possible fix: add an instance declaration for (Show (Foo a0))
     In the expression: show (Foo undefined)
     In an equation for `test': test = show (Foo undefined)
 }}}
 So maybe you could use this in the feedback for holes with an ambiguous
 type.

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

_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs

Reply via email to