Description
&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:
Expected behavior
... actually I'm not sure about the third one. I think that ought to be a runtime error, maybe?