if is_toplevel_context and recv_is_self and not mproperty.is_toplevel then
assert mproperty isa MMethod
if is_toplevel_context and recv_is_self and not mproperty.is_toplevel then
- error(node, "Error: '{name}' is not a top-level method, thus need a receiver.")
+ error(node, "Error: `{name}` is not a top-level method, thus need a receiver.")
end
if not recv_is_self and mproperty.is_toplevel then
end
if not recv_is_self and mproperty.is_toplevel then
- error(node, "Error: cannot call '{name}', a top-level method, with a receiver.")
+ error(node, "Error: cannot call `{name}`, a top-level method, with a receiver.")
end
if mproperty.visibility == protected_visibility and not recv_is_self and self.mmodule.visibility_for(mproperty.intro_mclassdef.mmodule) < intrude_visibility and not modelbuilder.toolcontext.opt_ignore_visibility.value then
end
if mproperty.visibility == protected_visibility and not recv_is_self and self.mmodule.visibility_for(mproperty.intro_mclassdef.mmodule) < intrude_visibility and not modelbuilder.toolcontext.opt_ignore_visibility.value then
- self.modelbuilder.error(node, "Error: Method '{name}' is protected and can only acceded by self.")
+ self.modelbuilder.error(node, "Error: method `{name}` is protected and can only accessed by `self`.")
- #self.modelbuilder.error(node, "Error: Incorrect number of parameters. Got {args.length}, expected at least {msignature.arity}. Signature is {msignature}")
- self.modelbuilder.error(node, "Error: arity mismatch; prototype is '{name}{msignature}'")
+ modelbuilder.error(node, "Error: expected at least {msignature.arity} argument(s) for `{mproperty}{msignature}`; got {args.length}. See introduction at `{mproperty.full_name}`.")
return false
end
else if args.length != msignature.arity then
return false
end
else if args.length != msignature.arity then
- self.modelbuilder.error(node, "Error: Incorrect number of parameters. Got {args.length}, expected {msignature.arity}. Signature is {msignature}")
+ modelbuilder.error(node, "Error: expected {msignature.arity} argument(s) for `{mproperty}{msignature}`; got {args.length}. See introduction at `{mproperty.full_name}`.")
if mpropdef.msignature.arity < msignature.arity then
else
# Check there is at least enough parameters
if mpropdef.msignature.arity < msignature.arity then
- v.error(self, "Error: Not enough implicit arguments to pass. Got {mpropdef.msignature.arity}, expected at least {msignature.arity}. Signature is {msignature}")
+ v.error(self, "Error: not enough implicit arguments to pass. Got `{mpropdef.msignature.arity}`, expected at least `{msignature.arity}`. Signature is `{msignature}`.")
- v.error(self, "Type error: expected argument #{i} of type {sp.mtype}, got implicit argument {p.name} of type {p.mtype}. Signature is {msignature}")
+ v.error(self, "Type Error: expected argument #{i} of type `{sp.mtype}`, got implicit argument `{p.name}` of type `{p.mtype}`. Signature is {msignature}")