File tree Expand file tree Collapse file tree 4 files changed +28
-0
lines changed
Expand file tree Collapse file tree 4 files changed +28
-0
lines changed Original file line number Diff line number Diff line change 1+ -- [E007] Type Mismatch Error: tests/neg/i6762.scala:5:72 --------------------------------------------------------------
2+ 5 |def f(word: String)(given QuoteContext): Expr[Foo[G[String]]] = '{Foo(${word.toExpr})} // error
3+ | ^^^^
4+ | Found: quoted.Expr[String]
5+ | Required: quoted.Expr[G[String]]
Original file line number Diff line number Diff line change 1+ import scala .quoted .{_ , given }
2+
3+ type G [X ]
4+ case class Foo [T ](x : T )
5+ def f (word : String )(given QuoteContext ): Expr [Foo [G [String ]]] = ' {Foo ($ {word.toExpr})} // error
Original file line number Diff line number Diff line change 1+ -- [E007] Type Mismatch Error: tests/neg/i6762b.scala:4:39 -------------------------------------------------------------
2+ 4 |def f(word: String): Expr[G[String]] = word.toExpr // error
3+ | ^^^^
4+ | Found: Expr[String]
5+ | Required: Expr[G[String]]
Original file line number Diff line number Diff line change 1+ type Expr [T ]
2+ type G [X ]
3+
4+ def f (word : String ): Expr [G [String ]] = word.toExpr // error
5+
6+ def splice [T ](e : Expr [T ]): T = ???
7+
8+ type Liftable
9+ given Liftable = ???
10+
11+ implicit object ExprOps {
12+ def (x : T ) toExpr[T ](given Liftable ): Expr [T ] = ???
13+ }
You can’t perform that action at this time.
0 commit comments