Skip to content

hk-type argument in quoted matched expression can't be compiled. #9361

Closed
@rssh

Description

@rssh

Minimized code

package a

import scala.quoted._

trait CPM[F[_]]

object M {

  def matchTerm[T:Type](t:Expr[T])(using qctx:QuoteContext):Unit = {
     import qctx.tasty._
     t match {
       case '{ $a: CPM[$m2] } => ???
     }

  }

}

Output

[info] Compiling 2 Scala sources to /Users/rssh/tests/scala-misc/dotty/match-hk-hk/match-hk-hk/target/scala-0.26/classes ...
[error] -- [E141] Type Error: /Users/rssh/tests/scala-misc/dotty/match-hk-hk/match-hk-hk/src/main/scala/a/M.scala:12:15 
[error] 12 |       case '{ $a: CPM[$m2] } => ???
[error]    |               ^^^^^^^^^^^^
[error]    |               Missing type parameter for $m2
[error] one error found
[error] (Compile / compileIncremental) Compilation failed
[error] Total time: 5 s, completed Jul 14, 2020, 2:37:38 PM

Expectation

should be compiled.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions