Skip to content

interaction with dependent / singleton types #17

Closed
@lrytz

Description

@lrytz
import scala.async.AsyncId.{async, await}
class A { class B }
async {
  val a = new A
  def foo(b: a.B) = 0
  await(foo(new a.B))
}

➡️

 found   : a.B
 required: a.B
                await(foo(new a.B))
                          ^

similar:

async {
  val x = ""
  def foo(a: x.type) = 0
  await(foo(x))
}

➡️

 found   : x.type (with underlying type String)
 required: x.type
                await(foo(x))
                          ^

and also (foo and await exchanged):

async {
  val x = ""
  def foo(a: x.type) = 0
  foo(await(x))
}

➡️

 found   : String
 required: x.type
                foo(await(x))
                         ^

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions