--define:nimQuirky exception handling for Nim; in preparation of a blog post

This commit is contained in:
Andreas Rumpf 2019-01-03 18:56:05 +01:00
commit cb9110c43d
7 changed files with 77 additions and 32 deletions

View file

@ -239,6 +239,7 @@ proc notFoundError*(c: PContext, n: PNode, errors: CandidateErrors) =
if c.config.m.errorOutputs == {}:
# fail fast:
globalError(c.config, n.info, "type mismatch")
return
if errors.len == 0:
localError(c.config, n.info, "expression '$1' cannot be called" % n[0].renderTree)
return