Skip to content

Commit 63d182a

Browse files
authored
Merge pull request #1035 from perl6/consistent-return-types
Consistent return types
2 parents 54f0c34 + ae816b9 commit 63d182a

File tree

121 files changed

+710
-709
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

121 files changed

+710
-709
lines changed

doc/Type/Any.pod6

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Many built-in types override this for more specific comparisons
3636
3737
Defined as:
3838
39-
method any() returns Junction:D
39+
method any(--> Junction:D)
4040
4141
Interprets the invocant as a list and creates an
4242
C<any>-L<Junction|/type/Junction> from it.
@@ -48,7 +48,7 @@ C<any>-L<Junction|/type/Junction> from it.
4848
4949
Defined as:
5050
51-
method all() returns Junction:D
51+
method all(--> Junction:D)
5252
5353
Interprets the invocant as a list and creates an
5454
C<all>-L<Junction|/type/Junction> from it.
@@ -60,7 +60,7 @@ C<all>-L<Junction|/type/Junction> from it.
6060
6161
Defined as:
6262
63-
method one() returns Junction:D
63+
method one(--> Junction:D)
6464
6565
Interprets the invocant as a list and creates a
6666
C<one>-L<Junction|/type/Junction> from it.
@@ -72,7 +72,7 @@ C<one>-L<Junction|/type/Junction> from it.
7272
7373
Defined as:
7474
75-
method none() returns Junction:D
75+
method none(--> Junction:D)
7676
7777
Interprets the invocant as a list and creates a
7878
C<none>-L<Junction|/type/Junction> from it.
@@ -103,8 +103,8 @@ into the newly created Array.
103103
104104
Defined as:
105105
106-
multi sub reverse(*@list ) returns List:D
107-
multi method reverse(List:D:) returns List:D
106+
multi sub reverse(*@list --> List:D)
107+
multi method reverse(List:D: --> List:D)
108108
109109
Returns a list with the same elements in reverse order.
110110
@@ -223,7 +223,7 @@ Interprets the invocant as a list, and returns the last index of that list.
223223
224224
=head2 method pairup
225225
226-
method pairup() returns List
226+
method pairup(--> List)
227227
228228
Interprets the invocant as a list, and constructs a list of
229229
L<pairs|/type/Pair> from it, in the same way that assignment to a

doc/Type/Array.pod6

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@ Example:
3636
3737
Defined as:
3838
39-
multi sub push(Array:D, **@values) returns Array:D
40-
multi method push(Array:D: **@values) returns Array:D
39+
multi sub push(Array:D, **@values --> Array:D)
40+
multi method push(Array:D: **@values --> Array:D)
4141
4242
Adds the C<@values> to the end of the array, and returns the modified list.
4343
Fails for infinite arrays.
@@ -116,8 +116,8 @@ Example:
116116
117117
Defined as:
118118
119-
multi sub unshift(Array:D, **@values) returns Array:D
120-
multi method unshift(Array:D: **@values) returns Array:D
119+
multi sub unshift(Array:D, **@values --> Array:D)
120+
multi method unshift(Array:D: **@values --> Array:D)
121121
122122
Adds the C<@values> to the start of the array, and returns the modified array.
123123
Fails if C<@values> is infinite.
@@ -157,8 +157,8 @@ Example:
157157
158158
Defined as:
159159
160-
multi sub splice(@list, $start, $elems?, *@replacement) returns Array
161-
multi method splice(Array:D $start, $elems?, *@replacement) returns Array
160+
multi sub splice(@list, $start, $elems?, *@replacement --> Array)
161+
multi method splice(Array:D $start, $elems?, *@replacement --> Array)
162162
163163
Deletes C<$elems> elements starting from index C<$start> from the C<Array>,
164164
returns them and replaces them by C<@replacement>. If C<$elems> is omitted,

doc/Type/Attribute.pod6

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ The usual way to obtain an object of type C<Attribute> is by introspection:
3636
3737
Defined as:
3838
39-
method name(Attribute:D:) returns Str:D
39+
method name(Attribute:D: --> Str:D)
4040
4141
Returns the name of the attribute. Note that this is always the private name,
4242
so if an attribute is declared as C<has $.a>, the name returned is C<$!a>.
@@ -51,7 +51,7 @@ so if an attribute is declared as C<has $.a>, the name returned is C<$!a>.
5151
5252
Defined as:
5353
54-
method package(Attribute:D:) returns Mu:U
54+
method package(Attribute:D: --> Mu:U)
5555
5656
Returns the package (class/grammar/role) to which this attribute belongs.
5757
@@ -65,7 +65,7 @@ Returns the package (class/grammar/role) to which this attribute belongs.
6565
6666
Defined as:
6767
68-
method has_accessor(Attribute:D:) returns Bool:D
68+
method has_accessor(Attribute:D: --> Bool:D)
6969
7070
Returns C<True> if the attribute has a public accessor method.
7171
@@ -82,7 +82,7 @@ Returns C<True> if the attribute has a public accessor method.
8282
8383
Defined as:
8484
85-
method readonly(Attribute:D:) returns Bool:D
85+
method readonly(Attribute:D: --> Bool:D)
8686
8787
Returns C<True> for readonly attributes, which is the default.
8888
Returns C<False> for attributes marked as C<is rw>.
@@ -100,7 +100,7 @@ Returns C<False> for attributes marked as C<is rw>.
100100
101101
Defined as:
102102
103-
method type(Attribute:D:) returns Mu
103+
method type(Attribute:D: --> Mu)
104104
105105
Returns the type constraint of the attribute.
106106

doc/Type/Backtrace/Frame.pod6

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ A single backtrace frame. It identifies a location in the source code.
1414
1515
Defined as:
1616
17-
method file(Backtrace::Frame:D) returns Str
17+
method file(Backtrace::Frame:D --> Str)
1818
1919
Returns the file name.
2020
@@ -26,7 +26,7 @@ Returns the file name.
2626
2727
Defined as:
2828
29-
method line(Backtrace::Frame:D) returns Int
29+
method line(Backtrace::Frame:D --> Int)
3030
3131
Returns the line number (line numbers start to count from 1).
3232
@@ -50,7 +50,7 @@ Returns the code object into which C<.file> and C<.line> point, if available.
5050
5151
Defined as:
5252
53-
method subname(Backtrace::Frame:D) returns Str
53+
method subname(Backtrace::Frame:D --> Str)
5454
5555
Returns the name of the enclosing subroutine.
5656
@@ -62,7 +62,7 @@ Returns the name of the enclosing subroutine.
6262
6363
Defined as:
6464
65-
method is-hidden(Backtrace::Frame:D) returns Bool:D
65+
method is-hidden(Backtrace::Frame:D --> Bool:D)
6666
6767
Returns C<True> if the frame is marked as hidden with the
6868
C<is hidden-from-backtrace> trait.
@@ -75,7 +75,7 @@ C<is hidden-from-backtrace> trait.
7575
7676
Defined as:
7777
78-
method is-routine(Backtrace::Frame:D) returns Bool:D
78+
method is-routine(Backtrace::Frame:D --> Bool:D)
7979
8080
Return C<True> if the frame point into a routine (and not
8181
into a mere L<Block>).
@@ -88,7 +88,7 @@ into a mere L<Block>).
8888
8989
Defined as:
9090
91-
method is-setting(Backtrace::Frame:D) returns Bool:D
91+
method is-setting(Backtrace::Frame:D --> Bool:D)
9292
9393
Returns C<True> if the frame is part of a setting.
9494

0 commit comments

Comments
 (0)