Skip to content

Commit 31f5beb

Browse files
committed
define type declarators
1 parent 0809d2f commit 31f5beb

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

doc/Language/typesystem.pod6

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,21 @@ method C<.defined> can be overloaded and may provide false information.
2727
2828
=head1 Type Declarators
2929
30-
TODO
30+
Type declarators introduce a new type into the given scope. Nested scopes can
31+
be separated by C<::>. New L<packages|/language/packages> are created
32+
automatically if no such scope exists already.
33+
34+
class Foo::Bar::C {};
35+
put Foo::Bar::.keys;
36+
# OUTPUT«C␤»
37+
38+
X«|... (forward declaration)»
39+
X«Forward declarations» can be provided with a block containing only C<...>. The
40+
compiler will check at the end of the current scope if the type is defined.
41+
42+
class C {...}
43+
# many lines later
44+
class C { has $.attr }
3145
3246
=head2 C<class>
3347

0 commit comments

Comments
 (0)