Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix RT #125689.
For some reason the lookup with $*W.find_symbol in apply_trait doesn't look for
X::Inheritance::UnknownParent but Inheritance::UnknownParent in 'class X is
nosuchtrait { }', presumably because it happens 'inside' package X. Changing
the lookup to only look inside the setting loops infinitely when compiling the
setting.  The empty (but commented) CATCH prevents this.
  • Loading branch information
peschwa committed Oct 8, 2015
1 parent b9c7b4f commit 08d854c
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/Perl6/World.nqp
Expand Up @@ -2743,13 +2743,21 @@ class Perl6::World is HLL::World {
CATCH {
$ex := $_;
my $payload := nqp::getpayload($_);
if nqp::istype($payload, self.find_symbol(["X", "Inheritance", "UnknownParent"])) {
if nqp::istype($payload, self.find_symbol(["X", "Inheritance", "UnknownParent"], :setting-only)) {
my @suggestions := self.suggest_typename($payload.parent);
for @suggestions {
$payload.suggestions.push($_)
}
}
$nok := 1;
CATCH {
# we only get here if we
# 1) don't have a setting
# 2) look # for X::Inheritance::UnknownParent while sorta-inside X,
# e.g. "class X is nosuchtrait { }"
# building the setting loops infinitely without this CATCH
# block when calling find_symbol with :setting-only
}
}
CONTROL {
if nqp::getextype($_) == nqp::const::CONTROL_WARN {
Expand Down

0 comments on commit 08d854c

Please sign in to comment.