File tree Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Expand file tree Collapse file tree 2 files changed +19
-1
lines changed Original file line number Diff line number Diff line change @@ -2640,7 +2640,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching =>
26402640 // ----- Types ----------------------------------------------------
26412641
26422642 /** A type, type constructors, type bounds or NoPrefix */
2643- type TypeRepr
2643+ type TypeRepr <: Matchable
26442644
26452645 /** Module object of `type TypeRepr` */
26462646 val TypeRepr : TypeReprModule
Original file line number Diff line number Diff line change 1+ //> using options -Xfatal-warnings -source:future-migration
2+
3+ import scala .quoted .*
4+
5+ private def isUnionCanonicalImpl [U : Type ](using Quotes ): Expr [Unit ] =
6+ import quotes .reflect .*
7+ val u = TypeRepr .of[U ].dealiasKeepOpaques
8+
9+ def inner [U : Type ](s : Set [TypeRepr ], tr : TypeRepr ): Set [TypeRepr ] =
10+ tr.dealiasKeepOpaques match
11+ case OrType (a, b) =>
12+ val ss = inner[U ](s, a)
13+ inner[U ](ss, b)
14+ case x if s.contains(x) =>
15+ report.errorAndAbort(s " Type ${x.show} multiple times (CHECK ALIASES) in union ${u.show}" )
16+ case x => s + x
17+ inner(Set .empty, u)
18+ ' { () }
You can’t perform that action at this time.
0 commit comments