Skip to content

Fix regression around type skolems and if exprs #77

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

Closed
wants to merge 1 commit into from

Conversation

gnovark
Copy link
Contributor

@gnovark gnovark commented Jul 1, 2014

Not sure what the actual cause is, but it seems to be triggered by containsForeignJumps spuriously returning true due to not checking to see if the symbol is actually a label.

…but caused by 4fc5463 having overeager containsForeignJump.  Fix is to only identify RefTrees corresponding to LabelDefs.
@retronym
Copy link
Member

This fix looks to be correct, as it we are currently creating needless intermediate states for if/else without an await.

But it just masks the an underlying problem. The type error with skolems resurfaces with:

  def run(k: K) = async {
    val res = await(result(k.f))
    if(true) {
      println(res)
      await(result(k.f))
    }
    res
  }

@retronym
Copy link
Member

I'm looking into the underlying problem.

@retronym
Copy link
Member

A smaller test case:

import scala.async.internal.AsyncId._
class F[A]
class S[A]
def result[A](f: F[A]): S[A with String] = ???
val f: F[_] = ???
val s /* F[$1 with String] */ = result(f)
async {
  val res = await(s)
  if(true) {
    await(0)
  }
  res
}
 found   : S#10272[_$1#10308 with String#137] where type _$1#10308
 required: S#10272[_$1#10311 with String#137] forSome { type _$1#10311 }

I can probably brute force this by generating casts if the types of a synthetic Assign doesn't line up.

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

Successfully merging this pull request may close these issues.

2 participants