Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions tests/neg-macros/i14123a.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
import scala.quoted._

def f(foo: Any => Any)(using Quotes): Expr[Any] =
'{ println(${ foo[Int]('{???}); ??? }) } // error
23 changes: 23 additions & 0 deletions tests/neg-macros/i14123b.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package x

import scala.quoted._

object Impl {

sealed trait UpdateOp[+T]
case class Assignment[T](value:Expr[T]) extends UpdateOp[T]
case class Update(operation:Expr[Unit]) extends UpdateOp[Nothing]

def genRead[B:Type](newBuilder: Expr[B],
readVal: (Expr[B]) => UpdateOp[B]
)(using Quotes): Expr[B] =
'{
var x = $newBuilder
${readVal[B]('x) match { // error: method apply in trait Function1 does not take type parameters
case Assignment(value) => '{ x = $value } // error
case Update(operation) => operation // error
}}
x
}

}