We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
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
File A:
package cps import scala.quoted._ trait CpsMonad[F[_]] trait ComputationBound[T] implicit object ComputationBoundMonad extends CpsMonad[ComputationBound] inline def async[F[_]](using am:CpsMonad[F]): Async.InferAsyncArg[F] = new Async.InferAsyncArg[F] object Async { class InferAsyncArg[F[_]](using am:CpsMonad[F]) { inline def apply[T](inline expr: T):Unit = ${ Async.checkPrintTypeImpl[F,T]('expr) } } def checkPrintTypeImpl[F[_]:Type,T:Type](f: Expr[T])(using qctx: QuoteContext): Expr[Unit] = import qctx.tasty._ def uninline(t:Term):Term = t match case Inlined(_,_,x) => uninline(x) case _ => t val fu = uninline(f.unseal) fu match case Block(_,Apply(TypeApply(Select(q,n),tparams),List(param))) => param.tpe match case AppliedType(tp,tparams1) => val fType = summon[quoted.Type[F]] val ptp = tparams1.tail.head val ptpTree = Inferred(AppliedType(fType.unseal.tpe,List(ptp))) println("res:"+ptpTree.show) case None => println(s"tpe=${param.tpe} is not AppliedType") '{ () } case _ => ??? }
in file B
package cps val c = async[ComputationBound] { List(1,2,3,4).collectFirst { case x if x > 0 => x > 3 } }
[error] -- Error: /Users/rssh/work/oss/dotty-cps/dotty-cps/src/test/scala/cps/TestCBS1ShiftIterableOps.scala:3:36 [error] 3 | val c = async[ComputationBound]{ [error] | ^ [error] | Exception occurred while executing macro expansion. [error] | java.lang.StackOverflowError [error] | [error] |
Something will be printed during macro evaluation
The text was updated successfully, but these errors were encountered:
dotty-cps-minimized-stackowerflow-in-type-show.tar.gz [project with this two files and sbt build]
Sorry, something went wrong.
Fix scala#9251: Print applied lambda types directly
af344aa
Merge pull request #9265 from dotty-staging/fix-#9251
baba3f0
Fix #9251: Print applied lambda types directly
nicolasstucki
Successfully merging a pull request may close this issue.
Uh oh!
There was an error while loading. Please reload this page.
Minimized code
File A:
in file B
Output
Expectation
Something will be printed during macro evaluation
The text was updated successfully, but these errors were encountered: