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 21, 2024
1 parent 935e4a8 commit 20cc1a7
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 20cc1a7

Please sign in to comment.