on master help sign in
Make TODO error messages more helpful
c5c6b2dEvan Czaplicki
src/Canonicalize/Environment.hs+5−5
@@ -168,7 +168,7 @@ findType region (Env _ _ types _ _ _ _ _) name =
168 error "TODO findType ambiguous unqualified"
168 error "TODO findType ambiguous unqualified"
169
169
170 Nothing ->
170 Nothing ->
171− error "TODO findType not found" region
171+ error ("TODO findType not found: " ++ N.toString name) region
172
172
173
173
174findTypeQual :: R.Region -> Env -> N.Name -> N.Name -> Result i w Type
174findTypeQual :: R.Region -> Env -> N.Name -> N.Name -> Result i w Type
@@ -200,10 +200,10 @@ findCtor region (Env _ _ _ ctors _ _ _ _) name =
200 Result.ok ctor
200 Result.ok ctor
201
201
202 Just _ ->
202 Just _ ->
203− error "TODO findCtor ambiguous unqualified"
203+ error ("TODO findCtor ambiguous unqualified " ++ N.toString name)
204
204
205 Nothing ->
205 Nothing ->
206− error "TODO findCtor not found" region
206+ error ("TODO findCtor not found " ++ N.toString name) region
207
207
208
208
209findCtorQual :: R.Region -> Env -> N.Name -> N.Name -> Result i w Ctor
209findCtorQual :: R.Region -> Env -> N.Name -> N.Name -> Result i w Ctor
@@ -235,7 +235,7 @@ findBinop region (Env _ _ _ _ binops _ _ _) name =
235 Result.ok binop
235 Result.ok binop
236
236
237 Nothing ->
237 Nothing ->
238− Result.throw (error "TODO unknown binop" region)
238+ Result.throw (error ("TODO unknown binop " ++ N.toString name) region)
239
239
240 Just _ ->
240 Just _ ->
241− Result.throw (error "TODO ambiguous binop" region)
241+ Result.throw (error ("TODO ambiguous binop " ++ N.toString name) region)
src/Canonicalize/Environment/Foreign.hs+1−1
@@ -269,7 +269,7 @@ throwImportNotFound region name knownModules =
269
269
270throwExposingNotFound :: R.Region -> N.Name -> Result i w a
270throwExposingNotFound :: R.Region -> N.Name -> Result i w a
271throwExposingNotFound region name =
271throwExposingNotFound region name =
272− Result.throw (error "TODO throwExposingNotFound" region name)
272+ Result.throw (error ("TODO throwExposingNotFound " ++ N.toString name) region name)
273
273
274{-
274{-
275 let
275 let
src/Canonicalize/Expression.hs+5−5
@@ -705,10 +705,10 @@ findVar region (Env.Env localHome vars _ _ _ _ _ _) name =
705 Can.VarForeign home name annotation
705 Can.VarForeign home name annotation
706
706
707 OneOrMore.More _ _ ->
707 OneOrMore.More _ _ ->
708− Result.throw (error "TODO ambiguous unqualified" region)
708+ Result.throw (error ("TODO ambiguous unqualified " ++ N.toString name) region)
709
709
710 Nothing ->
710 Nothing ->
711− Result.throw (error "TODO no name" region)
711+ Result.throw (error ("TODO no name " ++ N.toString name) region)
712
712
713
713
714findVarQual :: R.Region -> Env.Env -> N.Name -> N.Name -> Result FreeLocals w Can.Expr_
714findVarQual :: R.Region -> Env.Env -> N.Name -> N.Name -> Result FreeLocals w Can.Expr_
@@ -724,16 +724,16 @@ findVarQual region (Env.Env localHome _ _ _ _ vars _ _) prefix name =
724 Can.VarForeign home name annotation
724 Can.VarForeign home name annotation
725
725
726 Just _ ->
726 Just _ ->
727− Result.throw (error "TODO ambiguous qualified" region)
727+ Result.throw (error ("TODO ambiguous qualified " ++ N.toString name) region)
728
728
729 Nothing ->
729 Nothing ->
730− Result.throw (error "TODO no qualified" region)
730+ Result.throw (error ("TODO no qualified " ++ N.toString name) region)
731
731
732 Nothing ->
732 Nothing ->
733 if ModuleName.isKernel prefix then
733 if ModuleName.isKernel prefix then
734 Result.ok $ Can.VarKernel (ModuleName.getKernel prefix) name
734 Result.ok $ Can.VarKernel (ModuleName.getKernel prefix) name
735 else
735 else
736− Result.throw (error "TODO no name" region)
736+ Result.throw (error ("TODO no name " ++ N.toString name) region)
737
737
738
738
739-- FIND CTOR
739-- FIND CTOR