Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Implement basic augment syntax
- Loading branch information
Showing
6 changed files
with
107 additions
and
9 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,21 @@ | ||
| # vim: ft=perl6 | ||
| use Test; | ||
|
|
||
| { | ||
| use MONKEY_TYPING; | ||
| my class Foo { | ||
| method foo { 1 } | ||
| } | ||
| is Foo.foo, 2, "augments run early"; | ||
| is Any.g4077, 4077, "can augment core classes"; | ||
| is Cool.g4077, 4077, "augments visible in subclasses"; | ||
|
|
||
| augment class Foo { | ||
| method foo { 2 } | ||
| } | ||
| augment class Any { | ||
| method g4077 { 4077 } | ||
| } | ||
| } | ||
|
|
||
| done-testing; |