Skip to content
This repository
Browse code

Compute role_typecheck_list a bit earlier; add S14-roles/composition.t

  • Loading branch information...
commit 4446002c853a40342a44176633cbccecf5c8d9d7 1 parent 918bb3d
Stefan O'Rear authored

Showing 3 changed files with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +3 2 lib/Kernel.cs
  2. +3 0  lib/ObjModel.cs
  3. +1 0  t/spectest.data
5 lib/Kernel.cs
@@ -5463,8 +5463,9 @@ internal class MMDCandidate : MultiCandidate {
5463 5463 into.mo.local_attr.Add(ai);
5464 5464 foreach (STable su in role.mo.superclasses)
5465 5465 into.mo.superclasses.Add(su);
5466   - foreach (STable su in role.mo.role_typecheck_list)
5467   - into.mo.role_typecheck_list.Add(su);
  5466 + // This is handled earlier, at parametric role compose time
  5467 + //foreach (STable su in role.mo.role_typecheck_list)
  5468 + // into.mo.role_typecheck_list.Add(su);
5468 5469 }
5469 5470
5470 5471 static string MethodSlot(Prod<int,string> arg) {
3  lib/ObjModel.cs
@@ -611,6 +611,9 @@ public class DispatchSet {
611 611
612 612 if (type == ROLE || type == PARAMETRIZED_ROLE || type == CURRIED_ROLE) {
613 613 role_typecheck_list.Add(stable);
  614 + foreach (STable s2 in local_roles)
  615 + foreach (STable s3 in s2.mo.role_typecheck_list)
  616 + role_typecheck_list.Add(s3);
614 617 SetMRO(Kernel.AnyMO.mo.mro);
615 618 Revalidate();
616 619 stable.SetupVTables();
1  t/spectest.data
@@ -344,6 +344,7 @@ S12-methods/what.t
344 344 S13-overloading/metaoperators.t
345 345 S13-type-casting/methods.t
346 346 S14-roles/attributes.t
  347 +S14-roles/composition.t
347 348 S14-roles/lexical.t
348 349 S16-filehandles/filetest.t
349 350 S16-filehandles/io.t

0 comments on commit 4446002

Please sign in to comment.
Something went wrong with that request. Please try again.