I wish this (strange) code would show a diagnostic like “Did you mean to pre-declare ‘B’?” rather than “Redeclaration of symbol ‘B’.”
class B {}
class A {
has B $.b;
}
class B {
has Mu $.something; # doesn't matter; i just want to put something here for this example
}
The fix is to create a stub class (class B {…}), but this is not obvious at first glance. (In this case, we could also fix it by merging the two definitions of B and moving B to appear before A, but I can’t do that in my actual code.)
[#]RakuLang
=> More informations about this toot | More toots from julia@mathstodon.xyz
@julia
Good point. If the class being re-declared is empty, the error message should suggest stubbing the class.
Could you make an issue for that?
https://github.com/rakudo/rakudo/issues/new
=> More informations about this toot | More toots from lizmat@mastodon.social
@lizmat Done! https://github.com/rakudo/rakudo/issues/5643
=> More informations about this toot | More toots from julia@mathstodon.xyz This content has been proxied by September (3851b).Proxy Information
text/gemini