Ticket #1296: vtableanon.patch

File vtableanon.patch, 1.4 KB (added by coke, 5 years ago)

vtableanon.patch

  • src/global.c

    diff --git a/src/global.c b/src/global.c
    index 29b9b30..fe4bf75 100644
    a b  
    609609    /* store a :multi sub */ 
    610610    if (!PMC_IS_NULL(PMC_sub(sub)->multi_signature)) 
    611611        store_sub_in_multi(interp, sub, ns); 
    612     /* store other subs (as long as they're not :anon) */ 
    613     else if (!(PObj_get_FLAGS(sub) & SUB_FLAG_PF_ANON)) { 
     612    /* store other subs (as long as they're not :anon, but the namespace will 
     613     * detect that) */ 
     614    else { 
    614615        STRING * const name   = PMC_sub(sub)->name; 
    615616        PMC    * const nsname = PMC_sub(sub)->namespace_name; 
    616617 
  • (a) /dev/null vs. (b) b/t/compilers/imcc/syn/sub.t

    diff --git a/t/compilers/imcc/syn/sub.t b/t/compilers/imcc/syn/sub.t
    new file mode 100644
    index 0000000..91bc06e
    a b  
     1#!perl 
     2# Copyright (C) 2005, The Perl Foundation. 
     3# $Id$ 
     4 
     5use strict; 
     6use warnings; 
     7use lib qw( . lib ../lib ../../lib ); 
     8use Parrot::Test tests => 1; 
     9 
     10############################## 
     11 
     12pir_output_is( <<'CODE', <<'OUTPUT', ":anon :vtable should work" ); 
     13.sub main :main 
     14    $P0 = newclass "Foo" 
     15    $P0 = new "Foo" 
     16    $I0 = $P0 
     17    $S0 = $I0 
     18    say $S0 
     19.end 
     20 
     21.namespace ["Foo"] 
     22 
     23.sub get_integer :vtable :anon 
     24    .return (42) 
     25.end 
     26CODE 
     2742 
     28OUTPUT 
     29 
     30 
     31# Local Variables: 
     32#   mode: cperl 
     33#   cperl-indent-level: 4 
     34#   fill-column: 100 
     35# End: 
     36# vim: expandtab shiftwidth=4: