diff --git a/compiler/Type/Constrain/Expression.hs b/compiler/Type/Constrain/Expression.hs index 9431d0a..97af1f7 100644 --- a/compiler/Type/Constrain/Expression.hs +++ b/compiler/Type/Constrain/Expression.hs @@ -160,7 +160,7 @@ constrainDef env info (pattern, expr, maybeTipe) = (vars, typ) <- Env.instantiateType env tipe Map.empty let scheme = Scheme { rigidQuantifiers = [], flexibleQuantifiers = flexiVars ++ vars, - constraint = Loc.none CTrue, + constraint = Loc.noneNoDocs CTrue, header = Map.singleton name typ } c <- constrain env' expr typ return ( scheme : schemes diff --git a/compiler/Type/Constrain/Pattern.hs b/compiler/Type/Constrain/Pattern.hs index d09f470..eab64f5 100644 --- a/compiler/Type/Constrain/Pattern.hs +++ b/compiler/Type/Constrain/Pattern.hs @@ -8,6 +8,8 @@ import qualified Data.Maybe as Maybe import qualified Data.Map as Map import SourceSyntax.Pattern +import SourceSyntax.PrettyPrint +import Text.PrettyPrint (render) import qualified SourceSyntax.Location as Loc import Type.Type import Type.Fragment @@ -17,7 +19,7 @@ import qualified Type.Constrain.Literal as Literal constrain :: Environment -> Pattern -> Type -> IO Fragment constrain env pattern tipe = - let span = Loc.NoSpan + let span = Loc.NoSpan (render $ pretty pattern) t1 === t2 = Loc.L span (CEqual t1 t2) x b (_, CTrue) -> a - _ -> merge a b (CAnd [a,b]) + _ -> mergeOldDocs a b (CAnd [a,b]) infixr 9 ==> (==>) :: Type -> Type -> Type