-
Notifications
You must be signed in to change notification settings - Fork 29
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
Strange compiler errors mentioning opaque Domain
type after Dsl transform
#118
Comments
I minimized it to https://scastie.scala-lang.org/Atry/65lyloFqTQOZnT9MlyHFEQ/1 import com.thoughtworks.dsl.keywords.Monadic, Monadic.implicitMonadic
import com.thoughtworks.dsl.domains.cats._
import cats.implicits._
import shapeless.tag
import shapeless.tag.@@
import org.atnos.eff._
import org.atnos.eff.all._
import org.atnos.eff.syntax.all._
object Example extends App {
trait Module {
abstract class Nextie {
type Foo
def foo[R: _option]: Eff[R, Foo]
}
def foo[R: _option]: Eff[R, Nextie]
def tryResolveNext2[R: _option]: Eff[R, Unit] = {
val outer = !foo
val f = !outer.foo
().pureEff[R]
}
}
} |
The cause is scala/bug#8500, |
I don't know if we can workaround it |
The error message is horrible, indicating the two |
An workaround is avoiding the usage of abstract types: import com.thoughtworks.dsl.keywords.Monadic, Monadic.implicitMonadic
import com.thoughtworks.dsl.domains.cats._
import cats.implicits._
import shapeless.tag
import shapeless.tag.@@
import org.atnos.eff._
import org.atnos.eff.all._
import org.atnos.eff.syntax.all._
object Example extends App {
trait Module {
abstract class Nextie {
type Foo
def foo[R: _option]: Eff[R, Foo]
}
object Nextie {
type Aux[Foo0] = Nextie {
type Foo = Foo0
}
}
def foo[R: _option, Foo]: Eff[R, Nextie.Aux[Foo]]
def tryResolveNext2[R: _option, Foo]: Eff[R, Unit] = {
val outer = !foo[R, Foo]
val f = !outer.foo
().pureEff[R]
}
}
} |
Thanks @Atry
…On Fri, 4 May 2018 at 6:25 pm, 杨博 (Yang Bo) ***@***.***> wrote:
An workaround is avoid the usage of existential types:
import com.thoughtworks.dsl.keywords.Monadic, Monadic.implicitMonadicimport com.thoughtworks.dsl.domains.cats._
import cats.implicits._
import shapeless.tagimport shapeless.tag.@@
import org.atnos.eff._import org.atnos.eff.all._import org.atnos.eff.syntax.all._
object Example extends App {
trait Module {
abstract class Nextie {
type Foo
def foo[R: _option]: Eff[R, Foo
]
}
object Nextie {
type Aux[Foo0] = Nextie {
type Foo = Foo0
}
}
def foo[R: _option, Foo]: Eff[R, Nextie.Aux[Foo]]
def tryResolveNext2[R: _option, Foo]: Eff[R, Unit] = {
val outer = !foo[R, Foo]
val f = !outer.foo
().pureEff[R]
}
}
}
https://scastie.scala-lang.org/Atry/PThXCuU0Qty96YcYL9tVvA
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#118 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAF05OpXpqgLioKpSVE52vlhnXEFEtpaks5tvBB8gaJpZM4TyQIn>
.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Was able to reproduce in a small example, although not very practical:
https://scastie.scala-lang.org/GLQ08KWRSaW2QtlNob8Hxg
The text was updated successfully, but these errors were encountered: