We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f5020e2 commit cfb08c8Copy full SHA for cfb08c8
doc/Language/typesystem.pod6
@@ -166,6 +166,23 @@ such they can not be altered from outside the class they are defined in.
166
X«|method (declarator)»
167
=head3 Methods
168
169
+=head4 Inheritance and Multies
170
+
171
+A normal method in a subclass does not compete with multies of a parent class.
172
173
+ class A {
174
+ multi method m(Int $i){ say 'Int' }
175
+ multi method m(int $i){ say 'int' }
176
+ }
177
178
+ class B is A {
179
+ method m(Int $i){ say 'B::Int' }
180
181
182
+ my int $i;
183
+ B.new.m($i);
184
+ # OUTPUT«B::Int»
185
186
X«|only method»
187
=head4 Only Method
188
0 commit comments