Skip to content

Commit

Permalink
Fixed Go, Java still broken
Browse files Browse the repository at this point in the history
  • Loading branch information
oxisto committed Nov 28, 2024
1 parent e1e7182 commit 9d5f539
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -348,9 +348,12 @@ class GoExtraPass(ctx: TranslationContext) : ComponentPass(ctx) {
// Loop through the target variables (left-hand side)
for ((idx, expr) in assign.lhs.withIndex()) {
if (expr is Reference) {
// And try to resolve it
val ref = scopeManager.resolveReference(expr)
if (ref == null) {
// And try to resolve it as a variable
val ref =
scopeManager.lookupSymbolByName(expr.name, expr.location, expr.scope) {
it is VariableDeclaration
}
if (ref.isEmpty()) {
// We need to implicitly declare it, if it's not declared before.
val decl = newVariableDeclaration(expr.name, expr.autoType())
decl.language = expr.language
Expand Down

0 comments on commit 9d5f539

Please sign in to comment.