on master help sign in
Make TODO error messages more helpful
commitc5c6b2d9013afd3d559df1e400d107a2b50ae462 authorEvan Czaplicki <evancz@users.noreply.github.com> dateWed 24 Jan 2018, 18:17 (9 years ago) parent03e214d
3 files changed+11−11
src/Canonicalize/Environment.hs+5−5 src/Canonicalize/Environment/Foreign.hs+1−1 src/Canonicalize/Expression.hs+5−5
src/Canonicalize/Environment.hs+5−5
@@ -168,7 +168,7 @@ findType region (Env _ _ types _ _ _ _ _) name =
168168 error "TODO findType ambiguous unqualified"
169169
170170 Nothing ->
171− error "TODO findType not found" region
171+ error ("TODO findType not found: " ++ N.toString name) region
172172
173173
174174findTypeQual :: R.Region -> Env -> N.Name -> N.Name -> Result i w Type
@@ -200,10 +200,10 @@ findCtor region (Env _ _ _ ctors _ _ _ _) name =
200200 Result.ok ctor
201201
202202 Just _ ->
203− error "TODO findCtor ambiguous unqualified"
203+ error ("TODO findCtor ambiguous unqualified " ++ N.toString name)
204204
205205 Nothing ->
206− error "TODO findCtor not found" region
206+ error ("TODO findCtor not found " ++ N.toString name) region
207207
208208
209209findCtorQual :: R.Region -> Env -> N.Name -> N.Name -> Result i w Ctor
@@ -235,7 +235,7 @@ findBinop region (Env _ _ _ _ binops _ _ _) name =
235235 Result.ok binop
236236
237237 Nothing ->
238− Result.throw (error "TODO unknown binop" region)
238+ Result.throw (error ("TODO unknown binop " ++ N.toString name) region)
239239
240240 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 =
269269
270270throwExposingNotFound :: R.Region -> N.Name -> Result i w a
271271throwExposingNotFound region name =
272− Result.throw (error "TODO throwExposingNotFound" region name)
272+ Result.throw (error ("TODO throwExposingNotFound " ++ N.toString name) region name)
273273
274274{-
275275 let
src/Canonicalize/Expression.hs+5−5
@@ -705,10 +705,10 @@ findVar region (Env.Env localHome vars _ _ _ _ _ _) name =
705705 Can.VarForeign home name annotation
706706
707707 OneOrMore.More _ _ ->
708− Result.throw (error "TODO ambiguous unqualified" region)
708+ Result.throw (error ("TODO ambiguous unqualified " ++ N.toString name) region)
709709
710710 Nothing ->
711− Result.throw (error "TODO no name" region)
711+ Result.throw (error ("TODO no name " ++ N.toString name) region)
712712
713713
714714findVarQual :: 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 =
724724 Can.VarForeign home name annotation
725725
726726 Just _ ->
727− Result.throw (error "TODO ambiguous qualified" region)
727+ Result.throw (error ("TODO ambiguous qualified " ++ N.toString name) region)
728728
729729 Nothing ->
730− Result.throw (error "TODO no qualified" region)
730+ Result.throw (error ("TODO no qualified " ++ N.toString name) region)
731731
732732 Nothing ->
733733 if ModuleName.isKernel prefix then
734734 Result.ok $ Can.VarKernel (ModuleName.getKernel prefix) name
735735 else
736− Result.throw (error "TODO no name" region)
736+ Result.throw (error ("TODO no name " ++ N.toString name) region)
737737
738738
739739-- FIND CTOR