summaryrefslogtreecommitdiff
path: root/scalalib/test/resources/hello-dotty/boo/src/Main.scala
blob: 6b19f294a904a25948d293fc06d42fc8eb203f5c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import cats._, cats.data._, cats.implicits._

trait Context

object Main {
  def foo(f: given Int => Int): Int = {
    given x as Int = 1
    f
  }

  def main(args: Array[String]): Unit = {
    val x = Applicative[List].pure(1)
    assert(x == List(1))
    val value = foo(given x => x + 1)
    assert(value == 2)
  }
}