Skip to content

Commit

Permalink
Defensive programming
Browse files Browse the repository at this point in the history
  • Loading branch information
Victorious3 committed Dec 6, 2023
1 parent f6deccc commit e2ed9d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/typechecking.pr
Original file line number Diff line number Diff line change
Expand Up @@ -5654,9 +5654,9 @@ def lookup_stub_types(state: &State) {
let scpe = state.scope
for var key in @state.scope.fields.keys() {
let value = state.scope.fields[key]
if value.tpe.kind == TypeKind::TYPE {
if value.tpe and value.tpe.kind == TypeKind::TYPE {
let tpe = value.value.value_tpe
if tpe.kind == TypeKind::STUB and util::find_substr(tpe.type_name, "::", 0) == -1 {
if tpe and tpe.kind == TypeKind::STUB and util::find_substr(tpe.type_name, "::", 0) == -1 {
state.scope.fields.remove(key)
var new_value = scope::get(scpe, parser::make_identifier(key), dry_run = true)
if new_value and new_value.tpe.kind == TypeKind::TYPE {
Expand Down

0 comments on commit e2ed9d7

Please sign in to comment.