diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-08-08 00:04:51 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-08-08 00:04:51 -0700 |
commit | ab1058c31d10d3d4d569cb1d1cdd0a35a2c66902 (patch) | |
tree | fa739379b04774c351f9d23bc906569bc738ba4e /test | |
parent | 45d045f8e3d7006890c5a3a187b8b2fc262ad5c7 (diff) | |
parent | 36784d83dec93012e30254ba5207c59d868b613c (diff) | |
download | scala-ab1058c31d10d3d4d569cb1d1cdd0a35a2c66902.tar.gz scala-ab1058c31d10d3d4d569cb1d1cdd0a35a2c66902.tar.bz2 scala-ab1058c31d10d3d4d569cb1d1cdd0a35a2c66902.zip |
Merge pull request #1084 from VladUreche/issue/5933
SI-5933 do the new patmat translation for scaladoc …
Diffstat (limited to 'test')
-rw-r--r-- | test/scaladoc/run/SI-5933.check | 1 | ||||
-rw-r--r-- | test/scaladoc/run/SI-5933.scala | 43 |
2 files changed, 44 insertions, 0 deletions
diff --git a/test/scaladoc/run/SI-5933.check b/test/scaladoc/run/SI-5933.check new file mode 100644 index 0000000000..619c56180b --- /dev/null +++ b/test/scaladoc/run/SI-5933.check @@ -0,0 +1 @@ +Done. diff --git a/test/scaladoc/run/SI-5933.scala b/test/scaladoc/run/SI-5933.scala new file mode 100644 index 0000000000..087116fa71 --- /dev/null +++ b/test/scaladoc/run/SI-5933.scala @@ -0,0 +1,43 @@ +import scala.tools.nsc.doc.model._ +import scala.tools.partest.ScaladocModelTest + +object Test extends ScaladocModelTest { + + // Test code + override def code = """ + // This example should compile without errors, and the pattern match should be correctly displayed + + import language.higherKinds + + abstract class Base[M[_, _]] { + def foo[A, B]: M[(A, B), Any] + } + + class Derived extends Base[PartialFunction] { + def foo[A, B] /*: PartialFunction[(A, B) => Any]*/ = { case (a, b) => (a: A, b: B) } + } + + object Test { + lazy val lx = { println("hello"); 3 } + def test1(x: Int = lx) = ??? + def test2(x: Int = lx match { case 0 => 1; case 3 => 4 }) = ??? + } + """ + + // no need for special settings + def scaladocSettings = "" + + def testModel(rootPackage: Package) = { + // get the quick access implicit defs in scope (_package(s), _class(es), _trait(s), object(s) _method(s), _value(s)) + import access._ + + val Test = rootPackage._object("Test") + val test1 = Test._method("test1") + val test2 = Test._method("test2") + + def assertEqual(s1: String, s2: String) = assert(s1 == s2, s1 + " == " + s2) + + assertEqual(test1.valueParams(0)(0).defaultValue.get.expression, "lx") + assertEqual(test2.valueParams(0)(0).defaultValue.get.expression, "lx match { case 0 => 1; case 3 => 4 }") + } +}
\ No newline at end of file |