It keeps reporting 6.c even if other version is used:
<Zoffix__> c: 671c3d601,671c3d601~1 use v6.d.PREVIEW; use nqp; say nqp::getcomp('perl6').language_version; $*PERL.version.say
<committable6> Zoffix__, ¦671c3d6: «6.dv6.c» ¦671c3d601~1: «6.dv6.d»
According to bisectable, the change occurred during https://github.com/rakudo/rakudo/commit/671c3d60161053809415a2eb85097b0714417b56
(cc @nine, if you have any ideas)
I'd say not all hope is lost. The point of that commit was to avoid version parsing on startup or on first load of a module because it's costly. The invalid assumption was, that we know the Perl version anyway at compile time. But it's wrong by only one character: we know the Perl versions at compile time.
We could still prepare Version objects for all supported Perl versions (i.e. 6.c and 6.d) at BEGIN time and have the version method chose the right one at runtime.
I de-BEGIN-ified $*PERL in https://github.com/rakudo/rakudo/commit/c9ecfb7ae5 to get rid of this bug, but I didn't do anything else that was suggested in the above comment.
The SAP tests for language switching technically cover this bug, as they use $*PERL.version: https://github.com/perl6/roast/commit/2daefc06fd
Closing via #3040
Most helpful comment
I'd say not all hope is lost. The point of that commit was to avoid version parsing on startup or on first load of a module because it's costly. The invalid assumption was, that we know the Perl version anyway at compile time. But it's wrong by only one character: we know the Perl versions at compile time.
We could still prepare Version objects for all supported Perl versions (i.e. 6.c and 6.d) at BEGIN time and have the version method chose the right one at runtime.