|
Revision 22001, 0.6 kB
(checked in by moritz, 5 months ago)
|
|
[t/oo] more s/system/run/ and try{...} fixes
|
-
Property svn:mime-type set to
text/plain; charset=UTF-8
-
Property svn:eol-style set to
native
|
| Line | |
|---|
| 1 | use v6; |
|---|
| 2 | |
|---|
| 3 | use Test; |
|---|
| 4 | |
|---|
| 5 | =begin pod |
|---|
| 6 | |
|---|
| 7 | role A { method t ( *@a ) { @a }}; class B does A; class C does A { has B $.b; method BUILD { $.b = B.new; $.b.t( 'haha','hehe','xixi');}} C.new |
|---|
| 8 | *** No such method: "&t" |
|---|
| 9 | at <interactive> line 1, column 108-136 |
|---|
| 10 | <interactive> line 1, column 140-145 |
|---|
| 11 | <interactive> line 1, column 140-145 |
|---|
| 12 | |
|---|
| 13 | =end pod |
|---|
| 14 | |
|---|
| 15 | plan 1; |
|---|
| 16 | |
|---|
| 17 | role A |
|---|
| 18 | { |
|---|
| 19 | method t ( *@a ) { |
|---|
| 20 | @a.sum; |
|---|
| 21 | } |
|---|
| 22 | } |
|---|
| 23 | |
|---|
| 24 | class B does A |
|---|
| 25 | {} |
|---|
| 26 | |
|---|
| 27 | class C does A |
|---|
| 28 | { |
|---|
| 29 | has $.s; |
|---|
| 30 | has B $.b; |
|---|
| 31 | submethod BUILD { |
|---|
| 32 | $.b = B.new; |
|---|
| 33 | $.s = $.b.t(1, 2, 3); |
|---|
| 34 | } |
|---|
| 35 | } |
|---|
| 36 | |
|---|
| 37 | is try { C.new.s }, 6, "Test class include another class which inherited from same role"; |
|---|