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
2 changes: 1 addition & 1 deletion library/src/scala/quoted/Quotes.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2640,7 +2640,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
// ----- Types ----------------------------------------------------

/** A type, type constructors, type bounds or NoPrefix */
type TypeRepr
type TypeRepr <: Matchable

/** Module object of `type TypeRepr` */
val TypeRepr: TypeReprModule
Expand Down
18 changes: 18 additions & 0 deletions tests/pos/i21282.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
//> using options -Xfatal-warnings -source:future-migration

import scala.quoted.*

private def isUnionCanonicalImpl[U: Type](using Quotes): Expr[Unit] =
import quotes.reflect.*
val u = TypeRepr.of[U].dealiasKeepOpaques

def inner[U: Type](s: Set[TypeRepr], tr: TypeRepr): Set[TypeRepr] =
tr.dealiasKeepOpaques match
case OrType(a, b) =>
val ss = inner[U](s, a)
inner[U](ss, b)
case x if s.contains(x) =>
report.errorAndAbort(s"Type ${x.show} multiple times (CHECK ALIASES) in union ${u.show}")
case x => s + x
inner(Set.empty, u)
'{ () }