Ancestors

Toot

Written by Julia on 2024-09-15 at 19:42

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

Descendants

Written by Elizabeth Mattijsen on 2024-09-15 at 22:16

@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

Written by Julia on 2024-09-16 at 14:50

@lizmat Done! https://github.com/rakudo/rakudo/issues/5643

=> More informations about this toot | More toots from julia@mathstodon.xyz

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113143274488344088
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
250.565311 milliseconds
Gemini-to-HTML Time
0.893026 milliseconds

This content has been proxied by September (3851b).