zackradisic / aussieplusplus

Programming language from down under
aussieplusplus.vercel.app
609 stars 15 forks source link

Function definitions erase previous definitions #18

Closed bbrk24 closed 2 years ago

bbrk24 commented 2 years ago
G'DAY MATE!

// declare function `f()`
THE HARD YAKKA FOR f IS () <
    GIMME "No args";
>

// intended to be an overload, ends up being a silent redefinition
THE HARD YAKKA FOR f IS (x) <
    GIMME x;
>

f(); // <- OI MATE, CAN YA FUCKIN' COUNT?? EXPECTED 1 ARGUMENTS BUT GOT 0

CHEERS C***!

That feels like the wrong error for that context. If the language doesn't support overloading, you shouldn't be able to redefine a function with the same name.

zackradisic commented 2 years ago

Fixed