Skip to content

Commit

Permalink
Compatibilize spec with language-switching compilers
Browse files Browse the repository at this point in the history
6.c spec does not define how language switching is to behave, and
that is still largely undefined and lacks a PoV in 6.d spec due to
blockage by R#1289[^1]. The rudimentary PoV for language switching
currently does not propage the active language version to EVALed
code, and so `throws-like` tests with stringy code continue using
default compiler's language version.

Were that to be defined as the behaviour for language switching,
then the tests being modified by this commit would be deemed wrong,
as they do not set correct lang version. The same would actually
apply to all `throws-like` tests with Str argument. It's more likely
that this behaviour will be deemed unwanted and language switching
will be defined in a way that lets EVAL use caller's lang ver.

Since R#1289 isn't a trivial issue, I'm going to correct just these
couple of tests until language switching behaviour is more fully
defined. The change in a test module to move the version as first
line is also part of undefinedness of lang switching, which is
now more well-defined and makes it a requirement the lang is the
first statement in code.

[1] rakudo/rakudo#1289
[2] https://colabti.org/irclogger/irclogger_log/perl6-dev?date=2018-10-27#l140
  • Loading branch information
zoffixznet committed Oct 27, 2018
1 parent 2fa2ad5 commit ddaaa58
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion S04-declarations/constant.t
Expand Up @@ -36,7 +36,7 @@ plan 70;
}

{
throws-like 'constant %hash = "nothash"', X::TypeCheck, 'constant hash requires Associative';
throws-like 'use v6.c; constant %hash = "nothash"', X::TypeCheck, 'constant hash requires Associative';
}

{
Expand Down
2 changes: 1 addition & 1 deletion S11-modules/InnerModule.pm
@@ -1,5 +1,5 @@
unit module InnerModule;
use v6.c;
unit module InnerModule;

sub foo is export(:DEFAULT) {'Inner::foo'}
sub bar is export {'Inner::bar'}
Expand Down
2 changes: 1 addition & 1 deletion S32-exceptions/misc.t
Expand Up @@ -129,7 +129,7 @@ throws-like 'augment class Any { }', X::Syntax::Augment::WithoutMonkeyTyping;
throws-like '{ use MONKEY-TYPING; }; augment class Any { }', X::Syntax::Augment::WithoutMonkeyTyping,
'MONKEY-TYPING applies lexically';
throws-like 'use MONKEY-TYPING; augment role Positional { }', X::Syntax::Augment::Illegal;
throws-like 'sub postbla:sym<foo>() { }', X::Syntax::Extension::Category, category => 'postbla';
throws-like 'use v6.c; sub postbla:sym<foo>() { }', X::Syntax::Extension::Category, category => 'postbla';
# RT #73938
throws-like 'sub twigil:<@>() { }', X::Syntax::Extension::Category, category => 'twigil';
throws-like 'sub infix:sym< >() { }', X::Syntax::Extension::Null;
Expand Down

0 comments on commit ddaaa58

Please sign in to comment.