summaryrefslogtreecommitdiff
path: root/test/files/presentation/hyperlinks
diff options
context:
space:
mode:
authorIulian Dragos <jaguarul@gmail.com>2012-05-08 16:07:15 +0200
committerIulian Dragos <jaguarul@gmail.com>2012-05-08 17:06:49 +0200
commit2e8029b127699ecd8ed1f55456faa345bd88c5ee (patch)
tree446e90390c05750e7bb0de4adfa4acafce7292d5 /test/files/presentation/hyperlinks
parentf9410256d97d8b8001e96291016d25f020013784 (diff)
downloadscala-2e8029b127699ecd8ed1f55456faa345bd88c5ee.tar.gz
scala-2e8029b127699ecd8ed1f55456faa345bd88c5ee.tar.bz2
scala-2e8029b127699ecd8ed1f55456faa345bd88c5ee.zip
Fixed positions in named default applications (no hyperlinking in conjunction with implicit arguments).
Removed even more code in the presentation compiler testing infrastructure. One less level of indirection, and a top-level object gone!
Diffstat (limited to 'test/files/presentation/hyperlinks')
-rw-r--r--test/files/presentation/hyperlinks/Runner.scala11
-rw-r--r--test/files/presentation/hyperlinks/src/NameDefaultTests.scala16
-rw-r--r--test/files/presentation/hyperlinks/src/PatMatTests.scala28
3 files changed, 55 insertions, 0 deletions
diff --git a/test/files/presentation/hyperlinks/Runner.scala b/test/files/presentation/hyperlinks/Runner.scala
new file mode 100644
index 0000000000..3d19f2d948
--- /dev/null
+++ b/test/files/presentation/hyperlinks/Runner.scala
@@ -0,0 +1,11 @@
+import scala.tools.nsc.interactive.tests.InteractiveTest
+
+object Test extends InteractiveTest {
+ override def runTests() {
+ // make sure typer is done.. the virtual pattern matcher might translate
+ // some trees and mess up positions. But we'll catch it red handed!
+ sourceFiles foreach (src => askLoadedTyped(src).get)
+ super.runTests()
+ }
+
+} \ No newline at end of file
diff --git a/test/files/presentation/hyperlinks/src/NameDefaultTests.scala b/test/files/presentation/hyperlinks/src/NameDefaultTests.scala
new file mode 100644
index 0000000000..b218040fe3
--- /dev/null
+++ b/test/files/presentation/hyperlinks/src/NameDefaultTests.scala
@@ -0,0 +1,16 @@
+
+class NameDefaults {
+ val someString = "abc"
+ val someInt = 42
+
+ def foo(x: String, y: Int)(implicit logger: Int): Int = y
+
+ implicit val l = 42
+
+ def bar {
+ println()
+ val someOtherInt = 10
+
+ foo(y = someOtherInt/*#*/, x = someString/*#*/)
+ }
+}
diff --git a/test/files/presentation/hyperlinks/src/PatMatTests.scala b/test/files/presentation/hyperlinks/src/PatMatTests.scala
new file mode 100644
index 0000000000..bbd0f2e7ed
--- /dev/null
+++ b/test/files/presentation/hyperlinks/src/PatMatTests.scala
@@ -0,0 +1,28 @@
+package patmat
+
+abstract class BaseType
+
+case class CaseOne(x: Int, y: List[Int]) extends BaseType
+case class CaseTwo(str: String) extends BaseType
+
+class PatMatTests {
+
+ def foo(x: BaseType) {
+ x match {
+ case CaseOne/*#*/(10, first :: second :: Nil) =>
+ val tmp = 23
+ println(first/*#*/)
+ println(tmp/*#*/)
+
+ case CaseTwo/*#*/(mystring) =>
+ println(mystring/*#*/)
+ }
+ }
+
+ def multipleAssign() {
+ val (x, y) = ("abc", "def")
+
+ println(x/*#*/, y/*#*/)
+ }
+
+} \ No newline at end of file