-
Notifications
You must be signed in to change notification settings - Fork 1.1k
summonInline can't deduce summon, passed via type parameter [Regression] #11479
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
Comments
@rssh You can try to add I'm wondering the code should compile even without /cc: @nicolasstucki |
To have better code, should use I will check why it does not find the implicit. |
Maybe we can improve the documentation of |
Note, that if we will change X to be:
Then the output of loopImpl (with the same 'Main.scala') is "not found". |
Side note class SLLoop[F[_]:CpsMonad]: // We already have an implicit instance of CpsMonad[F] before inlining here
inline def apply(inline pf: PartialFunction[Any,Boolean]): Unit =
${
SLLoop.loopImpl[F]('pf, '{summon[CpsMonad[F]]}) // we can just summon it here
} |
Minimized trait Foo
given Foo: Foo with {}
inline def summonFoo(): Foo = scala.compiletime.summonInline[Foo] def test: Unit = summonFoo() It looks like we during the |
Also, see https://scastie.scala-lang.org/KfWryGwAT3SW7xwpv6k6OA from #11538 |
Compiler version
3.0.0-RC1
Latest Dotty nightly build version: 3.0.0-RC2-bin-20210219-aa7c21e-NIGHTLY
Minimized code
fixe X.scala:
file Main.scala
Output
Expectation
Should compile.
(it works in 3.0.0-M3)
The text was updated successfully, but these errors were encountered: