← All programs · Programs that must fail
Programs that must fail #12
Both compilers refuse this program — correctly
The program is broken on purpose. The right behaviour is a compile-time error instead of output, and that is what both compilers give.
The program
sub f($x, $x) { };
Run executes the program in your browser, with the Raku++ build this site ships. Edit it and try variations.
What each compiler printed
Rakudo 2026.08
(printed nothing)
Raku++ 5.0.0-g312cde8e
(printed nothing)
Error messages
Rakudo 2026.08
===SORRY!=== Error while compiling invalid-00000051.raku
Redeclaration of symbol '$x'.
at invalid-00000051.raku:1
------> sub f($x, $x<HERE>) { };
expecting any of:
shape declarationRaku++ 5.0.0-g312cde8e
===SORRY!=== Parse error at line 1: Redeclaration of symbol '$x'
1 | sub f($x, $x) { };
at invalid-00000051.raku:1The wording of an error message is up to each compiler; what matters is that both refuse the program.
invalid-v1 · seed 51 · recorded 2026-09-29 with Rakudo 2026.08 and Raku++ 5.0.0-g312cde8e · Source on GitHub ↗