Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions compiler/src/scala/quoted/runtime/impl/QuoteMatcher.scala
Original file line number Diff line number Diff line change
Expand Up @@ -460,10 +460,10 @@ class QuoteMatcher(debug: Boolean) {
*/
def matchTypeDef(sctypedef: TypeDef, pttypedef: TypeDef): MatchingExprs = sctypedef match
case TypeDef(_, TypeBoundsTree(sclo, schi, EmptyTree))
if sclo.tpe == defn.NothingType && schi.tpe == defn.AnyType =>
if sclo.tpe.isNothingType && schi.tpe.isAny =>
pttypedef match
case TypeDef(_, TypeBoundsTree(ptlo, pthi, EmptyTree))
if sclo.tpe == defn.NothingType && schi.tpe == defn.AnyType =>
if sclo.tpe.isNothingType && schi.tpe.isAny =>
matched
case _ => notMatched
case _ => notMatched
Expand Down
11 changes: 11 additions & 0 deletions tests/pos-macros/i23589/Macro_1.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import scala.quoted.*
import scala.language.experimental.quotedPatternsWithPolymorphicFunctions

inline def testMacro(inline body: Any) = ${test('body)}
def test(outsideBody: Expr[Any])(using Quotes): Expr[Unit] =
val insideBody = '{[B] => (a : B, b : B) => (a, b)}
outsideBody match
case '{ [A] => (x : A, y : A) => $b[A](x, y): (A, A) } => ()
insideBody match
case '{ [A] => (x : A, y : A) => $b[A](x, y): (A, A) } => ()
'{()}
3 changes: 3 additions & 0 deletions tests/pos-macros/i23589/Main_2.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
//> using options -experimental
@main def main() =
testMacro([B] => (a : B, b : B) => (a, b))
Loading