Skip to content

Variable scoping changes on import #733

@kentslaney

Description

@kentslaney

Reproducing the behavior

with the following 2 files...

imported.bend

def test(key):
  return key + 1

def key(seed):
  return seed + 2

def main:
  return test(5)

 

importer.bend

from imported import test

def main:
  return test(5)

running the two files gives different results, when the expected result is the same since they're making the same call (using bend run)

System Settings

  • HVM: 2.0.22
  • Bend: 0.2.37
  • OS: archlinux:latest docker image
  • CPU: AMD Ryzen 9

Additional context

I think this might be related to #729 but I opened a new issue since it doesn't fail at compile time

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingcompilationCompilation of terms and functions to HVM

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions