Skip to content

Commit 61414c2

Browse files
committed
retract the option-less commit
1 parent 30787e5 commit 61414c2

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

compiler/src/dotty/tools/dotc/transform/patmat/Space.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
323323
import SpaceEngine._
324324
import tpd._
325325

326-
private val scalaOptionClass = ctx.requiredClassRef("scala.Option".toTypeName).symbol.asClass
326+
private val scalaSomeClass = ctx.requiredClassRef("scala.Some".toTypeName).symbol.asClass
327327
private val scalaSeqFactoryClass = ctx.requiredClass("scala.collection.generic.SeqFactory".toTypeName)
328328
private val scalaListType = ctx.requiredClassRef("scala.collection.immutable.List".toTypeName)
329329
private val scalaNilType = ctx.requiredModuleRef("scala.collection.immutable.Nil".toTermName)
@@ -420,7 +420,7 @@ class SpaceEngine(implicit ctx: Context) extends SpaceLogic {
420420
Kon(pat.tpe.stripAnnots, pats.map(pat => project(pat)))
421421
else if (fun.symbol.owner == scalaSeqFactoryClass && fun.symbol.name == nme.unapplySeq)
422422
projectList(pats)
423-
else if (!fun.symbol.info.finalResultType.isRef(scalaOptionClass))
423+
else if (fun.symbol.info.finalResultType.isRef(scalaSomeClass))
424424
Kon(pat.tpe.stripAnnots, pats.map(pat => project(pat)))
425425
else
426426
Fun(pat.tpe.stripAnnots, fun.tpe, pats.map(pat => project(pat)))

tests/patmat/optionless.check

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
20: Pattern Match Exhaustivity: _: Tree
2+
24: Pattern Match Exhaustivity: _: Tree
13
28: Pattern Match Exhaustivity: _: Tree

0 commit comments

Comments
 (0)