Skip to content

Commit 76a68cb

Browse files
committed
Add regression test for issue 18726, release flag is ignored in
completions
1 parent 8825b07 commit 76a68cb

File tree

2 files changed

+51
-0
lines changed

2 files changed

+51
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package dotty.tools.pc.tests.completion
2+
3+
import dotty.tools.pc.base.BaseCompletionSuite
4+
5+
import org.junit.Test
6+
import java.nio.file.Path
7+
8+
class CompletionRelease11Suite extends BaseCompletionSuite:
9+
10+
override protected def scalacOptions(classpath: Seq[Path]): Seq[String] =
11+
"-release:11" +: super.scalacOptions(classpath)
12+
13+
@Test def java11Symbols =
14+
check(
15+
"""
16+
|object A {
17+
| "".repea@@
18+
|}""".stripMargin,
19+
"""repeat(x$0: Int): String
20+
|replaceAll(x$0: String, x$1: String): String
21+
|prependedAll[B >: A](prefix: IterableOnce[B]): IndexedSeq[B]
22+
|prependedAll(prefix: String): String
23+
|prependedAll[B >: Char](prefix: IterableOnce[B]): IndexedSeq[B]
24+
|replaceAllLiterally(literal: String, replacement: String): String
25+
|""".stripMargin
26+
)
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package dotty.tools.pc.tests.completion
2+
3+
import dotty.tools.pc.base.BaseCompletionSuite
4+
5+
import org.junit.Test
6+
import java.nio.file.Path
7+
8+
class CompletionRelease8Suite extends BaseCompletionSuite:
9+
10+
override protected def scalacOptions(classpath: Seq[Path]): Seq[String] =
11+
"-release:8" +: super.scalacOptions(classpath)
12+
13+
@Test def noJvm11Symbols =
14+
check(
15+
"""
16+
|object A {
17+
| "".repea@@
18+
|}""".stripMargin,
19+
"""replaceAll(x$0: String, x$1: String): String
20+
|prependedAll[B >: A](prefix: IterableOnce[B]): IndexedSeq[B]
21+
|prependedAll(prefix: String): String
22+
|prependedAll[B >: Char](prefix: IterableOnce[B]): IndexedSeq[B]
23+
|replaceAllLiterally(literal: String, replacement: String): String
24+
|""".stripMargin
25+
)

0 commit comments

Comments
 (0)