-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancementstat:fixed in nextThe issue was fixed in Next and only still applies to LTS.The issue was fixed in Next and only still applies to LTS.
Description
Compiler version
3.4.3 + -source:future
Minimized example
main.scala
Example.matchableExampleexample.scala
import scala.quoted.*
object Example:
inline def matchableExample: Unit = ${ matchableExampleMacro }
def matchableExampleMacro(using quotes: Quotes): Expr[Unit] = {
import quotes.reflect.*
val tpe = TypeRepr.of[Int]
tpe match
case OrType(left, right) =>
println(s"OrType: $left, $right")
case other =>
println(s"other: $other")
'{}
}Output Error/Warning message
[warn] 10 | case OrType(left, right) =>
[warn] | ^^^^^^^^^^^^^^^^^^^
[warn] | pattern selector should be an instance of Matchable,,
[warn] | but it has unmatchable type quotes.reflect.TypeRepr insteadWhy this Error/Warning was not helpful
As I understood there should be no warning at all.
Suggested improvement
Make Quotes API subtype of Matchable
Metadata
Metadata
Assignees
Labels
area:metaprogramming:quotesIssues related to quotes and splicesIssues related to quotes and splicesarea:reportingError reporting including formatting, implicit suggestions, etcError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancementstat:fixed in nextThe issue was fixed in Next and only still applies to LTS.The issue was fixed in Next and only still applies to LTS.