Disallow duplicated callback declarations

A duplicated callback would silently overwrite the previous declaration,
which is counter-intuitive.
This commit is contained in:
Simon Hausmann 2022-11-15 16:58:33 +01:00 committed by Simon Hausmann
parent bae5dbfa16
commit 27db2bdcc6
3 changed files with 20 additions and 10 deletions

View file

@ -15,7 +15,7 @@ Comp := Rectangle {
callback cb1(Rectangle);
// ^error{'Rectangle' is not a valid type}
callback cb1() -> Rectangle;
callback cb2() -> Rectangle;
// ^error{'Rectangle' is not a valid type}
}

View file

@ -3,6 +3,8 @@
SubElements := Rectangle {
callback foobar;
callback foobar;
// ^error{Duplicated callback declaration}
callback callback_with_arg(int, string);