root/t/oo/super.t

Revision 20490, 381 bytes (checked in by Auzon, 8 months ago)

s/use v6-alpha;$/use v6;/;
Also catching a few other mentions of v6-alpha.

  • Property svn:mime-type set to text/plain; charset=UTF-8
  • Property svn:eol-style set to native
Line 
1use v6;
2
3use Test;
4
5plan 2;
6
7class Parent {}
8
9my $new_count = 0;
10
11class Child is Parent
12{
13    method new ( $Class: )
14    {
15        return if $new_count++ > 1;
16        return $Class.SUPER::new();
17    }
18}
19
20my $child = Child.new;
21
22is( $child.WHAT, 'Child', 'new() should be SUPER-callable' );
23is( $new_count, 1,
24    'SUPER should not call itself in the absence of a parent method' );
Note: See TracBrowser for help on using the browser.