-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
55 additions
and
0 deletions.
There are no files selected for viewing
55 changes: 55 additions & 0 deletions
55
compiler-plugin/testdata/set13TestCases/m11_m1/TestFM2.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
|
||
} | ||
|
||
|
||
|
||
|
||
|
||
|