Skip to content

Commit

Permalink
fix: handle missing base class better
Browse files Browse the repository at this point in the history
  • Loading branch information
jac3km4 committed Oct 25, 2022
1 parent f5334c6 commit 5e567a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions compiler/src/unit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -472,10 +472,11 @@ impl<'a> CompilationUnit<'a> {
let base_idx = if is_struct {
PoolIndex::UNDEFINED
} else if let Some(base_name) = source.base {
if let Symbol::Class(base_idx, _) = scope.resolve_symbol(base_name.clone()).with_span(source.span)? {
if let Ok(Symbol::Class(base_idx, _)) = scope.resolve_symbol(base_name.clone()) {
base_idx
} else {
return Err(Cause::ClassNotFound(base_name).with_span(source.span));
self.report(Cause::ClassNotFound(base_name).with_span(source.span))?;
PoolIndex::UNDEFINED
}
} else if let Ok(Symbol::Class(class, _)) = scope
.resolve_symbol(Ident::from_static("IScriptable"))
Expand Down

0 comments on commit 5e567a0

Please sign in to comment.