diff --git a/guppylang/ast_util.py b/guppylang/ast_util.py index 309496bf..99231473 100644 --- a/guppylang/ast_util.py +++ b/guppylang/ast_util.py @@ -343,4 +343,8 @@ def has_empty_body(func_ast: ast.FunctionDef) -> bool: if len(func_ast.body) > 1: return False [n] = func_ast.body - return isinstance(n, ast.Expr) and isinstance(n.value, ast.Ellipsis) + return ( + isinstance(n, ast.Expr) + and isinstance(n.value, ast.Constant) + and n.value.value == Ellipsis + )