Skip to content

Commit

Permalink
added forgotten test file
Browse files Browse the repository at this point in the history
  • Loading branch information
rssh committed May 11, 2024
1 parent 6dd255c commit 8777963
Showing 1 changed file with 55 additions and 0 deletions.
55 changes: 55 additions & 0 deletions compiler-plugin/testdata/set13TestCases/m11_m1/TestFM2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package cps.gopherlike

import org.junit.{Test,Ignore}
import org.junit.Assert._

import scala.quoted._
import scala.concurrent.Future
import scala.util.Success

import cps.*
import cps.plugin.annotation.*

import cps.macros.flags.UseCompilerPlugin
given UseCompilerPlugin.type = UseCompilerPlugin


//@CpsDebugLevel(20)
class TestFM2:

trait IFReader1[F[_]:CpsSchedulingMonad,A]{

def aOptRead() : F[Option[A]] = ???

transparent inline def optRead()(using monadContext: CpsMonadContext[F]): Option[A] =
await(aOptRead())

}


class FlatMapped[F[_]:CpsSchedulingMonad,A,B](f: A=>IFReader1[F,B]) {


def prevOptRead()(using monadContext: CpsMonadContext[F]): Option[A] =
???

def run(): F[Unit] =
//implicit val printCode = cps.macroFlags.PrintCode
//implicit val printTree = cps.macroFlags.PrintTree
//implicit val debugLevel = cps.macroFlags.DebugLevel(20)
async[F]{
prevOptRead() match
case Some(a) =>
val internal = f(a)
internal.optRead().isDefined
case None =>
false
}

}






0 comments on commit 8777963

Please sign in to comment.