Hello Perl 6 users and developers!

I asked this in #perl6, but I wasn't getting a response there, so I
figured I would try here.

In the following code:

> use v6;
> class C {
>     has Str $!dist-id;
>     submethod BUILD(:$!dist-id) {}
> }
> my ( $build ) = C.can('BUILD');
> say $build.signature.params[1].type; # prints Any, should it be Str?

If I try to pass a non-Str to C.new, I will get a type check failure,
as the value cannot go into $!dist-id, so that functionality works.
However, as in the example, if I am inspecting the signature, the type
constraint is Any.  Should we change this so that it's Str instead?

This brings up another question: how backwards compatible will 6.c be?
Let's say that the above behavior occurs with 6.c, and someone brings up
the Any vs Str question after 6.c is released.  Since someone could
technically depend on introspection of the signature returning Any in
this case, would we be hesitant to change the behavior?


Reply via email to