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
&CORE::__CLASS__ should either fail cleanly (Undefined subroutine &CORE::__CLASS__ called or similar) or work and return a class name. Instead it returns the caller's filename.
Steps to Reproduce
use v5.36;
use experimental qw(class);
class Foo {
method f1() { __CLASS__ }
method f2() { &CORE::__CLASS__() }
method f3() { \&CORE::__CLASS__ }
}
my$o = Foo->new;
say$o->f1;
say$o->f2;
say$o->f3->();
Output:
Foo
bug.pl
bug.pl
Expected behavior
Foo
Foo
Foo
... actually I'm not sure about the third one. I think that ought to be a runtime error, maybe?