Skip to content

Commit 83c3f7a

Browse files
committed
Merge pull request #307 from smarter/simplify/TypeAlias-unapply
Simplify TypeAlias#unapply
2 parents e0bf175 + 341f337 commit 83c3f7a

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/dotty/tools/dotc/core/Types.scala

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2515,10 +2515,7 @@ object Types {
25152515
object TypeAlias {
25162516
def apply(alias: Type, variance: Int = 0)(implicit ctx: Context) =
25172517
ctx.uniqueTypeAliases.enterIfNew(alias, variance)
2518-
def unapply(tp: TypeAlias): Option[Type] = tp match {
2519-
case tp: TypeAlias => Some(tp.alias)
2520-
case _ => None
2521-
}
2518+
def unapply(tp: TypeAlias): Option[Type] = Some(tp.alias)
25222519
}
25232520

25242521
// ----- Annotated and Import types -----------------------------------------------

0 commit comments

Comments
 (0)