From efd1293df967a10211ca877130f97955be94dc30 Mon Sep 17 00:00:00 2001 From: Adriaan Moors Date: Thu, 26 Apr 2012 15:29:07 +0200 Subject: 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) --- test/files/pos/virtpatmat_partialfun_nsdnho.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 test/files/pos/virtpatmat_partialfun_nsdnho.scala (limited to 'test/files/pos') 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 -- cgit v1.2.3