Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Handle Stash deserialization conflicts.

This fixes RT#112626, and probably a bunch of other disappearing
symbol in pre-compilation issues.
  • Loading branch information...
commit bfa208d4ec8a6e2ba886327b7510754a98f47db7 1 parent 55912f8
@jnthn jnthn authored
Showing with 25 additions and 0 deletions.
  1. +7 −0 src/Perl6/Actions.pm
  2. +18 −0 src/Perl6/ModuleLoader.pm
View
7 src/Perl6/Actions.pm
@@ -294,6 +294,13 @@ class Perl6::Actions is HLL::Actions does STDActions {
:compilation_mode($*W.is_precompilation_mode()),
:pre_deserialize($*W.load_dependency_tasks()),
:post_deserialize($*W.fixup_tasks()),
+ :repo_conflict_resolver(QAST::Op.new(
+ :op('callmethod'), :name('resolve_repossession_conflicts'),
+ QAST::VM.new(
+ pirop => 'get_hll_global Ps',
+ QAST::SVal.new( :value('ModuleLoader') )
+ )
+ )),
# If this unit is loaded as a module, we want it to automatically
# execute the mainline code above after all other initializations
View
18 src/Perl6/ModuleLoader.pm
@@ -286,6 +286,24 @@ class Perl6::ModuleLoader {
return $setting;
}
+
+ # Handles any object repossession conflicts that occurred during module load,
+ # or complains about any that cannot be resolved.
+ method resolve_repossession_conflicts(@conflicts) {
+ for @conflicts -> $orig, $current {
+ # If it's a Stash in conflict, we make sure any original entries get
+ # appropriately copied.
+ if $orig.HOW.name($orig) eq 'Stash' {
+ for $orig {
+ unless nqp::existskey($current, $_.key) {
+ $current{$_.key} := $_.value;
+ }
+ }
+ }
+ # We could complain about anything else, and may in the future; for
+ # now, we let it pass by with "latest wins" semantics.
+ }
+ }
}
# We stash this in the perl6 HLL namespace, just so it's easy to
Please sign in to comment.
Something went wrong with that request. Please try again.