Skip to content

Commit 69aa482

Browse files
committed
Merge branch 'master' into qregex
2 parents 9839f38 + 0e40138 commit 69aa482

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

src/how/NQPClassHOW.pm

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,18 +137,18 @@ knowhow NQPClassHOW {
137137
}
138138

139139
method compose($obj) {
140-
# Incorporate roles. First, instantiate them with the type object
140+
# Incorporate roles. First, specialize them with the type object
141141
# for this type (so their $?CLASS is correct). Then delegate to
142142
# the composer.
143143
if @!roles {
144-
my @instantiated_roles;
144+
my @specialized_roles;
145145
for @!roles {
146-
my $ins := $_.HOW.instantiate($_, $obj);
147-
@instantiated_roles.push($ins);
146+
my $ins := $_.HOW.specialize($_, $obj);
147+
@specialized_roles.push($ins);
148148
@!done[+@!done] := $_;
149149
@!done[+@!done] := $ins;
150150
}
151-
RoleToClassApplier.apply($obj, @instantiated_roles);
151+
RoleToClassApplier.apply($obj, @specialized_roles);
152152
}
153153

154154
# If we have no parents and we're not called NQPMu then add the

src/how/NQPConcreteRoleHOW.pm

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,10 @@ knowhow NQPConcreteRoleHOW {
138138
method roles($obj) {
139139
@!roles
140140
}
141+
142+
method does_list($obj) {
143+
@!done
144+
}
141145

142146
method instance_of($obj) {
143147
$!instance_of

src/how/NQPParametricRoleHOW.pm

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ knowhow NQPParametricRoleHOW {
102102
1
103103
}
104104

105-
# This instantiates the role for the given class and builds a concrete
105+
# This specializes the role for the given class and builds a concrete
106106
# role.
107-
method instantiate($obj, $class_arg) {
107+
method specialize($obj, $class_arg) {
108108
# Run the body block to capture the arguments into the correct
109109
# type argument context.
110110
$!body_block($class_arg);
@@ -128,8 +128,8 @@ knowhow NQPParametricRoleHOW {
128128

129129
# Copy roles, instantiating them as we go.
130130
for @!roles {
131-
my $instantiated := $irole.HOW.instantiate($irole, $class_arg);
132-
$irole.HOW.add_role($irole, $instantiated);
131+
my $specialized := $irole.HOW.specialize($irole, $class_arg);
132+
$irole.HOW.add_role($irole, $specialized);
133133
}
134134

135135
# Compose and return produced role.

0 commit comments

Comments
 (0)