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

Effect bound for branch is not computed conservatively #318

Open
anlunx opened this issue Apr 23, 2019 · 1 comment
Open

Effect bound for branch is not computed conservatively #318

anlunx opened this issue Apr 23, 2019 · 1 comment

Comments

@anlunx
Copy link
Contributor

anlunx commented Apr 23, 2019

Assume that the function fun : Unit -> Unit has an effect {system.FFI}, the following code compiles

def foo() : {} Unit
  val x : Unit = if (1>0)
      fun()
    else
      unit
  unit

However, the function foo should have the effect annotation {system.FFI}

@JonathanAldrich
Copy link
Member

JonathanAldrich commented Apr 24, 2019

The solution I'd like to see for this is as follows:

  • make the underlying if() function effect-parametric
  • implement inference of effect parameters by using the effect bound of the actual function parameters. Scala does something similar (there's a talk and I think a paper by Odersky and colleagues)

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

2 participants