summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-08-18 09:29:44 -0700
committerPaul Phillips <paulp@improving.org>2013-08-18 13:23:21 -0700
commit6d77da374e94ea8b80fc0bf9e544e11f4e9d5cc8 (patch)
tree672e9dfa0343526c77f68d45c7a4698a9dc832dc /src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
parenta905d0e7e49bf92f119b2fdcd2b9d15b71d64ca2 (diff)
downloadscala-6d77da374e94ea8b80fc0bf9e544e11f4e9d5cc8.tar.gz
scala-6d77da374e94ea8b80fc0bf9e544e11f4e9d5cc8.tar.bz2
scala-6d77da374e94ea8b80fc0bf9e544e11f4e9d5cc8.zip
Refined name-based patmat methods.
This fleshes out some of the slightly unfinished corners of the adventure, especially for unapplySeq. There's still an unhealthy amount of duplication and a paucity of specification, but I think it's in eminently good shape for a milestone.
Diffstat (limited to 'src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala')
-rw-r--r--src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala b/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
index 52055dea85..2bd14d923a 100644
--- a/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
+++ b/src/compiler/scala/tools/nsc/transform/patmat/MatchCodeGen.scala
@@ -87,10 +87,8 @@ trait MatchCodeGen extends Interface {
def _match(n: Name): SelectStart = matchStrategy DOT n
// TODO: error message
- private lazy val oneType = typer.typedOperator(_match(vpmName.one)).tpe
- private def oneApplied(tp: Type): Type = appliedType(oneType, tp :: Nil)
- override def pureType(tp: Type): Type = firstParamType(oneApplied(tp))
- override def mapResultType(prev: Type, elem: Type): Type = oneApplied(elem).finalResultType
+ private lazy val oneType = typer.typedOperator(_match(vpmName.one)).tpe
+ override def pureType(tp: Type): Type = firstParamType(appliedType(oneType, tp :: Nil))
}
trait PureCodegen extends CodegenCore with PureMatchMonadInterface {