Commits on Source (7)
-
Simon Peyton Jones authored
In particular In the type signature for: f :: Int -> Int I added the colon Also reword the "maybe you haven't applied a function to enough arguments?" suggestion to make grammatical sense. These tiny changes affect a lot of error messages.
-
Simon Peyton Jones authored
I think the new implementation is a bit more efficient, because it uses a work-list, rather than iterating over the entire set every time
-
Simon Peyton Jones authored
This fixes an ASSERT failure in TcBinds. The problem was that we were generating NoGen plan for a function with a partial type signature, and that led to confusion and lost invariants. See Note [Partial type signatures and generalisation] in TcBinds
-
Simon Peyton Jones authored
When doing top-level defaulting, in TcSimplify.applyDefaultingRules, we were temporarily making a unification variable equal to the default type (Integer, say, or Float), as a 'given', and trying to solve. But this relied on the unification variable being untouchable, which seems complicated. It's much simpler just to generate a new set of constraints to solve, using newWantedEvVarNC in disambigGroup. (I tripped over an ASSERT failure, and this solved it in a robust way.)
-
Simon Peyton Jones authored
The main change is in TypeRep.pprTheta, so we print Eq a for a singleton, but (Eq a, Show a) for multiple constraints. There are lots of trivial knock-on changes to error messages
-
Simon Peyton Jones authored
The idea was promted by Trac #9939, but it was Christmas, so I did some recreational programming that went much further. The idea is to warn when a constraint in a user-supplied context is redundant. Everything is described in detail in Note [Tracking redundant constraints] in TcSimplify. Main changes: * The new ic_status field in an implication, of type ImplicStatus. It replaces ic_insol, and includes information about redundant constraints. * New function TcSimplify.setImplicationStatus sets the ic_status. * TcSigInfo has sig_report_redundant field to say whenther a redundant constraint should be reported; and similarly the FunSigCtxt constructor of UserTypeCtxt * EvBinds has a field eb_is_given, to record whether it is a given or wanted binding. Some consequential chagnes to creating an evidence binding (so that we record whether it is given or wanted). * AbsBinds field abs_ev_binds is now a *list* of TcEvBiinds; see Note [Typechecking plan for instance declarations] in TcInstDcls * Some significant changes to the type checking of instance declarations; Note [Typechecking plan for instance declarations] in TcInstDcls. * I found that TcErrors.relevantBindings was failing to zonk the origin of the constraint it was looking at, and hence failing to find some relevant bindings. Easy to fix, and orthogonal to everything else, but hard to disentangle. Some minor refactorig: * TcMType.newSimpleWanteds moves to Inst, renamed as newWanteds * TcClassDcl and TcInstDcls now have their own code for typechecking a method body, rather than sharing a single function. The shared function (ws TcClassDcl.tcInstanceMethodBody) didn't have much code and the differences were growing confusing. * Add new function TcRnMonad.pushLevelAndCaptureConstraints, and use it * Add new function Bag.catBagMaybes, and use it in TcSimplify
-
Simon Peyton Jones authored
Showing
- compiler/basicTypes/BasicTypes.hs 2 additions, 0 deletionscompiler/basicTypes/BasicTypes.hs
- compiler/basicTypes/Name.hs 2 additions, 1 deletioncompiler/basicTypes/Name.hs
- compiler/basicTypes/VarSet.hs 22 additions, 7 deletionscompiler/basicTypes/VarSet.hs
- compiler/cmm/CmmExpr.hs 4 additions, 4 deletionscompiler/cmm/CmmExpr.hs
- compiler/cmm/Hoopl/Dataflow.hs 1 addition, 1 deletioncompiler/cmm/Hoopl/Dataflow.hs
- compiler/coreSyn/TrieMap.hs 2 additions, 2 deletionscompiler/coreSyn/TrieMap.hs
- compiler/deSugar/DsArrows.hs 2 additions, 2 deletionscompiler/deSugar/DsArrows.hs
- compiler/deSugar/DsBinds.hs 17 additions, 10 deletionscompiler/deSugar/DsBinds.hs
- compiler/deSugar/DsExpr.hs 1 addition, 1 deletioncompiler/deSugar/DsExpr.hs
- compiler/deSugar/MatchLit.hs 1 addition, 1 deletioncompiler/deSugar/MatchLit.hs
- compiler/ghci/ByteCodeItbls.hs 4 additions, 2 deletionscompiler/ghci/ByteCodeItbls.hs
- compiler/ghci/Linker.hs 1 addition, 1 deletioncompiler/ghci/Linker.hs
- compiler/hsSyn/HsBinds.hs 7 additions, 2 deletionscompiler/hsSyn/HsBinds.hs
- compiler/hsSyn/HsDecls.hs 3 additions, 5 deletionscompiler/hsSyn/HsDecls.hs
- compiler/hsSyn/HsExpr.hs 4 additions, 4 deletionscompiler/hsSyn/HsExpr.hs
- compiler/iface/BuildTyCl.hs 1 addition, 1 deletioncompiler/iface/BuildTyCl.hs
- compiler/iface/IfaceSyn.hs 1 addition, 1 deletioncompiler/iface/IfaceSyn.hs
- compiler/main/CmdLineParser.hs 1 addition, 1 deletioncompiler/main/CmdLineParser.hs
- compiler/main/DynFlags.hs 5 additions, 2 deletionscompiler/main/DynFlags.hs
- compiler/main/GHC.hs 7 additions, 3 deletionscompiler/main/GHC.hs