Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

X::TypeCheck::MacroUnquote -> X::TypeCheck::Splice

Also added an $.action attribute, because splicing takes place both during
quasi-block incarnation and during macro application.
  • Loading branch information...
commit fc88876a1bc08eb6c5b39be4ae8b9f72d366c604 1 parent d703632
Carl Mäsak authored
10  src/Perl6/Actions.pm
@@ -3419,11 +3419,11 @@ class Perl6::Actions is HLL::Actions {
3419 3419
                 return 1;
3420 3420
             }
3421 3421
             unless istype($quasi_ast, $ast_class) {
3422  
-                # XXX: Need to awesomeize with which type it got
3423  
-                $*W.throw('X::TypeCheck::MacroUnquote',
3424  
-                        got         => $quasi_ast,
3425  
-                        expected    => $ast_class,
3426  
-                        symbol      => ~$<identifier>,
  3422
+                $*W.throw('X::TypeCheck::Splice',
  3423
+                    got         => $quasi_ast,
  3424
+                    expected    => $ast_class,
  3425
+                    symbol      => ~$<identifier>,
  3426
+                    action      => 'macro application',
3427 3427
                 );
3428 3428
             }
3429 3429
             my $past := QAST::Block.new(
5  src/core/AST.pm
@@ -19,9 +19,10 @@ my class AST {
19 19
         my $pasts := nqp::list();
20 20
         for @unquote_asts {
21 21
             # TODO: find and report macro name
22  
-            X::TypeCheck::MacroUnquote.new(
23  
-                got     => $_,
  22
+            X::TypeCheck::Splice.new(
  23
+                got      => $_,
24 24
                 expected => AST,
  25
+                action   => 'unquote evaluation',
25 26
             ).throw unless $_ ~~ AST;
26 27
             nqp::push($pasts, nqp::getattr(nqp::p6decont($_), AST, '$!past'))
27 28
         }
5  src/core/Exception.pm
@@ -819,9 +819,10 @@ my class X::TypeCheck::Assignment is X::TypeCheck {
819 819
     }
820 820
 }
821 821
 
822  
-my class X::TypeCheck::MacroUnquote is X::TypeCheck does X::Comp {
  822
+my class X::TypeCheck::Splice is X::TypeCheck does X::Comp {
  823
+    has $.action;
823 824
     method message {
824  
-        "Type check failed in macro application; expected {$.expected.^name} but got {$.got.^name}";
  825
+        "Type check failed in {$.action}; expected {$.expected.^name} but got {$.got.^name}";
825 826
     }
826 827
 
827 828
 }

0 notes on commit fc88876

Please sign in to comment.
Something went wrong with that request. Please try again.