You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is actually a more generic problem affecting user-created
classes as well:
$ perl6 -e 'class b { }; { my &b; say b.WHAT, b().WHAT }'
(b)(b(Any))
...it is just that the native types have no idea what to do
when invoked and are noisier. The above results could be equally
surprizing for someone expecting &b to get called.
If there is something in the spec that says that an outer class
namespace should be considered before the inner sub namespace I
have not seen it. When the sub is scoped more inner than the class,
I would expect the sub to win all constructs where using it
is vaid to use, personally,
I would also expect the invocation to prefer a sub over a type
when both are defined in the same scope for b(), but in this
case an argument could be made either way about the bareword
(and perhaps that should die as amibiguous.)
➜ class a {}; { sub a {42}; say a() }
Method 'shortname' not found for invocant of class 'Perl6::Metamodel::CoercionHOW'
in block <unit> at -e line 1 (a)
Migrated from rt.perl.org#124442 (status was 'open')
Searchable as RT124442$
The text was updated successfully, but these errors were encountered: