summaryrefslogtreecommitdiff
path: root/test/files/neg/dotless-targs.scala
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2013-12-17 14:20:49 -0800
committerPaul Phillips <paulp@improving.org>2013-12-17 14:41:42 -0800
commita1c00ae4b2df051c33384269b6b983746e537aee (patch)
tree912f47b790250c6d28e6cc7c9a101328190e1753 /test/files/neg/dotless-targs.scala
parentb5ef79f2f8bc010220d2920a890352d96ad84b45 (diff)
downloadscala-a1c00ae4b2df051c33384269b6b983746e537aee.tar.gz
scala-a1c00ae4b2df051c33384269b6b983746e537aee.tar.bz2
scala-a1c00ae4b2df051c33384269b6b983746e537aee.zip
Dotless type application for infix operators.
When you have an aesthetic expresion like def f(xs: Iterator[Int]) = ( xs takeWhile (_ < 1000) map (_ * -1) filter (_ % 2 == 0) flatMap (x => List(x, x)) reduceOption (_ + _) maxBy (_.toString) ) And then for whatever reason you have to perform explicit type application in the midst of that expression, it's aggravating in the extreme that it has (had) to be rewritten in its entirety to accommodate that change. So now you can perform type application in the middle of it. For reasons not entirely clear to me postfix operators are excluded. The discussion as well as the approval for the infix variation of it can be found at: https://groups.google.com/forum/#!msg/scala-language/eJl1wnkEz9M/hR984-lqC5EJ
Diffstat (limited to 'test/files/neg/dotless-targs.scala')
-rw-r--r--test/files/neg/dotless-targs.scala5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/files/neg/dotless-targs.scala b/test/files/neg/dotless-targs.scala
new file mode 100644
index 0000000000..eff63cbec4
--- /dev/null
+++ b/test/files/neg/dotless-targs.scala
@@ -0,0 +1,5 @@
+class A {
+ def f1 = "f1" isInstanceOf[String] // not ok
+ def f2 = "f2".isInstanceOf[String] // ok
+ def f3 = "f3" toList // ok
+}