Skip to content

Commit

Permalink
Allow overloading procedures
Browse files Browse the repository at this point in the history
  • Loading branch information
nickg committed Dec 27, 2012
1 parent fd2ce44 commit 85d92f7
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/sem.c
Original file line number Diff line number Diff line change
Expand Up @@ -195,9 +195,12 @@ static tree_t scope_find_nth(ident_t i, int n)

static bool scope_can_overload(tree_t t)
{
return tree_kind(t) == T_ENUM_LIT
|| tree_kind(t) == T_FUNC_DECL
|| tree_kind(t) == T_FUNC_BODY;
tree_kind_t kind = tree_kind(t);
return (kind == T_ENUM_LIT)
|| (kind == T_FUNC_DECL)
|| (kind == T_FUNC_BODY)
|| (kind == T_PROC_DECL)
|| (kind == T_PROC_BODY);
}

static bool scope_hides(tree_t a, tree_t b)
Expand Down
14 changes: 14 additions & 0 deletions test/sem/procedure.vhd
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,18 @@ package body p is
diff_types(y => "f", 6); -- Error
end procedure;

procedure overload(x : in bit) is
begin
end procedure;

procedure overload(x : in integer) is
begin
end procedure;

procedure test_overload is
begin
overload('1');
overload(1);
end procedure;

end package body;

0 comments on commit 85d92f7

Please sign in to comment.