Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix for incorrect default parent lookup
Where default parent is set in BOOTSTRAP it must not be looked up in immediate client lexical scope but only in its SETTING. p6getlexclient got second optional parameter: $setting-only and was fixed for correct handling of situations where our client is in SETTING or CORE scope.
- Loading branch information
Showing
4 changed files
with
160 additions
and
88 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,17 @@ | ||
role Perl6::Metamodel::DefaultParent { | ||
my @default_parent_type; | ||
my $setting_only := 0; | ||
|
||
method set_default_parent_type($type) { | ||
method set_default_parent_type($type, :$setting-only = 0) { | ||
@default_parent_type[0] := nqp::isconcrete($type) ?? $type !! $type.HOW.name($type); | ||
$setting_only := $setting-only; | ||
} | ||
|
||
method has_default_parent_type() { | ||
+@default_parent_type | ||
} | ||
|
||
method get_default_parent_type() { | ||
nqp::p6getlexclient(@default_parent_type[0]); | ||
nqp::p6getlexclient( @default_parent_type[0], $setting_only ); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters