-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:implicits:implicitConversionIssues tied with scala.language.implicitConversionsIssues tied with scala.language.implicitConversionsbacklogNo work planned on this by the core team for the time being.No work planned on this by the core team for the time being.itype:bug
Description
minimized code
- Position.scala
import scala.quoted.{Expr, QuoteContext}
case class Position()
object Position {
implicit inline def here: Position = ${ genPosition }
private def genPosition(given Quotes): Expr[Position] = {
import quotes.reflect._
// interesting that if we remove the following line => compile successfully
val lineNo: Int = Position.ofMacroExpansion.startLine
'{ Position() }
}
}- Test.scala
import scala.concurrent.duration.FiniteDuration
import scala.language.implicitConversions
import scala.reflect.ClassTag
class AnyShouldWrapper[T]
class Test {
implicit def convertToAnyShouldWrapper[T](o: T)(implicit pos: Position): AnyShouldWrapper[T] = ???
def expectMsgType[T](implicit t: ClassTag[T]): T = ???
def expectMsgType[T](max: FiniteDuration)(implicit t: ClassTag[T]): T = ???
def test(): Unit = {
expectMsgType[Int]: AnyShouldWrapper[Int]
}
}Compilation output for dotty 0.23.0-RC1
[error] -- [E134] Type Mismatch Error: /Users/thanhbv/ohze/dotty-example/src/main/scala/Test.scala:14:4
[error] 14 | expectMsgType[Int]: AnyShouldWrapper[Int]
[error] | ^^^^^^^^^^^^^
[error] |None of the overloaded alternatives of method expectMsgType in class Test with types
[error] | [T](max: concurrent.duration.FiniteDuration)(implicit t: reflect.ClassTag[T]): T
[error] | [T](implicit t: reflect.ClassTag[T]): T
[error] |match type arguments [Int] and expected type AnyShouldWrapper[Int]expectation
compile successfully as with dotty 0.22.0-RC1
Metadata
Metadata
Assignees
Labels
area:implicits:implicitConversionIssues tied with scala.language.implicitConversionsIssues tied with scala.language.implicitConversionsbacklogNo work planned on this by the core team for the time being.No work planned on this by the core team for the time being.itype:bug