Closed
Description
Compiler version
3.2.1-RC1-bin-20220721-634c580-NIGHTLY and earlier
Minimized code
//> using scala "3.2.1-RC1-bin-20220721-634c580-NIGHTLY"
import scala.quoted.*
trait Foo:
type Number <: Int
trait Bar[T <: Int]
private def collectImpl[T : Type](using Quotes) =
val expr: Expr[Foo] = ???
expr match
case '{ $enc: Foo { type Number = num } } =>
Type.of[T] match
case '[Bar[`num`]] => '{}
Output
[error] Macro.scala:15:20: Type argument num does not conform to upper bound Int
[error] case '[Bar[`num`]] => '{}
[error] ^
Expectation
The compiler should be aware that num
has to be a subtype of Int
and the compilation should succeed