Skip to content

Commit

Permalink
Fix type inference in local variable assignments
Browse files Browse the repository at this point in the history
  • Loading branch information
peachpit-site committed Nov 18, 2024
1 parent 2f23fe6 commit e4e3680
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion source/service/compiler.go
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ NodeTypeSwitch:
typesAtIndex := typesAtIndex(types, i)
cp.cm("Adding variable in ASSIGN, 2", node.GetToken())
cp.AddVariable(env, pair.VarName, LOCAL_VARIABLE, typesAtIndex, node.GetToken())
if sig[i].VarName == "*inferred*" {
if sig[i].VarType == "*inferred*" {
newSig = append(newSig, NameAlternateTypePair{pair.VarName, typesAtIndex})
} else {
newSig = append(newSig, ast.NameTypenamePair{pair.VarName, sig[i].VarType})
Expand Down

0 comments on commit e4e3680

Please sign in to comment.