summaryrefslogtreecommitdiff
path: root/test/files/pos/virtpatmat_partialfun_nsdnho.scala
diff options
context:
space:
mode:
authorAdriaan Moors <adriaan.moors@epfl.ch>2012-04-26 15:29:07 +0200
committerAdriaan Moors <adriaan.moors@epfl.ch>2012-04-26 15:29:07 +0200
commitefd1293df967a10211ca877130f97955be94dc30 (patch)
tree057938c424517a86a1d06cf65fbc9c0b8bc118d3 /test/files/pos/virtpatmat_partialfun_nsdnho.scala
parent8fc543b5dd7e6a8fa1827cc9e9d65e721cae140e (diff)
downloadscala-efd1293df967a10211ca877130f97955be94dc30.tar.gz
scala-efd1293df967a10211ca877130f97955be94dc30.tar.bz2
scala-efd1293df967a10211ca877130f97955be94dc30.zip
SI-5690: no-selector match in function yields function
the implicit beta-reduction performed by typedFunction on a Function(.., Match(EmptyTree, ...)) must of course only be done when the selector actually is empty... (yes, typedMatchAnonFun needs to be cleaned up, I know)
Diffstat (limited to 'test/files/pos/virtpatmat_partialfun_nsdnho.scala')
-rw-r--r--test/files/pos/virtpatmat_partialfun_nsdnho.scala18
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/pos/virtpatmat_partialfun_nsdnho.scala b/test/files/pos/virtpatmat_partialfun_nsdnho.scala
new file mode 100644
index 0000000000..f79e82813c
--- /dev/null
+++ b/test/files/pos/virtpatmat_partialfun_nsdnho.scala
@@ -0,0 +1,18 @@
+class Test {
+ // m.$minus(1)
+ // at scala.Predef$.assert(Predef.scala:185)
+ // at scala.tools.nsc.Global.assert(Global.scala:187)
+ // at scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.transform(SuperAccessors.scala:291)
+ val a: (Map[Int, Int] => (Any => Any)) = { m => { case _ => m - 1} }
+
+ // patmat-crash.scala:9: error: erroneous or inaccessible type
+ val b: (Int => (Any => Any)) = { m => { case _ => m } }
+
+ // no-symbol does not have an owner (this is a bug: scala version 2.10.0-20120420-170445-56c1f29250)
+ // at scala.reflect.internal.SymbolTable.abort(SymbolTable.scala:45)
+ // at scala.tools.nsc.Global.abort(Global.scala:202)
+ // at scala.reflect.internal.Symbols$NoSymbol.owner(Symbols.scala:3031)
+ // at scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.hostForAccessorOf(SuperAccessors.scala:474)
+ // at scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.needsProtectedAccessor(SuperAccessors.scala:457)
+ val c: (Int => (Any => Any)) = { m => { case _ => m.toInt } }
+} \ No newline at end of file