Skip to content

Commit

Permalink
improve a couple error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
charles-cooper committed Feb 8, 2024
1 parent ac8d26a commit 524a7e8
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions vyper/semantics/types/function.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def from_vyi(cls, funcdef: vy_ast.FunctionDef) -> "ContractFunctionT":

if len(funcdef.body) != 1 or not isinstance(funcdef.body[0].get("value"), vy_ast.Ellipsis):
raise FunctionDeclarationException(
"function body in an interface can only be ...!", funcdef
"function body in an interface can only be `...`!", funcdef
)

assert function_visibility is not None # mypy hint
Expand Down Expand Up @@ -657,7 +657,9 @@ def _parse_decorators(
if FunctionVisibility.is_valid_value(decorator.id):
if function_visibility is not None:
raise FunctionDeclarationException(
f"Visibility is already set to: {function_visibility}", funcdef
f"Visibility is already set to: {function_visibility}",
decorator,
hint="only one visibility decorator is allowed per function",
)
function_visibility = FunctionVisibility(decorator.id)

Expand Down

0 comments on commit 524a7e8

Please sign in to comment.