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 | View the thread | More toots from julia@mathstodon.xyz
=> View rakulang tag This content has been proxied by September (3851b).Proxy Information
text/gemini