Closed ikegami closed 2 months ago
I believe that's reasonable since method
(and all other) keyword(s) also warns:
> perl -Mfeature=class -E "method {}"
method is experimental at -e line 1.
Cannot 'method' outside of a 'class' at -e line 1.
Searching I couldn't locate where to mark that as experimental, and that's not documented in:
@leonerd, can you take a look at this ticket? Thanks.
I'm trying to address this very issue in https://github.com/Perl/perl5/pull/22387 as linked above.
It seems the place to look at was within the toke.c
file where the other class-keywords are set to warn such as ADJUST
.
tags: 5.40.0 core class experimental warnings
__CLASS__
doesn't issue an warning identifying it as experimental likeclass
,field
,ADJUST
, etc do.It's moot since it can't be used outside of
class
and usingclass
does warn, but it's inconsistent with other such keywords, and it could become important ifclass
stops being experimental before__CLASS__
.