Skip to content

Commit

Permalink
Fixed tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Feb 19, 2025
1 parent 0fd6352 commit 457d092
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ fun Pass<*>.tryNamespaceInference(name: Name, source: Node): NamespaceDeclaratio
holder = tryScopeInference(parentName, source)
}

return (holder ?: source.translationUnit)
return (holder ?: source.translationUnit ?: scopeManager.globalScope?.astNode)
?.startInference(ctx)
?.inferNamespaceDeclaration(name, null, source)
}
Expand Down Expand Up @@ -133,7 +133,7 @@ internal fun Pass<*>.tryRecordInference(type: Type, source: Node): RecordDeclara
}

val record =
(holder ?: source.translationUnit)
(holder ?: source.translationUnit ?: scopeManager.globalScope?.astNode)
?.startInference(ctx)
?.inferRecordDeclaration(type, kind, source)

Expand Down

0 comments on commit 457d092

Please sign in to comment.