You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code below compiles and runs under 2.11.8 and 2.12.1, but fails under dotty with:
[info] Compiling 1 Scala source to /home/nmrp3/devel/turingatemyhamster/commandeer/target/scala-2.11/classes...
/home/nmrp3/devel/turingatemyhamster/commandeer/src/main/scala/commandeer/RunMe.scala:32: error: no implicit argument of type DSL found for parameter dsl of method apply in object CommandeerDSL
val kevin = CommandeerDSL(null.asInstanceOf[Foo])
^
/home/nmrp3/devel/turingatemyhamster/commandeer/src/main/scala/commandeer/RunMe.scala:34: error: value Bar is not a member of Nothing(kevin)
val bar = kevin.Bar("bob", 3)
^
two errors found
[error] (compile:compileIncremental) Compilation failed
I'm attempting to summon an implicit instance of a trait, but getting back type information specific to the instance that I've summoned, beyond that in the trait that I summoned it through. There may be a better way to do this with dotty, but I don't know it.
Interpolating type variables before resolving implicit parameters means that
more companion objects can become eligible for the implicit scope. An example
demonstrating this is i1857.scala. The spec mandates this behavior because it
says that type arguments are inferred before implicit parameter resolution takes place.
Given:
val f: Foo = new Foo
def wrap2a[A, W <: Wrapper[A]](host: A)(implicit w: W): W = ???
wrap2a(f)
We need to instantiate `A` before doing the implicit search for `w`
because it was constrained by the first parameter list. This was not
done before because we did not traverse the constraint bounds of an
uninstantiated type variable.
The code below compiles and runs under 2.11.8 and 2.12.1, but fails under dotty with:
I'm attempting to summon an implicit instance of a trait, but getting back type information specific to the instance that I've summoned, beyond that in the trait that I summoned it through. There may be a better way to do this with dotty, but I don't know it.
The text was updated successfully, but these errors were encountered: