summaryrefslogtreecommitdiff
path: root/test/junit
diff options
context:
space:
mode:
authorAntoine Gourlay <antoine@gourlay.fr>2014-10-10 09:02:34 +0200
committerAntoine Gourlay <antoine@gourlay.fr>2014-10-24 15:23:39 +0200
commitf8d1a9ff38cc0c0ce7279ca9169022eab51d6b60 (patch)
treefd073aec07c313f53333bd7baebe619de0f5d5f9 /test/junit
parent2b5df373638d08204b71258928289f6b39e25d5f (diff)
downloadscala-f8d1a9ff38cc0c0ce7279ca9169022eab51d6b60.tar.gz
scala-f8d1a9ff38cc0c0ce7279ca9169022eab51d6b60.tar.bz2
scala-f8d1a9ff38cc0c0ce7279ca9169022eab51d6b60.zip
SI-8875 showCode should print all class constructor modifiers.
showCode used to print nothing when the only modifier was a change in visibility scope (i.e. no flags but privateWithin is set).
Diffstat (limited to 'test/junit')
-rw-r--r--test/junit/scala/reflect/internal/PrintersTest.scala7
1 files changed, 7 insertions, 0 deletions
diff --git a/test/junit/scala/reflect/internal/PrintersTest.scala b/test/junit/scala/reflect/internal/PrintersTest.scala
index ca9b4671b2..7043c26d5e 100644
--- a/test/junit/scala/reflect/internal/PrintersTest.scala
+++ b/test/junit/scala/reflect/internal/PrintersTest.scala
@@ -354,6 +354,13 @@ trait ClassPrintTests {
| def y = "test"
|}""")
+ @Test def testClassConstructorModifiers = assertPrintedCode("class X private (x: scala.Int)")
+
+ @Test def testClassConstructorModifierVisibility = assertPrintedCode(sm"""
+ |object A {
+ | class X protected[A] (x: scala.Int)
+ |}""")
+
@Test def testClassWithPublicParams = assertPrintedCode("class X(val x: scala.Int, val s: scala.Predef.String)")
@Test def testClassWithParams1 = assertPrintedCode("class X(x: scala.Int, s: scala.Predef.String)")