Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

type narrowing needs a conservative alias/escape analysis for correctness #78

Open
leanderBehr opened this issue Jan 31, 2022 · 0 comments

Comments

@leanderBehr
Copy link
Collaborator

func main() {
  u: Long|Double = 0l

  !ur: Ref[Long|Double] = !u
  ur = 42.0

  print(u) # 4631107791820423168 Integer value of the representation of floating point value 42.0
  print_line()
  print(ur) # 42.000000 the floating point value
}

This example shows that the type narrowing is currently not save. We need some conservative analysis of references to avoid this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant