Repository: scalameta/scalameta
Pull request #3150 (2023-05-30 17:57:03)

ScalametaParser: include `=>` in Self position


Patch:
diff --git a/.scalafmt.conf b/.scalafmt.conf
index 29eb6c2b5..c37f82c16 100644
--- a/.scalafmt.conf
+++ b/.scalafmt.conf
@@ -1,4 +1,4 @@
-version = 3.7.5
+version = 3.7.11
 runner.dialect = scala213
 align.preset = none
 align.stripMargin = true
diff --git a/build.sbt b/build.sbt
index 2dd371c88..3cdfbd76e 100644
--- a/build.sbt
+++ b/build.sbt
@@ -36,7 +36,7 @@ addCommandAlias("benchAll", benchAll.command)
 addCommandAlias("benchLSP", benchLSP.command)
 addCommandAlias("benchQuick", benchQuick.command)
 commands += Command.command("ci-windows") { s =>
-  s"testsJVM/all:testOnly -- --exclude-tags=SkipWindows" ::
+  "testsJVM/all:testOnly -- --exclude-tags=SkipWindows" ::
     s
 }
 commands += Command.command("mima") { s =>
@@ -188,7 +188,7 @@ lazy val trees = crossProject(JSPlatform, JVMPlatform, NativePlatform)
     // scalacOptions += "-Xprint:typer",
     enableHardcoreMacros,
     libraryDependencies ++= List(
-      "com.lihaoyi" %%% "fastparse" % "2.3.3"
+      "com.lihaoyi" %%% "fastparse" % "3.0.2"
     ),
     mergedModule({ base =>
       val scalameta = base / "scalameta"
@@ -319,14 +319,14 @@ lazy val semanticdbIntegration = project
         else "-Ywarn-unused-import"
       Seq(
         s"-Xplugin:$pluginJar",
-        s"-Xplugin-require:semanticdb",
+        "-Xplugin-require:semanticdb",
         warnUnusedImports,
-        s"-Yrangepos",
-        s"-P:semanticdb:text:on", // include text to print occurrences in expect suite
-        s"-P:semanticdb:failures:error", // fail fast during development.
-        s"-P:semanticdb:exclude:Exclude.scala",
+        "-Yrangepos",
+        "-P:semanticdb:text:on", // include text to print occurrences in expect suite
+        "-P:semanticdb:failures:error", // fail fast during development.
+        "-P:semanticdb:exclude:Exclude.scala",
         s"-P:semanticdb:sourceroot:${(ThisBuild / baseDirectory).value}",
-        s"-P:semanticdb:synthetics:on"
+        "-P:semanticdb:synthetics:on"
       )
     },
     Compile / javaHome := {
@@ -339,7 +339,7 @@ lazy val semanticdbIntegration = project
     },
     javacOptions += "-parameters"
   )
-  .dependsOn(semanticdbIntegrationMacros)
+  .dependsOn(semanticdbIntegrationMacros, semanticdbScalacPlugin)
 
 lazy val semanticdbIntegrationMacros = project
   .in(file("semanticdb/integration-macros"))
@@ -550,7 +550,7 @@ lazy val sharedSettings = Def.settings(
   organization := "org.scalameta",
   libraryDependencies ++= {
     if (isScala213.value) Nil
-    else List(compilerPlugin("org.scalamacros" % s"paradise" % "2.1.1" cross CrossVersion.full))
+    else List(compilerPlugin("org.scalamacros" % "paradise" % "2.1.1" cross CrossVersion.full))
   },
   scalacOptions ++= {
     if (isScala213.value) List("-Ymacro-annotations")
diff --git a/project/build.properties b/project/build.properties
index 875b706a8..52413ab79 100644
--- a/project/build.properties
+++ b/project/build.properties
@@ -1,1 +1,1 @@
-sbt.version=1.9.2
+sbt.version=1.9.3
diff --git a/project/plugins.sbt b/project/plugins.sbt
index cdd0370ab..95be8f0e9 100644
--- a/project/plugins.sbt
+++ b/project/plugins.sbt
@@ -13,11 +13,11 @@ libraryDependencies += "org.scala-sbt" %% "scripted-plugin" % sbtVersion.value
 
 addSbtPlugin("com.github.sbt" % "sbt-ci-release" % "1.5.12")
 
-addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.2")
+addSbtPlugin("com.typesafe" % "sbt-mima-plugin" % "1.1.3")
 
-addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.1")
+addSbtPlugin("org.portable-scala" % "sbt-scalajs-crossproject" % "1.3.2")
 
-addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.1")
+addSbtPlugin("org.portable-scala" % "sbt-scala-native-crossproject" % "1.3.2")
 
 addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.12.0")
 
diff --git a/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScalametaParser.scala b/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScalametaParser.scala
index 400a4a90b..c6d037bb7 100644
--- a/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScalametaParser.scala
+++ b/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScalametaParser.scala
@@ -4078,20 +4078,19 @@ class ScalametaParser(input: Input)(implicit dialect: Dialect) { parser =>
 
   /* ---------- SELFS --------------------------------------------- */
 
-  def quasiquoteSelf(): Self = entrypointSelf()
+  def quasiquoteSelf(): Self = self(quasiquote = true)
 
-  def entrypointSelf(): Self = self()
+  def entrypointSelf(): Self = self(quasiquote = false)
 
   private def selfEmpty(): Self = {
     val name = anonNameEmpty()
     copyPos(name)(Self(name, None))
   }
 
-  private def self(): Self =
-    selfEither().fold(syntaxError(_, token), identity)
+  private def self(quasiquote: Boolean): Self =
+    selfEither(quasiquote).fold(syntaxError(_, token), identity)
 
-  private def selfEither(): Either[String, Self] = {
-    val startPos = tokenPos
+  private def selfEitherImpl(): Either[String, Self] = {
     val name = token match {
       case t: Ident => termName(t)
       case _: KwThis => nameThis()
@@ -4106,7 +4105,19 @@ class ScalametaParser(input: Input)(implicit dialect: Dialect) { parser =>
       if (!acceptOpt[Colon]) None
       else if (token.isAny[Indentation, LF]) None // fewer braces
       else Some(startInfixType())
-    Right(autoEndPos(startPos)(Self(name, decltpe)))
+    Right(Self(name, decltpe))
+  }
+
+  private def selfEither(quasiquote: Boolean = false): Either[String, Self] = {
+    val startPos = tokenPos
+    selfEitherImpl().right.map { self =>
+      token match {
+        case _: RightArrow => next()
+        case _: EOF if quasiquote =>
+        case _ => return Left("expected `=>`")
+      }
+      autoEndPos(startPos)(self)
+    }
   }
 
   /* -------- TEMPLATES ------------------------------------------- */
@@ -4390,10 +4401,7 @@ class ScalametaParser(input: Input)(implicit dialect: Dialect) { parser =>
       enumCaseAllowed: Boolean = false,
       secondaryConstructorAllowed: Boolean = false
   ): (Self, List[Stat]) = {
-    val selfTreeOpt = tryParse(selfEither().right.toOption match {
-      case x: Some[Self] if acceptOpt[RightArrow] => x
-      case _ => None
-    })
+    val selfTreeOpt = tryParse(selfEither().right.toOption)
     val selfTree = selfTreeOpt.getOrElse(selfEmpty())
     val stats = listBy[Stat] { buf =>
       def getStats() =
diff --git a/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScannerTokens.scala b/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScannerTokens.scala
index 72445c77d..dec47d80c 100644
--- a/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScannerTokens.scala
+++ b/scalameta/parsers/shared/src/main/scala/scala/meta/internal/parsers/ScannerTokens.scala
@@ -469,11 +469,14 @@ final class ScannerTokens(val tokens: Tokens)(implicit dialect: Dialect) {
         currRef(sepRegions match {
           // `case` follows the body of a previous case
           case (_: RegionCaseBody) :: xs => expr() :: xs
-          // x could be RegionIndent or RegionBrace
+          // head could be RegionIndent or RegionBrace
           case x :: RegionCaseMark :: xs => expr() :: x :: xs
-          case (_: RegionBrace) :: (_: RegionFor | RegionTemplateBody) :: _ => sepRegions
+          case (_: RegionDelim) :: (_: RegionFor | RegionTemplateBody) :: _ => sepRegions
+          // partial function
           case (_: RegionBrace) :: _ => expr() :: sepRegions
-          case (_: RegionIndent) :: _ if prev.is[Equals] && prevToken.is[Indentation.Indent] =>
+          // partial function in assignment or fewer braces
+          case (_: RegionIndent) :: _
+              if prevToken.is[Indentation.Indent] && prev.isAny[Equals, Colon] =>
             expr() :: sepRegions
           // `case` is at top-level (likely quasiquote)
           case Nil if prevPos == 0 => expr() :: Nil
@@ -789,8 +792,6 @@ final class ScannerTokens(val tokens: Tokens)(implicit dialect: Dialect) {
                     next match {
                       // RefineDcl
                       case _: KwVal | _: KwDef | _: KwType | _: Semicolon => emitIndent(sepRegions)
-                      // fewer braces partial function
-                      case _: KwCase => emitIndent(RegionCaseMark :: sepRegions)
                       // fewer braces function (although could be self-type)
                       case _ if couldBeFewerBraces() => emitIndent(sepRegions)
                       case _ => None
diff --git a/scalameta/tokenizers/shared/src/main/scala/scala/meta/internal/tokenizers/CharArrayReader.scala b/scalameta/tokenizers/shared/src/main/scala/scala/meta/internal/tokenizers/CharArrayReader.scala
index cebbcdbc3..0e68a34f0 100644
--- a/scalameta/tokenizers/shared/src/main/scala/scala/meta/internal/tokenizers/CharArrayReader.scala
+++ b/scalameta/tokenizers/shared/src/main/scala/scala/meta/internal/tokenizers/CharArrayReader.scala
@@ -6,7 +6,7 @@ import Chars._
 import scala.meta.inputs._
 import scala.util.control.NonFatal
 
-private[tokenizers] case class CharArrayReader private (
+private[meta] case class CharArrayReader private (
     buf: Array[Char],
     dialect: Dialect,
     reporter: Reporter,
@@ -15,7 +15,7 @@ private[tokenizers] case class CharArrayReader private (
     /** The offset one past the last read character */
     var charOffset: Int = 0,
     /** The start offset of the current line */
-    private var lineStartOffset: Int = 0,
+    var lineStartOffset: Int = 0,
     /** The start offset of the line before the current one */
     private var lastLineStartOffset: Int = 0,
     private var lastUnicodeOffset: Int = -1,


Test patch:
diff --git a/tests/jvm/src/test/resources/example/Advanced.scala b/tests/jvm/src/test/resources/example/Advanced_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Advanced.scala
rename to tests/jvm/src/test/resources/example/Advanced_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Advanced_2.13.scala b/tests/jvm/src/test/resources/example/Advanced_2.13.scala
new file mode 100644
index 000000000..730b03855
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Advanced_2.13.scala
@@ -0,0 +1,47 @@
+package advanced
+
+import scala.language/*=>scala.language.*/.existentials/*=>scala.language.existentials.*/
+import scala.language/*=>scala.language.*/.higherKinds/*=>scala.language.higherKinds.*/
+import scala.language/*=>scala.language.*/.reflectiveCalls/*=>scala.language.reflectiveCalls.*/
+
+class C/*<=advanced.C#*/[T/*<=advanced.C#[T]*/] {
+  def t/*<=advanced.C#t().*/: T/*=>advanced.C#[T]*/ = ???/*=>scala.Predef.`???`().*/
+}
+
+class Structural/*<=advanced.Structural#*/ {
+  def s1/*<=advanced.Structural#s1().*/: { val x/*<=local0*/: Int/*=>scala.Int#*/ } = ???/*=>scala.Predef.`???`().*/
+  def s2/*<=advanced.Structural#s2().*/ = new /*<=local2*/{ val x/*<=local1*/: Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/ }
+  def s3/*<=advanced.Structural#s3().*/ = new /*<=local5*/{ def m/*<=local3*/(x/*<=local4*/: Int/*=>scala.Int#*/): Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/ }
+}
+
+class Existential/*<=advanced.Existential#*/ {
+  def e1/*<=advanced.Existential#e1().*/: List/*=>scala.package.List#*/[_] = ???/*=>scala.Predef.`???`().*/
+  def e2/*<=advanced.Existential#e2().*/: C/*=>advanced.C#*/[List/*=>scala.package.List#*/[T/*=>local7*/] forSome { type T/*<=local7*/ }] = ???/*=>scala.Predef.`???`().*/
+  def e4/*<=advanced.Existential#e4().*/: U/*=>local8*/[Int/*=>scala.Int#*/] forSome { type U/*<=local8*/[T/*<=local9*/ <: Int] } = ???/*=>scala.Predef.`???`().*/
+}
+
+class D/*<=advanced.D#*/[CC/*<=advanced.D#[CC]*/[_]] extends C/*=>advanced.C#*/[CC/*=>advanced.D#[CC]*/[_]]
+
+object Test/*<=advanced.Test.*/ {
+  val s/*<=advanced.Test.s.*/ = new Structural/*=>advanced.Structural#*/
+  val s1/*<=advanced.Test.s1.*/ = s/*=>advanced.Test.s.*/.s1/*=>advanced.Structural#s1().*/
+  val s1x/*<=advanced.Test.s1x.*/ = s/*=>advanced.Test.s.*/.s1/*=>advanced.Structural#s1().*/.x/*=>local0*/
+  val s2/*<=advanced.Test.s2.*/ = s/*=>advanced.Test.s.*/.s2/*=>advanced.Structural#s2().*/
+  val s2x/*<=advanced.Test.s2x.*/ = s/*=>advanced.Test.s.*/.s2/*=>advanced.Structural#s2().*/.x/*=>local1*/
+  val s3/*<=advanced.Test.s3.*/ = s/*=>advanced.Test.s.*/.s3/*=>advanced.Structural#s3().*/
+  val s3x/*<=advanced.Test.s3x.*/ = s/*=>advanced.Test.s.*/.s3/*=>advanced.Structural#s3().*/.m/*=>local3*/(???/*=>scala.Predef.`???`().*/)
+
+  val e/*<=advanced.Test.e.*/ = new Existential/*=>advanced.Existential#*/
+  val e1/*<=advanced.Test.e1.*/ = e/*=>advanced.Test.e.*/.e1/*=>advanced.Existential#e1().*/
+  val e1x/*<=advanced.Test.e1x.*/ = e/*=>advanced.Test.e.*/.e1/*=>advanced.Existential#e1().*/.head/*=>scala.collection.IterableOps#head().*/
+  val e2/*<=advanced.Test.e2.*/ = e/*=>advanced.Test.e.*/.e2/*=>advanced.Existential#e2().*/
+  val e2x/*<=advanced.Test.e2x.*/ = e/*=>advanced.Test.e.*/.e2/*=>advanced.Existential#e2().*/.t/*=>advanced.C#t().*/
+  val e2xx/*<=advanced.Test.e2xx.*/ = e/*=>advanced.Test.e.*/.e2/*=>advanced.Existential#e2().*/.t/*=>advanced.C#t().*/.head/*=>scala.collection.IterableOps#head().*/
+  locally/*=>scala.Predef.locally().*/ {
+    (???/*=>scala.Predef.`???`().*/ : Any/*=>scala.Any#*/) match {
+      case e3/*<=local11*/: List/*=>scala.package.List#*/[_] =>
+        val e3x/*<=local13*/ = e3/*=>local11*/.head/*=>scala.collection.IterableOps#head().*/
+        ()
+    }
+  }
+}
diff --git a/tests/jvm/src/test/resources/example/Classes.scala b/tests/jvm/src/test/resources/example/Classes_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Classes.scala
rename to tests/jvm/src/test/resources/example/Classes_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Classes_2.13.scala b/tests/jvm/src/test/resources/example/Classes_2.13.scala
new file mode 100644
index 000000000..0713ec6c8
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Classes_2.13.scala
@@ -0,0 +1,60 @@
+package classes
+
+class C1/*<=classes.C1#*/(val x1/*<=classes.C1#x1.*/: Int/*=>scala.Int#*/) extends AnyVal/*=>scala.AnyVal#*/
+/*=>scala.AnyVal#`<init>`().*/
+class C2/*<=classes.C2#*/(val x2/*<=classes.C2#x2.*/: Int/*=>scala.Int#*/) extends AnyVal/*=>scala.AnyVal#*//*=>scala.AnyVal#`<init>`().*/
+object C2/*<=classes.C2.*/
+
+case class C3/*<=classes.C3#*/(x/*<=classes.C3#x.*/: Int/*=>scala.Int#*/)
+
+case class C4/*<=classes.C4#*/(x/*<=classes.C4#x.*/: Int/*=>scala.Int#*/)
+object C4/*<=classes.C4.*/
+
+object M/*<=classes.M.*/ {
+  implicit class C5/*<=classes.M.C5#*/(x/*<=classes.M.C5#x.*/: Int/*=>scala.Int#*/)
+}
+
+case class C6/*<=classes.C6#*/(private val x/*<=classes.C6#x.*/: Int/*=>scala.Int#*/)
+
+class C7/*<=classes.C7#*/(x/*<=classes.C7#x.*/: Int/*=>scala.Int#*/)
+
+class C8/*<=classes.C8#*/(private[this] val x/*<=classes.C8#x.*/: Int/*=>scala.Int#*/)
+
+class C9/*<=classes.C9#*/(private[this] var x/*<=classes.C9#x().*/: Int/*=>scala.Int#*/)
+
+object N/*<=classes.N.*/ {
+  val anonClass/*<=classes.N.anonClass.*/ = new C7/*=>classes.C7#*/(42) {
+    val local/*<=local9*/ = ???/*=>scala.Predef.`???`().*/
+  }
+  val anonFun/*<=classes.N.anonFun.*/ = List/*=>scala.package.List.*/(1).map/*=>scala.collection.immutable.List#map().*/ { i/*<=local10*/ =>
+    val local/*<=local11*/ = 2
+    local/*=>local11*/ +/*=>scala.Int#`+`(+4).*/ 2
+  }
+}
+
+object Chain/*<=classes.Chain.*/ {
+  class A/*<=classes.Chain.A#*/ {
+    def tst1/*<=classes.Chain.A#tst1().*/(i/*<=classes.Chain.A#tst1().(i)*/: Int/*=>scala.Int#*/): A/*=>classes.Chain.A#*/ = this
+    def tst2/*<=classes.Chain.A#tst2().*/(i/*<=classes.Chain.A#tst2().(i)*/: Int/*=>scala.Int#*/): A/*=>classes.Chain.A#*/ = this
+    def tst3/*<=classes.Chain.A#tst3().*/(i/*<=classes.Chain.A#tst3().(i)*/: Int/*=>scala.Int#*/, j/*<=classes.Chain.A#tst3().(j)*/: Int/*=>scala.Int#*/): A/*=>classes.Chain.A#*/ = this
+    def tst4/*<=classes.Chain.A#tst4().*/(i/*<=classes.Chain.A#tst4().(i)*/: Int/*=>scala.Int#*/, j/*<=classes.Chain.A#tst4().(j)*/: A/*=>classes.Chain.A#*/): A/*=>classes.Chain.A#*/ = j/*=>classes.Chain.A#tst4().(j)*/
+  }
+
+  def tst/*<=classes.Chain.tst().*/(i/*<=classes.Chain.tst().(i)*/: Int/*=>scala.Int#*/, j/*<=classes.Chain.tst().(j)*/: A/*=>classes.Chain.A#*/ = new A/*=>classes.Chain.A#*/()) = j/*=>classes.Chain.tst().(j)*/
+
+  val a/*<=classes.Chain.a.*/ = new A/*=>classes.Chain.A#*/
+  a/*=>classes.Chain.a.*/.tst1/*=>classes.Chain.A#tst1().*/(i/*=>classes.Chain.A#tst1().(i)*/ = 1)
+    .tst2/*=>classes.Chain.A#tst2().*/(i/*=>classes.Chain.A#tst2().(i)*/ = 2)
+
+  a/*=>classes.Chain.a.*/.tst2/*=>classes.Chain.A#tst2().*/(i/*=>classes.Chain.A#tst2().(i)*/ = 1)
+    .tst3/*=>classes.Chain.A#tst3().*/(i/*=>classes.Chain.A#tst3().(i)*/ = 1, 2)
+    .tst1/*=>classes.Chain.A#tst1().*/(i/*=>classes.Chain.A#tst1().(i)*/ = 2)
+
+  a/*=>classes.Chain.a.*/.tst2/*=>classes.Chain.A#tst2().*/(i/*=>classes.Chain.A#tst2().(i)*/ = 1)
+    .tst3/*=>classes.Chain.A#tst3().*/(i/*=>classes.Chain.A#tst3().(i)*/ = 1, j/*=>classes.Chain.A#tst3().(j)*/ = 2)
+    .tst1/*=>classes.Chain.A#tst1().*/(i/*=>classes.Chain.A#tst1().(i)*/ = 2)
+
+  a/*=>classes.Chain.a.*/.tst2/*=>classes.Chain.A#tst2().*/(i/*=>classes.Chain.A#tst2().(i)*/ = 1)
+    .tst4/*=>classes.Chain.A#tst4().*/(i/*=>classes.Chain.A#tst4().(i)*/ = 1, j/*=>classes.Chain.A#tst4().(j)*/ = tst/*=>classes.Chain.tst().*/(i/*=>classes.Chain.tst().(i)*/ = 1, j/*=>classes.Chain.tst().(j)*/ = new A/*=>classes.Chain.A#*/()))
+    .tst1/*=>classes.Chain.A#tst1().*/(i/*=>classes.Chain.A#tst1().(i)*/ = 2)
+}
diff --git a/tests/jvm/src/test/resources/example/EtaExpansion.scala b/tests/jvm/src/test/resources/example/EtaExpansion_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/EtaExpansion.scala
rename to tests/jvm/src/test/resources/example/EtaExpansion_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/EtaExpansion_2.13.scala b/tests/jvm/src/test/resources/example/EtaExpansion_2.13.scala
new file mode 100644
index 000000000..97fe07a84
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/EtaExpansion_2.13.scala
@@ -0,0 +1,12 @@
+package example
+
+class EtaExpansion/*<=example.EtaExpansion#*/ {
+  Some/*=>scala.Some.*/(1).map/*=>scala.Option#map().*/(identity/*=>scala.Predef.identity().*/)
+  List/*=>scala.package.List.*/(1).foldLeft/*=>scala.collection.LinearSeqOps#foldLeft().*/("")(_ +/*=>java.lang.String#`+`().*/ _)
+
+  def prop/*<=example.EtaExpansion#prop().*/ = ""
+  def meth/*<=example.EtaExpansion#meth().*/() = ""
+
+  prop/*=>example.EtaExpansion#prop().*/ _
+  meth/*=>example.EtaExpansion#meth().*/ _
+}
diff --git a/tests/jvm/src/test/resources/example/Flags.scala b/tests/jvm/src/test/resources/example/Flags_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Flags.scala
rename to tests/jvm/src/test/resources/example/Flags_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Flags_2.13.scala b/tests/jvm/src/test/resources/example/Flags_2.13.scala
new file mode 100644
index 000000000..720721d61
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Flags_2.13.scala
@@ -0,0 +1,26 @@
+package flags
+
+import scala.language/*=>scala.language.*/.experimental/*=>scala.language.experimental.*/.macros/*=>scala.language.experimental.macros.*/
+
+package object p/*<=flags.p.package.*/ {
+  private lazy val x/*<=flags.p.package.x.*/ = 1
+  protected implicit var y/*<=flags.p.package.y().*/: Int/*=>scala.Int#*/ = 2
+  def z/*<=flags.p.package.z().*/(pp/*<=flags.p.package.z().(pp)*/: Int/*=>scala.Int#*/) = 3
+  def m/*<=flags.p.package.m().*/[TT/*<=flags.p.package.m().[TT]*/]: Int/*=>scala.Int#*/ = macro ???/*=>scala.Predef.`???`().*/
+  abstract class C/*<=flags.p.package.C#*/[+T/*<=flags.p.package.C#[T]*/, -U/*<=flags.p.package.C#[U]*/, V/*<=flags.p.package.C#[V]*/](x/*<=flags.p.package.C#x.*/: T/*=>flags.p.package.C#[T]*/, y/*<=flags.p.package.C#y.*/: U/*=>flags.p.package.C#[U]*/, z/*<=flags.p.package.C#z.*/: V/*=>flags.p.package.C#[V]*/) {
+    def this/*<=flags.p.package.C#`<init>`(+1).*/() = this(???/*=>scala.Predef.`???`().*/, ???/*=>scala.Predef.`???`().*/, ???/*=>scala.Predef.`???`().*/)
+    def w/*<=flags.p.package.C#w().*/: Int/*=>scala.Int#*/
+  }
+  type T1/*<=flags.p.package.T1#*/ = Int/*=>scala.Int#*/
+  type T2/*<=flags.p.package.T2#*/[T/*<=flags.p.package.T2#[T]*/] = S/*=>flags.p.package.S#*/[T/*=>flags.p.package.T2#[T]*/]
+  type U/*<=flags.p.package.U#*/ <: Int/*=>scala.Int#*/
+  type V/*<=flags.p.package.V#*/ >: Int/*=>scala.Int#*/
+  case object X/*<=flags.p.package.X.*/
+  final class Y/*<=flags.p.package.Y#*/
+  sealed trait Z/*<=flags.p.package.Z#*/
+  class AA/*<=flags.p.package.AA#*/(x/*<=flags.p.package.AA#x.*/: Int/*=>scala.Int#*/, val y/*<=flags.p.package.AA#y.*/: Int/*=>scala.Int#*/, var z/*<=flags.p.package.AA#z().*/: Int/*=>scala.Int#*/)
+  class S/*<=flags.p.package.S#*/[@specialized/*=>scala.specialized#*/ /*=>scala.specialized#`<init>`(+2).*/T/*<=flags.p.package.S#[T]*/]
+  val List/*=>scala.package.List.*/(xs1/*<=flags.p.package.xs1.*/) = ???/*=>scala.Predef.`???`().*/
+  ???/*=>scala.Predef.`???`().*/ match { case List/*=>scala.package.List.*/(xs2/*<=local1*/) => ???/*=>scala.Predef.`???`().*/ }
+  ???/*=>scala.Predef.`???`().*/ match { case _: List/*=>scala.package.List#*/[t/*<=local2*/] => ???/*=>scala.Predef.`???`().*/ }
+}
diff --git a/tests/jvm/src/test/resources/example/ForComprehension.scala b/tests/jvm/src/test/resources/example/ForComprehension_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/ForComprehension.scala
rename to tests/jvm/src/test/resources/example/ForComprehension_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/ForComprehension_2.13.scala b/tests/jvm/src/test/resources/example/ForComprehension_2.13.scala
new file mode 100644
index 000000000..9237fe7ee
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/ForComprehension_2.13.scala
@@ -0,0 +1,49 @@
+package example
+
+class ForComprehension/*<=example.ForComprehension#*/ {
+  for {
+    a/*<=local0*/ <- List/*=>scala.package.List.*/(1)
+    b/*<=local1*/ <- List/*=>scala.package.List.*/(1)
+    if b/*=>local1*/ >/*=>scala.Int#`>`(+3).*/ 1
+    c/*<=local3*/ = a/*=>local0*/ +/*=>scala.Int#`+`(+4).*/ b/*=>local1*/
+  } yield (a/*=>local0*/, b/*=>local1*/, c/*=>local3*/)
+  for {
+    a/*<=local4*/ <- List/*=>scala.package.List.*/(1)
+    b/*<=local5*/ <- List/*=>scala.package.List.*/(a/*=>local4*/)
+    if (
+      a/*=>local4*/,
+      b/*=>local5*/
+    ) ==/*=>java.lang.Object#`==`().*/ (1, 2)
+    (
+      c/*<=local11*/,
+      d/*<=local12*/
+    ) <- List/*=>scala.package.List.*/((a/*=>local4*/, b/*=>local5*/))
+    if (
+      a/*=>local4*/,
+      b/*=>local5*/,
+      c/*=>local11*/,
+      d/*=>local12*/
+    ) ==/*=>java.lang.Object#`==`().*/ (1, 2, 3, 4)
+    e/*<=local14*/ = (
+      a/*=>local4*/,
+      b/*=>local5*/,
+      c/*=>local11*/,
+      d/*=>local12*/
+    )
+    if e/*=>local14*/ ==/*=>java.lang.Object#`==`().*/ (1, 2, 3, 4)
+    f/*<=local15*/ <- List/*=>scala.package.List.*/(e/*=>local14*/)
+  } yield {
+    (
+      a/*=>local4*/,
+      b/*=>local5*/,
+      c/*=>local11*/,
+      d/*=>local12*/,
+      e/*=>local14*/,
+      f/*=>local15*/
+    )
+  }
+  val x/*<=example.ForComprehension#x.*/: Option/*=>scala.Option#*/[(Int/*=>scala.Int#*/, Int/*=>scala.Int#*/)] = None/*=>scala.None.*/
+  for {
+    (_, _) <- x/*=>example.ForComprehension#x.*/
+  } yield ()
+}
diff --git a/tests/jvm/src/test/resources/example/ImplicitConversion.scala b/tests/jvm/src/test/resources/example/ImplicitConversion_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/ImplicitConversion.scala
rename to tests/jvm/src/test/resources/example/ImplicitConversion_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/ImplicitConversion_2.13.scala b/tests/jvm/src/test/resources/example/ImplicitConversion_2.13.scala
new file mode 100644
index 000000000..e655bf08b
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/ImplicitConversion_2.13.scala
@@ -0,0 +1,37 @@
+package example
+
+import scala.language/*=>scala.language.*/.implicitConversions/*=>scala.language.implicitConversions.*/
+
+class ImplicitConversion/*<=example.ImplicitConversion#*/ {
+  implicit def string2Number/*<=example.ImplicitConversion#string2Number().*/(
+      string/*<=example.ImplicitConversion#string2Number().(string)*/: String/*=>scala.Predef.String#*/
+  ): Int/*=>scala.Int#*/ = 42
+  val message/*<=example.ImplicitConversion#message.*/ = ""
+  val number/*<=example.ImplicitConversion#number.*/ = 42
+  val tuple/*<=example.ImplicitConversion#tuple.*/ = (1, 2)
+  val char/*<=example.ImplicitConversion#char.*/: Char/*=>scala.Char#*/ = 'a'
+
+  // extension methods
+  message/*=>example.ImplicitConversion#message.*/
+    .stripSuffix/*=>scala.collection.StringOps#stripSuffix().*/("h")
+  tuple/*=>example.ImplicitConversion#tuple.*/ +/*=>scala.Predef.any2stringadd#`+`().*/ "Hello"
+
+  // implicit conversions
+  val x/*<=example.ImplicitConversion#x.*/: Int/*=>scala.Int#*/ = message/*=>example.ImplicitConversion#message.*/
+
+  // interpolators
+  s/*=>scala.StringContext#s().*/"Hello $message/*=>example.ImplicitConversion#message.*/ $number/*=>example.ImplicitConversion#number.*/"
+  s/*=>scala.StringContext#s().*/"""Hello
+     |$message/*=>example.ImplicitConversion#message.*/
+     |$number/*=>example.ImplicitConversion#number.*/""".stripMargin/*=>scala.collection.StringOps#stripMargin(+1).*/
+
+  val a/*<=example.ImplicitConversion#a.*/: Int/*=>scala.Int#*/ = char/*=>example.ImplicitConversion#char.*/
+  val b/*<=example.ImplicitConversion#b.*/: Long/*=>scala.Long#*/ = char/*=>example.ImplicitConversion#char.*/
+  val toLong/*<=example.ImplicitConversion#toLong.*/: Int/*=>scala.Int#*/ = 42
+  // The line below reproduces a known bug, where the symbol occurrence is
+  // "scala/Int#toLong()." instead of "example/ImplicitConversions.toLong.".
+  // This bug happens because our current heuristic to detect implicit
+  // conversions is based on the name of the symbol, and the "toLong" variable
+  // has the same name as the implicit conversion that's being applied.
+  val c/*<=example.ImplicitConversion#c.*/: Long/*=>scala.Long#*/ = toLong/*=>scala.Int#toLong().*/
+}
diff --git a/tests/jvm/src/test/resources/example/InstrumentTyper.scala b/tests/jvm/src/test/resources/example/InstrumentTyper_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/InstrumentTyper.scala
rename to tests/jvm/src/test/resources/example/InstrumentTyper_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/InstrumentTyper_2.13.8.scala b/tests/jvm/src/test/resources/example/InstrumentTyper_2.13.8.scala
new file mode 100644
index 000000000..2237e7915
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/InstrumentTyper_2.13.8.scala
@@ -0,0 +1,28 @@
+package example
+
+import scala.annotation.meta.param/*=>scala.annotation.meta.param#*/
+import scala.language/*=>scala.language.*/.existentials/*=>scala.language.existentials.*/
+import scala.language/*=>scala.language.*/.higherKinds/*=>scala.language.higherKinds.*/
+import types.Test/*=>types.Test.*/._
+
+class InstrumentTyper/*<=example.InstrumentTyper#*/ { self/*<=local0*/: AnyRef =>
+  def all/*<=example.InstrumentTyper#all().*/ = List/*=>scala.package.List.*/(
+    Literal/*=>types.Test.Literal.*/.int/*=>types.Test.Literal.int.*/,
+    Literal/*=>types.Test.Literal.*/.long/*=>types.Test.Literal.long.*/,
+    Literal/*=>types.Test.Literal.*/.float/*=>types.Test.Literal.float.*/,
+    Literal/*=>types.Test.Literal.*/.double/*=>types.Test.Literal.double.*/,
+    Literal/*=>types.Test.Literal.*/.nil/*=>types.Test.Literal.nil.*/,
+    Literal/*=>types.Test.Literal.*/.char/*=>types.Test.Literal.char.*/,
+    Literal/*=>types.Test.Literal.*/.string/*=>types.Test.Literal.string.*/,
+    Literal/*=>types.Test.Literal.*/.bool/*=>types.Test.Literal.bool.*/,
+    Literal/*=>types.Test.Literal.*/.unit/*=>types.Test.Literal.unit.*/,
+    Literal/*=>types.Test.Literal.*/.javaEnum/*=>types.Test.Literal.javaEnum.*/,
+    Literal/*=>types.Test.Literal.*/.clazzOfInt/*=>types.Test.Literal.clazzOfInt.*/,
+    Literal/*=>types.Test.Literal.*/.clazzOfOption/*=>types.Test.Literal.clazzOfOption.*/,
+    List/*=>scala.package.List.*/()
+  )
+  def existential/*<=example.InstrumentTyper#existential().*/: U/*=>local1*/[Int/*=>scala.Int#*/] forSome { type U/*<=local1*/[T/*<=local2*/ <: Int] } = ???/*=>scala.Predef.`???`().*/
+  type AnnotatedType/*<=example.InstrumentTyper#AnnotatedType#*/ = Int/*=>scala.Int#*/ @param
+  def singletonType/*<=example.InstrumentTyper#singletonType().*/(x/*<=example.InstrumentTyper#singletonType().(x)*/: Predef/*=>scala.Predef.*/.type) = ???/*=>scala.Predef.`???`().*/
+  final val clazzOf/*<=example.InstrumentTyper#clazzOf.*/ = classOf/*=>scala.Predef.classOf().*/[Option[Int]]
+}
diff --git a/tests/jvm/src/test/resources/example/InstrumentTyper_2.13.scala b/tests/jvm/src/test/resources/example/InstrumentTyper_2.13.scala
new file mode 100644
index 000000000..cd17e613f
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/InstrumentTyper_2.13.scala
@@ -0,0 +1,28 @@
+package example
+
+import scala.annotation.meta.param/*=>scala.annotation.meta.param#*/
+import scala.language/*=>scala.language.*/.existentials/*=>scala.language.existentials.*/
+import scala.language/*=>scala.language.*/.higherKinds/*=>scala.language.higherKinds.*/
+import types.Test/*=>types.Test.*/._
+
+class InstrumentTyper/*<=example.InstrumentTyper#*/ { self/*<=local0*/: AnyRef =>
+  def all/*<=example.InstrumentTyper#all().*/ = List/*=>scala.package.List.*/(
+    Literal/*=>types.Test.Literal.*/.int/*=>types.Test.Literal.int.*/,
+    Literal/*=>types.Test.Literal.*/.long/*=>types.Test.Literal.long.*/,
+    Literal/*=>types.Test.Literal.*/.float/*=>types.Test.Literal.float.*/,
+    Literal/*=>types.Test.Literal.*/.double/*=>types.Test.Literal.double.*/,
+    Literal/*=>types.Test.Literal.*/.nil/*=>types.Test.Literal.nil.*/,
+    Literal/*=>types.Test.Literal.*/.char/*=>types.Test.Literal.char.*/,
+    Literal/*=>types.Test.Literal.*/.string/*=>types.Test.Literal.string.*/,
+    Literal/*=>types.Test.Literal.*/.bool/*=>types.Test.Literal.bool.*/,
+    Literal/*=>types.Test.Literal.*/.unit/*=>types.Test.Literal.unit.*/,
+    Literal/*=>types.Test.Literal.*/.javaEnum/*=>types.Test.Literal.javaEnum.*/,
+    Literal/*=>types.Test.Literal.*/.clazzOfInt/*=>types.Test.Literal.clazzOfInt.*/,
+    Literal/*=>types.Test.Literal.*/.clazzOfOption/*=>types.Test.Literal.clazzOfOption.*/,
+    List/*=>scala.collection.immutable.Nil.*/()
+  )
+  def existential/*<=example.InstrumentTyper#existential().*/: U/*=>local1*/[Int/*=>scala.Int#*/] forSome { type U/*<=local1*/[T/*<=local2*/ <: Int] } = ???/*=>scala.Predef.`???`().*/
+  type AnnotatedType/*<=example.InstrumentTyper#AnnotatedType#*/ = Int/*=>scala.Int#*/ @param
+  def singletonType/*<=example.InstrumentTyper#singletonType().*/(x/*<=example.InstrumentTyper#singletonType().(x)*/: Predef/*=>scala.Predef.*/.type) = ???/*=>scala.Predef.`???`().*/
+  final val clazzOf/*<=example.InstrumentTyper#clazzOf.*/ = classOf/*=>scala.Predef.classOf().*/[Option[Int]]
+}
diff --git a/tests/jvm/src/test/resources/example/Issue1749.scala b/tests/jvm/src/test/resources/example/Issue1749_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Issue1749.scala
rename to tests/jvm/src/test/resources/example/Issue1749_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Issue1749_2.13.scala b/tests/jvm/src/test/resources/example/Issue1749_2.13.scala
new file mode 100644
index 000000000..fbcacfa9f
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Issue1749_2.13.scala
@@ -0,0 +1,16 @@
+// See https://github.com/scalameta/scalameta/issues/1749
+package example
+
+import scala.math.Ordered/*=>scala.math.Ordered.*/.orderingToOrdered/*=>scala.math.Ordered.orderingToOrdered().*/
+
+class Issue1749/*<=example.Issue1749#*/ {
+  val x1/*<=example.Issue1749#x1.*/ = 42
+  val x2/*<=example.Issue1749#x2.*/ = 42
+  (x1/*=>example.Issue1749#x1.*/, x1/*=>example.Issue1749#x1.*/)
+    .compare/*=>scala.math.Ordered#compare().*/((x2/*=>example.Issue1749#x2.*/, x2/*=>example.Issue1749#x2.*/))
+}
+
+class Issue1854/*<=example.Issue1854#*/ {
+  val map/*<=example.Issue1854#map.*/ = collection.mutable.Map/*=>scala.collection.mutable.Map.*/.empty/*=>scala.collection.MapFactory.Delegate#empty().*/[String/*=>scala.Predef.String#*/, String/*=>scala.Predef.String#*/]
+  map/*=>example.Issue1854#map.*/("a") = "b"
+}
diff --git a/tests/jvm/src/test/resources/example/Issue2116.scala b/tests/jvm/src/test/resources/example/Issue2116_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Issue2116.scala
rename to tests/jvm/src/test/resources/example/Issue2116_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Issue2116_2.13.scala b/tests/jvm/src/test/resources/example/Issue2116_2.13.scala
new file mode 100644
index 000000000..0a430c306
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Issue2116_2.13.scala
@@ -0,0 +1,22 @@
+// See https://github.com/scalameta/scalameta/issues/2116
+package example
+
+import scala.concurrent.ExecutionContext/*=>scala.concurrent.ExecutionContext.*//*=>scala.concurrent.ExecutionContext#*/
+
+abstract class Issue2116/*<=example.Issue2116#*/ {
+
+  def check/*<=example.Issue2116#check().*/(
+      includeDocs/*<=example.Issue2116#check().(includeDocs)*/: Boolean/*=>scala.Boolean#*/ = false,
+      includeCommitCharacter/*<=example.Issue2116#check().(includeCommitCharacter)*/: Boolean/*=>scala.Boolean#*/ = false
+  )(implicit loc/*<=example.Issue2116#check().(loc)*/: ExecutionContext/*=>scala.concurrent.ExecutionContext#*/): Unit/*=>scala.Unit#*/ = {}
+}
+
+class Issue2116_2/*<=example.Issue2116_2#*/ extends Issue2116/*=>example.Issue2116#*/ {
+
+  implicit val ec/*<=example.Issue2116_2#ec.*/ = scala.concurrent.ExecutionContext/*=>scala.concurrent.ExecutionContext.*/.global/*=>scala.concurrent.ExecutionContext.global.*/
+
+  check/*=>example.Issue2116#check().*/(
+    includeCommitCharacter/*=>example.Issue2116#check().(includeCommitCharacter)*/ = true
+  )
+
+}
diff --git a/tests/jvm/src/test/resources/example/Locals.scala b/tests/jvm/src/test/resources/example/Locals_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Locals.scala
rename to tests/jvm/src/test/resources/example/Locals_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Locals_2.13.scala b/tests/jvm/src/test/resources/example/Locals_2.13.scala
new file mode 100644
index 000000000..dc1e3a5d9
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Locals_2.13.scala
@@ -0,0 +1,8 @@
+package locals
+
+object Test/*<=locals.Test.*/ {
+  val xs/*<=locals.Test.xs.*/ = {
+    val x/*<=local0*/ = 42
+    List/*=>scala.package.List.*/(x/*=>local0*/)
+  }
+}
diff --git a/tests/jvm/src/test/resources/example/MacroAnnotations.scala b/tests/jvm/src/test/resources/example/MacroAnnotations_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/MacroAnnotations.scala
rename to tests/jvm/src/test/resources/example/MacroAnnotations_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/MacroAnnotations_2.13.scala b/tests/jvm/src/test/resources/example/MacroAnnotations_2.13.scala
new file mode 100644
index 000000000..3a8995cf6
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/MacroAnnotations_2.13.scala
@@ -0,0 +1,5 @@
+package example
+
+@MacroAnnotation/*=>example.MacroAnnotations#*/
+class MacroAnnotations
+object MacroAnnotations
diff --git a/tests/jvm/src/test/resources/example/MethodUsages.scala b/tests/jvm/src/test/resources/example/MethodUsages_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/MethodUsages.scala
rename to tests/jvm/src/test/resources/example/MethodUsages_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/MethodUsages_2.13.scala b/tests/jvm/src/test/resources/example/MethodUsages_2.13.scala
new file mode 100644
index 000000000..74309c8f4
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/MethodUsages_2.13.scala
@@ -0,0 +1,34 @@
+package example
+
+class MethodUsages/*<=example.MethodUsages#*/ {
+  val m/*<=example.MethodUsages#m.*/ = new Methods/*=>example.Methods#*/[Int/*=>scala.Int#*/]/*=>example.Methods#`<init>`().*/
+  m/*=>example.MethodUsages#m.*/.m1/*=>example.Methods#m1().*/
+  m/*=>example.MethodUsages#m.*/.m2/*=>example.Methods#m2().*/()
+  m/*=>example.MethodUsages#m.*/.m3/*=>example.Methods#m3().*/(0)
+  m/*=>example.MethodUsages#m.*/.m4/*=>example.Methods#m4().*/(0)(0)
+  m/*=>example.MethodUsages#m.*/.m5/*=>example.Methods#m5().*/("")
+  m/*=>example.MethodUsages#m.*/.m5/*=>example.Methods#m5(+1).*/(0)
+  m/*=>example.MethodUsages#m.*/.m6/*=>example.Methods#m6().*/(0)
+  m/*=>example.MethodUsages#m.*/.m6/*=>example.Methods#m6(+1).*/(new m/*=>example.MethodUsages#m.*/.List/*=>example.Methods#List#*/[Int/*=>scala.Int#*/]/*=>example.Methods#List#`<init>`().*/)
+  m/*=>example.MethodUsages#m.*/.m6/*=>example.Methods#m6(+2).*/(Nil/*=>scala.package.Nil.*/)
+  m/*=>example.MethodUsages#m.*/.m7a/*=>example.Methods#m7a().*/(m/*=>example.MethodUsages#m.*/, new m/*=>example.MethodUsages#m.*/.List/*=>example.Methods#List#*/[Int/*=>scala.Int#*/]/*=>example.Methods#List#`<init>`().*/)
+  m/*=>example.MethodUsages#m.*/.m7b/*=>example.Methods#m7b().*/(new m/*=>example.MethodUsages#m.*/.List/*=>example.Methods#List#*/[Int/*=>scala.Int#*/]/*=>example.Methods#List#`<init>`().*/)
+  m/*=>example.MethodUsages#m.*/.`m8().`/*=>example.Methods#`m8().`().*/()
+  m/*=>example.MethodUsages#m.*/.m9/*=>example.Methods#m9().*/(null)
+  m/*=>example.MethodUsages#m.*/.m10/*=>example.Methods#m10().*/(null)
+  m/*=>example.MethodUsages#m.*/.m11/*=>example.Methods#m11().*/(Predef/*=>scala.Predef.*/)
+  m/*=>example.MethodUsages#m.*/.m11/*=>example.Methods#m11(+1).*/(Example/*=>example.Example.*/)
+  m/*=>example.MethodUsages#m.*/.m12a/*=>example.Methods#m12a().*/(null)
+  m/*=>example.MethodUsages#m.*/.m12b/*=>example.Methods#m12b().*/(null)
+  m/*=>example.MethodUsages#m.*/.m13/*=>example.Methods#m13().*/(0)
+  m/*=>example.MethodUsages#m.*/.m14/*=>example.Methods#m14().*/(null)
+  m/*=>example.MethodUsages#m.*/.m15/*=>example.Methods#m15().*/(0)
+  m/*=>example.MethodUsages#m.*/.m16/*=>example.Methods#m16().*/(0)
+  m/*=>example.MethodUsages#m.*/.m16/*=>example.Methods#m16().*/(0)
+  m/*=>example.MethodUsages#m.*/.m17/*=>example.Methods#m17.*/.m/*=>example.Methods#m17.m().*/()
+  m/*=>example.MethodUsages#m.*/.m17/*=>example.Methods#m17().*/(1)
+  m/*=>example.MethodUsages#m.*/.m17/*=>example.Methods#m17(+1).*/("")
+  m/*=>example.MethodUsages#m.*/.m18/*=>example.Methods#m18.*/.m/*=>example.Methods#m17.m().*/()
+  m/*=>example.MethodUsages#m.*/.m18/*=>example.Methods#m18().*/(1)
+  m/*=>example.MethodUsages#m.*/.m18/*=>example.Methods#m18(+1).*/("")
+}
diff --git a/tests/jvm/src/test/resources/example/Methods.scala b/tests/jvm/src/test/resources/example/Methods_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Methods.scala
rename to tests/jvm/src/test/resources/example/Methods_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Methods_2.13.8.scala b/tests/jvm/src/test/resources/example/Methods_2.13.8.scala
new file mode 100644
index 000000000..12ec78718
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Methods_2.13.8.scala
@@ -0,0 +1,39 @@
+package example
+
+import scala.math.Ordering/*=>scala.math.Ordering.*//*=>scala.math.Ordering#*/
+import scala.language/*=>scala.language.*/.existentials/*=>scala.language.existentials.*/
+
+class Methods/*<=example.Methods#*/[T/*<=example.Methods#[T]*/] {
+  class List/*<=example.Methods#List#*/[T/*<=example.Methods#List#[T]*/]
+  type AList/*<=example.Methods#AList#*/[T/*<=example.Methods#AList#[T]*/] = List/*=>example.Methods#List#*/[T/*=>example.Methods#AList#[T]*/]
+  def m1/*<=example.Methods#m1().*/ = ???/*=>scala.Predef.`???`().*/
+  def m2/*<=example.Methods#m2().*/() = ???/*=>scala.Predef.`???`().*/
+  def m3/*<=example.Methods#m3().*/(x/*<=example.Methods#m3().(x)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m4/*<=example.Methods#m4().*/(x/*<=example.Methods#m4().(x)*/: Int/*=>scala.Int#*/)(y/*<=example.Methods#m4().(y)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m5/*<=example.Methods#m5().*/(x/*<=example.Methods#m5().(x)*/: String/*=>scala.Predef.String#*/) = ???/*=>scala.Predef.`???`().*/
+  def m5/*<=example.Methods#m5(+1).*/(x/*<=example.Methods#m5(+1).(x)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m6/*<=example.Methods#m6().*/(x/*<=example.Methods#m6().(x)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m6/*<=example.Methods#m6(+1).*/(x/*<=example.Methods#m6(+1).(x)*/: List/*=>example.Methods#List#*/[T/*=>example.Methods#[T]*/]) = ???/*=>scala.Predef.`???`().*/
+  def m6/*<=example.Methods#m6(+2).*/(x/*<=example.Methods#m6(+2).(x)*/: scala.List/*=>scala.package.List#*/[T/*=>example.Methods#[T]*/]) = ???/*=>scala.Predef.`???`().*/
+  def m7a/*<=example.Methods#m7a().*/[U/*<=example.Methods#m7a().[U]*/: Ordering/*=>scala.math.Ordering#*/](c/*<=example.Methods#m7a().(c)*/: Methods/*=>example.Methods#*/[T/*=>example.Methods#[T]*/], l/*<=example.Methods#m7a().(l)*/: List/*=>example.Methods#List#*/[U/*=>example.Methods#m7a().[U]*/]) = ???/*=>scala.Predef.`???`().*/
+  def m7b/*<=example.Methods#m7b().*/[U/*<=example.Methods#m7b().[U]*/ <% T/*=>example.Methods#[T]*/](l/*<=example.Methods#m7b().(l)*/: List/*=>example.Methods#List#*/[U/*=>example.Methods#m7b().[U]*/]) = ???/*=>scala.Predef.`???`().*/
+  def `m8().`/*<=example.Methods#`m8().`().*/() = ???/*=>scala.Predef.`???`().*/
+  class `m9().`/*<=example.Methods#`m9().`#*/
+  def m9/*<=example.Methods#m9().*/(x/*<=example.Methods#m9().(x)*/: `m9().`/*=>example.Methods#`m9().`#*/) = ???/*=>scala.Predef.`???`().*/
+  def m10/*<=example.Methods#m10().*/(x/*<=example.Methods#m10().(x)*/: AList/*=>example.Methods#AList#*/[T/*=>example.Methods#[T]*/]) = ???/*=>scala.Predef.`???`().*/
+  def m11/*<=example.Methods#m11().*/(x/*<=example.Methods#m11().(x)*/: Predef/*=>scala.Predef.*/.type) = ???/*=>scala.Predef.`???`().*/
+  def m11/*<=example.Methods#m11(+1).*/(x/*<=example.Methods#m11(+1).(x)*/: Example/*=>example.Example.*/.type) = ???/*=>scala.Predef.`???`().*/
+  def m12a/*<=example.Methods#m12a().*/(x/*<=example.Methods#m12a().(x)*/: {}) = ???/*=>scala.Predef.`???`().*/
+  def m12b/*<=example.Methods#m12b().*/(x/*<=example.Methods#m12b().(x)*/: { val x/*<=local0*/: Int/*=>scala.Int#*/ }) = ???/*=>scala.Predef.`???`().*/
+  def m13/*<=example.Methods#m13().*/(x/*<=example.Methods#m13().(x)*/: Int/*=>scala.Int#*/ @unchecked) = ???/*=>scala.Predef.`???`().*/
+  def m14/*<=example.Methods#m14().*/(x/*<=example.Methods#m14().(x)*/: T/*=>local1*/ forSome { type T/*<=local1*/ }) = ???/*=>scala.Predef.`???`().*/
+  def m15/*<=example.Methods#m15().*/(x/*<=example.Methods#m15().(x)*/: => Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m16/*<=example.Methods#m16().*/(x/*<=example.Methods#m16().(x)*/: Int/*=>scala.Int#*/*) = ???/*=>scala.Predef.`???`().*/
+  object m17/*<=example.Methods#m17.*/ { def m/*<=example.Methods#m17.m().*/() = ???/*=>scala.Predef.`???`().*/ }
+  def m17/*<=example.Methods#m17().*/(a/*<=example.Methods#m17().(a)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m17/*<=example.Methods#m17(+1).*/(b/*<=example.Methods#m17(+1).(b)*/: String/*=>scala.Predef.String#*/) = ???/*=>scala.Predef.`???`().*/
+  val m18/*<=example.Methods#m18.*/ = m17/*=>example.Methods#m17.*/
+  def m18/*<=example.Methods#m18().*/(a/*<=example.Methods#m18().(a)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m18/*<=example.Methods#m18(+1).*/(b/*<=example.Methods#m18(+1).(b)*/: String/*=>scala.Predef.String#*/) = ???/*=>scala.Predef.`???`().*/
+  def m19/*<=example.Methods#m19().*/(x/*<=example.Methods#m19().(x)*/: Int/*=>scala.Int#*/, y/*<=example.Methods#m19().(y)*/: Int/*=>scala.Int#*/ = 2)(z/*<=example.Methods#m19().(z)*/: Int/*=>scala.Int#*/ = 3) = ???/*=>scala.Predef.`???`().*/
+}
diff --git a/tests/jvm/src/test/resources/example/Methods_2.13.scala b/tests/jvm/src/test/resources/example/Methods_2.13.scala
new file mode 100644
index 000000000..1aab4c067
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Methods_2.13.scala
@@ -0,0 +1,39 @@
+package example
+
+import scala.math.Ordering/*=>scala.math.Ordering.*//*=>scala.math.Ordering#*/
+import scala.language/*=>scala.language.*/.existentials/*=>scala.language.existentials.*/
+
+class Methods/*<=example.Methods#*/[T/*<=example.Methods#[T]*/] {
+  class List/*<=example.Methods#List#*/[T/*<=example.Methods#List#[T]*/]
+  type AList/*<=example.Methods#AList#*/[T/*<=example.Methods#AList#[T]*/] = List/*=>example.Methods#List#*/[T/*=>example.Methods#AList#[T]*/]
+  def m1/*<=example.Methods#m1().*/ = ???/*=>scala.Predef.`???`().*/
+  def m2/*<=example.Methods#m2().*/() = ???/*=>scala.Predef.`???`().*/
+  def m3/*<=example.Methods#m3().*/(x/*<=example.Methods#m3().(x)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m4/*<=example.Methods#m4().*/(x/*<=example.Methods#m4().(x)*/: Int/*=>scala.Int#*/)(y/*<=example.Methods#m4().(y)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m5/*<=example.Methods#m5().*/(x/*<=example.Methods#m5().(x)*/: String/*=>scala.Predef.String#*/) = ???/*=>scala.Predef.`???`().*/
+  def m5/*<=example.Methods#m5(+1).*/(x/*<=example.Methods#m5(+1).(x)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m6/*<=example.Methods#m6().*/(x/*<=example.Methods#m6().(x)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m6/*<=example.Methods#m6(+1).*/(x/*<=example.Methods#m6(+1).(x)*/: List/*=>example.Methods#List#*/[T/*=>example.Methods#[T]*/]) = ???/*=>scala.Predef.`???`().*/
+  def m6/*<=example.Methods#m6(+2).*/(x/*<=example.Methods#m6(+2).(x)*/: scala.List/*=>scala.package.List#*/[T/*=>example.Methods#[T]*/]) = ???/*=>scala.Predef.`???`().*/
+  def m7a/*<=example.Methods#m7a().*/[U/*<=example.Methods#m7a().[U]*/: Ordering/*=>example.Methods#m7a().(evidence$1)*/](c/*<=example.Methods#m7a().(c)*/: Methods/*=>example.Methods#*/[T/*=>example.Methods#[T]*/], l/*<=example.Methods#m7a().(l)*/: List/*=>example.Methods#List#*/[U/*=>example.Methods#m7a().[U]*/]) = ???/*=>scala.Predef.`???`().*/
+  def m7b/*<=example.Methods#m7b().*/[U/*<=example.Methods#m7b().[U]*/ <% T/*=>example.Methods#[T]*/](l/*<=example.Methods#m7b().(l)*/: List/*=>example.Methods#List#*/[U/*=>example.Methods#m7b().[U]*/]) = ???/*=>scala.Predef.`???`().*/
+  def `m8().`/*<=example.Methods#`m8().`().*/() = ???/*=>scala.Predef.`???`().*/
+  class `m9().`/*<=example.Methods#`m9().`#*/
+  def m9/*<=example.Methods#m9().*/(x/*<=example.Methods#m9().(x)*/: `m9().`/*=>example.Methods#`m9().`#*/) = ???/*=>scala.Predef.`???`().*/
+  def m10/*<=example.Methods#m10().*/(x/*<=example.Methods#m10().(x)*/: AList/*=>example.Methods#AList#*/[T/*=>example.Methods#[T]*/]) = ???/*=>scala.Predef.`???`().*/
+  def m11/*<=example.Methods#m11().*/(x/*<=example.Methods#m11().(x)*/: Predef/*=>scala.Predef.*/.type) = ???/*=>scala.Predef.`???`().*/
+  def m11/*<=example.Methods#m11(+1).*/(x/*<=example.Methods#m11(+1).(x)*/: Example/*=>example.Example.*/.type) = ???/*=>scala.Predef.`???`().*/
+  def m12a/*<=example.Methods#m12a().*/(x/*<=example.Methods#m12a().(x)*/: {}) = ???/*=>scala.Predef.`???`().*/
+  def m12b/*<=example.Methods#m12b().*/(x/*<=example.Methods#m12b().(x)*/: { val x/*<=local0*/: Int/*=>scala.Int#*/ }) = ???/*=>scala.Predef.`???`().*/
+  def m13/*<=example.Methods#m13().*/(x/*<=example.Methods#m13().(x)*/: Int/*=>scala.Int#*/ @unchecked) = ???/*=>scala.Predef.`???`().*/
+  def m14/*<=example.Methods#m14().*/(x/*<=example.Methods#m14().(x)*/: T/*=>local1*/ forSome { type T/*<=local1*/ }) = ???/*=>scala.Predef.`???`().*/
+  def m15/*<=example.Methods#m15().*/(x/*<=example.Methods#m15().(x)*/: => Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m16/*<=example.Methods#m16().*/(x/*<=example.Methods#m16().(x)*/: Int/*=>scala.Int#*/*) = ???/*=>scala.Predef.`???`().*/
+  object m17/*<=example.Methods#m17.*/ { def m/*<=example.Methods#m17.m().*/() = ???/*=>scala.Predef.`???`().*/ }
+  def m17/*<=example.Methods#m17().*/(a/*<=example.Methods#m17().(a)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m17/*<=example.Methods#m17(+1).*/(b/*<=example.Methods#m17(+1).(b)*/: String/*=>scala.Predef.String#*/) = ???/*=>scala.Predef.`???`().*/
+  val m18/*<=example.Methods#m18.*/ = m17/*=>example.Methods#m17.*/
+  def m18/*<=example.Methods#m18().*/(a/*<=example.Methods#m18().(a)*/: Int/*=>scala.Int#*/) = ???/*=>scala.Predef.`???`().*/
+  def m18/*<=example.Methods#m18(+1).*/(b/*<=example.Methods#m18(+1).(b)*/: String/*=>scala.Predef.String#*/) = ???/*=>scala.Predef.`???`().*/
+  def m19/*<=example.Methods#m19().*/(x/*<=example.Methods#m19().(x)*/: Int/*=>scala.Int#*/, y/*<=example.Methods#m19().(y)*/: Int/*=>scala.Int#*/ = 2)(z/*<=example.Methods#m19().(z)*/: Int/*=>scala.Int#*/ = 3) = ???/*=>scala.Predef.`???`().*/
+}
diff --git a/tests/jvm/src/test/resources/example/Synthetic.scala b/tests/jvm/src/test/resources/example/Synthetic_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Synthetic.scala
rename to tests/jvm/src/test/resources/example/Synthetic_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Synthetic_2.13.8.scala b/tests/jvm/src/test/resources/example/Synthetic_2.13.8.scala
new file mode 100644
index 000000000..4d640bf28
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Synthetic_2.13.8.scala
@@ -0,0 +1,47 @@
+package example
+
+class Synthetic/*<=example.Synthetic#*/ {
+  List/*=>scala.package.List.*/(1).map/*=>scala.collection.immutable.List#map().*/(_ +/*=>scala.Int#`+`(+4).*/ 2)
+  Array/*=>scala.Array.*/.empty/*=>scala.Array.empty().*/[Int/*=>scala.Int#*/].headOption/*=>scala.collection.ArrayOps#headOption().*/
+  "fooo".stripPrefix/*=>scala.collection.StringOps#stripPrefix().*/("o")
+
+  // See https://github.com/scalameta/scalameta/issues/977
+  val Name/*<=example.Synthetic#Name.*/ = "name:(.*)".r/*=>scala.collection.StringOps#r().*/
+  val x/*<=example.Synthetic#x.*/ #::/*=>scala.package.`#::`.*/ xs/*<=example.Synthetic#xs.*/ = Stream/*=>scala.package.Stream.*/(1, 2)
+  val Name/*=>example.Synthetic#Name.*/(name/*<=example.Synthetic#name.*/) = "name:foo"
+  1 #::/*=>scala.collection.immutable.Stream.Deferrer#`#::`().*/ 2 #::/*=>scala.collection.immutable.Stream.Deferrer#`#::`().*/ Stream/*=>scala.package.Stream.*/.empty/*=>scala.collection.immutable.Stream.empty().*/
+
+  val lst/*<=example.Synthetic#lst.*/ = 1 #::/*=>scala.collection.immutable.Stream.Deferrer#`#::`().*/ 2 #::/*=>scala.collection.immutable.Stream.Deferrer#`#::`().*/ Stream/*=>scala.package.Stream.*/.empty/*=>scala.collection.immutable.Stream.empty().*/
+  lst/*=>example.Synthetic#lst.*/ +/*=>scala.Predef.any2stringadd#`+`().*/ "foo"
+
+  for (x/*<=local3*/ <- 1 to/*=>scala.runtime.RichInt#to().*/ 10; y/*<=local4*/ <- 0 until/*=>scala.runtime.RichInt#until().*/ 10) println/*=>scala.Predef.println(+1).*/(x/*=>local3*/ ->/*=>scala.Predef.ArrowAssoc#`->`().*/ x/*=>local3*/)
+  for (i/*<=local5*/ <- 1 to/*=>scala.runtime.RichInt#to().*/ 10; j/*<=local6*/ <- 0 until/*=>scala.runtime.RichInt#until().*/ 10) yield (i/*=>local5*/, j/*=>local6*/)
+  for (i/*<=local7*/ <- 1 to/*=>scala.runtime.RichInt#to().*/ 10; j/*<=local8*/ <- 0 until/*=>scala.runtime.RichInt#until().*/ 10 if i/*=>local7*/ %/*=>scala.Int#`%`(+3).*/ 2 ==/*=>scala.Int#`==`(+3).*/ 0) yield (i/*=>local7*/, j/*=>local8*/)
+
+  object s/*<=example.Synthetic#s.*/ {
+    def apply/*<=example.Synthetic#s.apply().*/() = 2
+    s/*=>example.Synthetic#s.*/()
+    s/*=>example.Synthetic#s.*/.apply/*=>example.Synthetic#s.apply().*/()
+    case class Bar/*<=example.Synthetic#s.Bar#*/()
+    Bar/*=>example.Synthetic#s.Bar.*/()
+    null.asInstanceOf/*=>scala.Any#asInstanceOf().*/[Int/*=>scala.Int#*/ => Int/*=>scala.Int#*/](2)
+  }
+
+  class J/*<=example.Synthetic#J#*/[T/*<=example.Synthetic#J#[T]*/: Manifest/*=>scala.Predef.Manifest#*/] { val arr/*<=example.Synthetic#J#arr.*/ = Array/*=>scala.Array.*/.empty/*=>scala.Array.empty().*/[T/*=>example.Synthetic#J#[T]*/] }
+
+  class F/*<=example.Synthetic#F#*/
+  implicit val ordering/*<=example.Synthetic#ordering.*/: Ordering/*=>scala.package.Ordering#*/[F/*=>example.Synthetic#F#*/] = ???/*=>scala.Predef.`???`().*/
+  val f/*<=example.Synthetic#f.*/: Ordered/*=>scala.package.Ordered#*/[F/*=>example.Synthetic#F#*/] = new F/*=>example.Synthetic#F#*/
+
+  import scala.concurrent.ExecutionContext/*=>scala.concurrent.ExecutionContext.*/.Implicits/*=>scala.concurrent.ExecutionContext.Implicits.*/.global/*=>scala.concurrent.ExecutionContext.Implicits.global().*/
+  for {
+    a/*<=local9*/ <- scala.concurrent.Future/*=>scala.concurrent.Future.*/.successful/*=>scala.concurrent.Future.successful().*/(1)
+    b/*<=local10*/ <- scala.concurrent.Future/*=>scala.concurrent.Future.*/.successful/*=>scala.concurrent.Future.successful().*/(2)
+  } println/*=>scala.Predef.println(+1).*/(a/*=>local9*/)
+  for {
+    a/*<=local11*/ <- scala.concurrent.Future/*=>scala.concurrent.Future.*/.successful/*=>scala.concurrent.Future.successful().*/(1)
+    b/*<=local12*/ <- scala.concurrent.Future/*=>scala.concurrent.Future.*/.successful/*=>scala.concurrent.Future.successful().*/(2)
+    if a/*=>local11*/ </*=>scala.Int#`<`(+3).*/ b/*=>local12*/
+  } yield a/*=>local11*/
+
+}
diff --git a/tests/jvm/src/test/resources/example/Synthetic_2.13.scala b/tests/jvm/src/test/resources/example/Synthetic_2.13.scala
new file mode 100644
index 000000000..6d31795f4
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Synthetic_2.13.scala
@@ -0,0 +1,47 @@
+package example
+
+class Synthetic/*<=example.Synthetic#*/ {
+  List/*=>scala.package.List.*/(1).map/*=>scala.collection.immutable.List#map().*/(_ +/*=>scala.Int#`+`(+4).*/ 2)
+  Array/*=>scala.Array.*/.empty/*=>scala.Array.empty().*/[Int/*=>scala.Int#*/].headOption/*=>scala.collection.ArrayOps#headOption().*/
+  "fooo".stripPrefix/*=>scala.collection.StringOps#stripPrefix().*/("o")
+
+  // See https://github.com/scalameta/scalameta/issues/977
+  val Name/*<=example.Synthetic#Name.*/ = "name:(.*)".r/*=>scala.collection.StringOps#r().*/
+  val x/*<=example.Synthetic#x.*/ #::/*=>scala.package.`#::`.*/ xs/*<=example.Synthetic#xs.*/ = Stream/*=>scala.package.Stream.*/(1, 2)
+  val Name/*=>example.Synthetic#Name.*/(name/*<=example.Synthetic#name.*/) = "name:foo"
+  1 #::/*=>scala.collection.immutable.Stream.Deferrer#`#::`().*/ 2 #::/*=>scala.collection.immutable.Stream.Deferrer#`#::`().*/ Stream/*=>scala.package.Stream.*/.empty/*=>scala.collection.immutable.Stream.empty().*/
+
+  val lst/*<=example.Synthetic#lst.*/ = 1 #::/*=>scala.collection.immutable.Stream.Deferrer#`#::`().*/ 2 #::/*=>scala.collection.immutable.Stream.Deferrer#`#::`().*/ Stream/*=>scala.package.Stream.*/.empty/*=>scala.collection.immutable.Stream.empty().*/
+  lst/*=>example.Synthetic#lst.*/ +/*=>scala.Predef.any2stringadd#`+`().*/ "foo"
+
+  for (x/*<=local3*/ <- 1 to/*=>scala.runtime.RichInt#to().*/ 10; y/*<=local4*/ <- 0 until/*=>scala.runtime.RichInt#until().*/ 10) println/*=>scala.Predef.println(+1).*/(x/*=>local3*/ ->/*=>scala.Predef.ArrowAssoc#`->`().*/ x/*=>local3*/)
+  for (i/*<=local5*/ <- 1 to/*=>scala.runtime.RichInt#to().*/ 10; j/*<=local6*/ <- 0 until/*=>scala.runtime.RichInt#until().*/ 10) yield (i/*=>local5*/, j/*=>local6*/)
+  for (i/*<=local7*/ <- 1 to/*=>scala.runtime.RichInt#to().*/ 10; j/*<=local8*/ <- 0 until/*=>scala.runtime.RichInt#until().*/ 10 if i/*=>local7*/ %/*=>scala.Int#`%`(+3).*/ 2 ==/*=>scala.Int#`==`(+3).*/ 0) yield (i/*=>local7*/, j/*=>local8*/)
+
+  object s/*<=example.Synthetic#s.*/ {
+    def apply/*<=example.Synthetic#s.apply().*/() = 2
+    s/*=>example.Synthetic#s.*/()
+    s/*=>example.Synthetic#s.*/.apply/*=>example.Synthetic#s.apply().*/()
+    case class Bar/*<=example.Synthetic#s.Bar#*/()
+    Bar/*=>example.Synthetic#s.Bar.*/()
+    null.asInstanceOf/*=>scala.Any#asInstanceOf().*/[Int/*=>scala.Int#*/ => Int/*=>scala.Int#*/](2)
+  }
+
+  class J/*<=example.Synthetic#J#*/[T/*<=example.Synthetic#J#[T]*/: Manifest/*=>scala.AnyRef#*/] { val arr/*<=example.Synthetic#J#arr.*/ = Array/*=>scala.Array.*/.empty/*=>scala.Array.empty().*/[T/*=>example.Synthetic#J#[T]*/] }
+
+  class F/*<=example.Synthetic#F#*/
+  implicit val ordering/*<=example.Synthetic#ordering.*/: Ordering/*=>scala.package.Ordering#*/[F/*=>example.Synthetic#F#*/] = ???/*=>scala.Predef.`???`().*/
+  val f/*<=example.Synthetic#f.*/: Ordered/*=>scala.package.Ordered#*/[F/*=>example.Synthetic#F#*/] = new F/*=>example.Synthetic#F#*/
+
+  import scala.concurrent.ExecutionContext/*=>scala.concurrent.ExecutionContext.*/.Implicits/*=>scala.concurrent.ExecutionContext.Implicits.*/.global/*=>scala.concurrent.ExecutionContext.Implicits.global().*/
+  for {
+    a/*<=local9*/ <- scala.concurrent.Future/*=>scala.concurrent.Future.*/.successful/*=>scala.concurrent.Future.successful().*/(1)
+    b/*<=local10*/ <- scala.concurrent.Future/*=>scala.concurrent.Future.*/.successful/*=>scala.concurrent.Future.successful().*/(2)
+  } println/*=>scala.Predef.println(+1).*/(a/*=>local9*/)
+  for {
+    a/*<=local11*/ <- scala.concurrent.Future/*=>scala.concurrent.Future.*/.successful/*=>scala.concurrent.Future.successful().*/(1)
+    b/*<=local12*/ <- scala.concurrent.Future/*=>scala.concurrent.Future.*/.successful/*=>scala.concurrent.Future.successful().*/(2)
+    if a/*=>local11*/ </*=>scala.Int#`<`(+3).*/ b/*=>local12*/
+  } yield a/*=>local11*/
+
+}
diff --git a/tests/jvm/src/test/resources/example/Traits.scala b/tests/jvm/src/test/resources/example/Traits_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Traits.scala
rename to tests/jvm/src/test/resources/example/Traits_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Traits_2.13.scala b/tests/jvm/src/test/resources/example/Traits_2.13.scala
new file mode 100644
index 000000000..56218ca8e
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Traits_2.13.scala
@@ -0,0 +1,13 @@
+package traits
+
+trait T/*<=traits.T#*/ {
+  def x/*<=traits.T#x().*/ = 2
+}
+
+sealed trait U/*<=traits.U#*/
+object U/*<=traits.U.*/ {
+  def u/*<=traits.U.u().*/: U/*=>traits.U#*/ = new U/*=>traits.U#*/ /*=>java.lang.Object#`<init>`().*/{}
+}
+
+class C/*<=traits.C#*/
+trait V/*<=traits.V#*/ { self/*<=local1*/: C/*=>traits.C#*/ => }
diff --git a/tests/jvm/src/test/resources/example/Types.scala b/tests/jvm/src/test/resources/example/Types_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Types.scala
rename to tests/jvm/src/test/resources/example/Types_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Types_2.13.scala b/tests/jvm/src/test/resources/example/Types_2.13.scala
new file mode 100644
index 000000000..ae06c1dfb
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Types_2.13.scala
@@ -0,0 +1,122 @@
+package types
+
+import scala.language/*=>scala.language.*/.existentials/*=>scala.language.existentials.*/
+import scala.language/*=>scala.language.*/.higherKinds/*=>scala.language.higherKinds.*/
+
+class ann/*<=types.ann#*/[T/*<=types.ann#[T]*/](x/*<=types.ann#x.*/: T/*=>types.ann#[T]*/) extends scala.annotation.StaticAnnotation/*=>scala.annotation.StaticAnnotation#*/
+class ann1/*<=types.ann1#*/ extends scala.annotation.StaticAnnotation/*=>scala.annotation.StaticAnnotation#*/
+class ann2/*<=types.ann2#*/ extends scala.annotation.StaticAnnotation/*=>scala.annotation.StaticAnnotation#*/
+
+class B/*<=types.B#*/
+
+class C/*<=types.C#*/
+
+class P/*<=types.P#*/ {
+  class C/*<=types.P#C#*/
+  class X/*<=types.P#X#*/
+  val x/*<=types.P#x.*/ = new X/*=>types.P#X#*/
+}
+
+class T/*<=types.T#*/ {
+  class C/*<=types.T#C#*/
+  class X/*<=types.T#X#*/
+  val x/*<=types.T#x.*/ = new X/*=>types.T#X#*/
+}
+
+object Test/*<=types.Test.*/ {
+  class M/*<=types.Test.M#*/ {
+    def m/*<=types.Test.M#m().*/: Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/
+  }
+
+  trait N/*<=types.Test.N#*/ {
+    def n/*<=types.Test.N#n().*/: Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/
+  }
+
+  class C/*<=types.Test.C#*/ extends M/*=>types.Test.M#*/ {
+    val p/*<=types.Test.C#p.*/ = new P/*=>types.P#*/
+    val x/*<=types.Test.C#x.*/ = p/*=>types.Test.C#p.*/.x/*=>types.P#x.*/
+
+    val typeRef1/*<=types.Test.C#typeRef1.*/: C/*=>types.Test.C#*/ = ???/*=>scala.Predef.`???`().*/
+    val typeRef2/*<=types.Test.C#typeRef2.*/: p/*=>types.Test.C#p.*/.C/*=>types.P#C#*/ = ???/*=>scala.Predef.`???`().*/
+    val typeRef3/*<=types.Test.C#typeRef3.*/: T/*=>types.T#*/#C/*=>types.T#C#*/ = ???/*=>scala.Predef.`???`().*/
+    val typeRef4/*<=types.Test.C#typeRef4.*/: List/*=>scala.package.List#*/[Int/*=>scala.Int#*/] = ???/*=>scala.Predef.`???`().*/
+
+    val singleType1/*<=types.Test.C#singleType1.*/: x/*=>types.Test.C#x.*/.type = ???/*=>scala.Predef.`???`().*/
+    val singleType2/*<=types.Test.C#singleType2.*/: p/*=>types.Test.C#p.*/.x/*=>types.P#x.*/.type = ???/*=>scala.Predef.`???`().*/
+    val Either/*<=types.Test.C#Either.*/ = scala.util.Either/*=>scala.util.Either.*/
+
+    val thisType1/*<=types.Test.C#thisType1.*/: this.type = ???/*=>scala.Predef.`???`().*/
+    val thisType2/*<=types.Test.C#thisType2.*/: C/*=>types.Test.C#*/.this.type = ???/*=>scala.Predef.`???`().*/
+
+    val superType1/*<=types.Test.C#superType1.*/ = super.m/*=>types.Test.M#m().*/
+    val superType2/*<=types.Test.C#superType2.*/ = super[M/*=>types.Test.C#*/].m/*=>types.Test.M#m().*/
+    val superType3/*<=types.Test.C#superType3.*/ = C/*=>types.Test.C#*/.super[M/*=>types.Test.C#*/].m/*=>types.Test.M#m().*/
+
+    val compoundType1/*<=types.Test.C#compoundType1.*/: { def k/*<=local0*/: Int/*=>scala.Int#*/ } = ???/*=>scala.Predef.`???`().*/
+    val compoundType2/*<=types.Test.C#compoundType2.*/: M/*=>types.Test.M#*/ with N/*=>types.Test.N#*/ = ???/*=>scala.Predef.`???`().*/
+    val compoundType3/*<=types.Test.C#compoundType3.*/: M/*=>types.Test.M#*/ with N/*=>types.Test.N#*/ { def k/*<=local1*/: Int/*=>scala.Int#*/ } = ???/*=>scala.Predef.`???`().*/
+    val compoundType4/*<=types.Test.C#compoundType4.*/ = new /*<=local2*/{ def k/*<=local3*/: Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/ }
+    val compoundType5/*<=types.Test.C#compoundType5.*/ = new /*<=local4*/M/*=>types.Test.M#*/ with N/*=>types.Test.N#*/
+    val compoundType6/*<=types.Test.C#compoundType6.*/ = new M/*=>types.Test.M#*/ with N/*=>types.Test.N#*/ { def k/*<=local6*/: Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/ }
+
+    val annType1/*<=types.Test.C#annType1.*/: T/*=>types.T#*/ @ann/*=>types.ann#*/(42) = ???/*=>scala.Predef.`???`().*/
+    val annType2/*<=types.Test.C#annType2.*/: T/*=>types.T#*/ @ann1/*=>types.ann1#*/ @ann2/*=>types.ann2#*/ = ???/*=>scala.Predef.`???`().*/
+
+    val existentialType1/*<=types.Test.C#existentialType1.*/: T/*=>local7*/ forSome { type T/*<=local7*/ } = ???/*=>scala.Predef.`???`().*/
+    val existentialType2/*<=types.Test.C#existentialType2.*/: List/*=>scala.package.List#*/[_] = ???/*=>scala.Predef.`???`().*/
+    val existentialType3/*<=types.Test.C#existentialType3.*/ = Class/*=>java.lang.Class#*/.forName/*=>java.lang.Class#forName().*/("foo.Bar")
+    val existentialType4/*<=types.Test.C#existentialType4.*/ = Class/*=>java.lang.Class#*/.forName/*=>java.lang.Class#forName().*/("foo.Bar")
+
+    def typeLambda1/*<=types.Test.C#typeLambda1().*/[M/*<=types.Test.C#typeLambda1().[M]*/[_]] = ???/*=>scala.Predef.`???`().*/
+    typeLambda1/*=>types.Test.C#typeLambda1().*/[({ type L/*<=local11*/[T/*<=local12*/] = List/*=>scala.package.List#*/[T/*=>local12*/] })#L/*=>local11*/]
+
+    object ClassInfoType1/*<=types.Test.C#ClassInfoType1.*/
+    class ClassInfoType2/*<=types.Test.C#ClassInfoType2#*/ extends B/*=>types.B#*/ { def x/*<=types.Test.C#ClassInfoType2#x().*/ = 42 }
+    trait ClassInfoType3/*<=types.Test.C#ClassInfoType3#*/[T/*<=types.Test.C#ClassInfoType3#[T]*/]
+
+    object MethodType/*<=types.Test.C#MethodType.*/ {
+      def x1/*<=types.Test.C#MethodType.x1().*/: Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/
+      def x2/*<=types.Test.C#MethodType.x2().*/: Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/
+      def m3/*<=types.Test.C#MethodType.m3().*/: Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/
+      def m4/*<=types.Test.C#MethodType.m4().*/(): Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/
+      def m5/*<=types.Test.C#MethodType.m5().*/(x/*<=types.Test.C#MethodType.m5().(x)*/: Int/*=>scala.Int#*/): Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/
+      def m6/*<=types.Test.C#MethodType.m6().*/[T/*<=types.Test.C#MethodType.m6().[T]*/](x/*<=types.Test.C#MethodType.m6().(x)*/: T/*=>types.Test.C#MethodType.m6().[T]*/): T/*=>types.Test.C#MethodType.m6().[T]*/ = ???/*=>scala.Predef.`???`().*/
+    }
+
+    object ByNameType/*<=types.Test.C#ByNameType.*/ {
+      def m1/*<=types.Test.C#ByNameType.m1().*/(x/*<=types.Test.C#ByNameType.m1().(x)*/: => Int/*=>scala.Int#*/): Int/*=>scala.Int#*/ = ???/*=>scala.Predef.`???`().*/
+    }
+
+    case class RepeatedType/*<=types.Test.C#RepeatedType#*/(s/*<=types.Test.C#RepeatedType#s.*/: String/*=>java.lang.String#*/*) {
+      def m1/*<=types.Test.C#RepeatedType#m1().*/(x/*<=types.Test.C#RepeatedType#m1().(x)*/: Int/*=>scala.Int#*/*): Int/*=>scala.Int#*/ = s/*=>types.Test.C#RepeatedType#s.*/.length/*=>scala.collection.SeqOps#length().*/
+    }
+
+    object TypeType/*<=types.Test.C#TypeType.*/ {
+      type T1/*<=types.Test.C#TypeType.T1#*/
+      def m2/*<=types.Test.C#TypeType.m2().*/[T2/*<=types.Test.C#TypeType.m2().[T2]*/ >: C/*=>types.Test.C#*/ <: C/*=>types.Test.C#*/] = ???/*=>scala.Predef.`???`().*/
+      def m3/*<=types.Test.C#TypeType.m3().*/[M3/*<=types.Test.C#TypeType.m3().[M3]*/[_]] = ???/*=>scala.Predef.`???`().*/
+      type T4/*<=types.Test.C#TypeType.T4#*/ = C/*=>types.Test.C#*/
+      type T5/*<=types.Test.C#TypeType.T5#*/[U/*<=types.Test.C#TypeType.T5#[U]*/] = U/*=>types.Test.C#TypeType.T5#[U]*/
+    }
+  }
+
+  object Literal/*<=types.Test.Literal.*/ {
+    final val int/*<=types.Test.Literal.int.*/ = 1
+    final val long/*<=types.Test.Literal.long.*/ = 1L
+    final val float/*<=types.Test.Literal.float.*/ = 1f
+    final val double/*<=types.Test.Literal.double.*/ = 2d
+    final val nil/*<=types.Test.Literal.nil.*/ = null
+    final val char/*<=types.Test.Literal.char.*/ = 'a'
+    final val string/*<=types.Test.Literal.string.*/ = "a"
+    final val bool/*<=types.Test.Literal.bool.*/ = true
+    final val unit/*<=types.Test.Literal.unit.*/ = ()
+    final val javaEnum/*<=types.Test.Literal.javaEnum.*/ = java.nio.file.LinkOption/*=>java.nio.file.LinkOption#*/.NOFOLLOW_LINKS/*=>java.nio.file.LinkOption#NOFOLLOW_LINKS.*/
+    final val clazzOfInt/*<=types.Test.Literal.clazzOfInt.*/ = classOf/*=>scala.Predef.classOf().*/[Int/*=>scala.Int#*/]
+
+    final val clazzOfOption/*<=types.Test.Literal.clazzOfOption.*/ = classOf/*=>scala.Predef.classOf().*/[Option[Int]]
+
+    final val clazzOfJStr/*<=types.Test.Literal.clazzOfJStr.*/ = classOf/*=>scala.Predef.classOf().*/[java.lang.String/*=>java.lang.String#*/]
+    final val clazzOfM/*<=types.Test.Literal.clazzOfM.*/ = classOf/*=>scala.Predef.classOf().*/[M/*=>types.Test.M#*/]
+    final val clazzOfTRef/*<=types.Test.Literal.clazzOfTRef.*/ = classOf/*=>scala.Predef.classOf().*/[T#C/*=>types.T#C#*/]
+  }
+}
diff --git a/tests/jvm/src/test/resources/example/Vararg.scala b/tests/jvm/src/test/resources/example/Vararg_2.12.scala
similarity index 100%
rename from tests/jvm/src/test/resources/example/Vararg.scala
rename to tests/jvm/src/test/resources/example/Vararg_2.12.scala
diff --git a/tests/jvm/src/test/resources/example/Vararg_2.13.scala b/tests/jvm/src/test/resources/example/Vararg_2.13.scala
new file mode 100644
index 000000000..0eafc1c2d
--- /dev/null
+++ b/tests/jvm/src/test/resources/example/Vararg_2.13.scala
@@ -0,0 +1,6 @@
+package example
+
+class Vararg/*<=example.Vararg#*/ {
+  def add1/*<=example.Vararg#add1().*/(a/*<=example.Vararg#add1().(a)*/: Int/*=>scala.Int#*/*) = {}
+  def add2/*<=example.Vararg#add2().*/(a/*<=example.Vararg#add2().(a)*/: Seq/*=>scala.collection.immutable.Seq#*/[Int/*=>scala.Int#*/]*): Unit/*=>scala.Unit#*/ = {}
+}
diff --git a/tests/jvm/src/test/scala/scala/meta/tests/Utils.scala b/tests/jvm/src/test/scala/scala/meta/tests/Utils.scala
index 87549e497..21facf71e 100644
--- a/tests/jvm/src/test/scala/scala/meta/tests/Utils.scala
+++ b/tests/jvm/src/test/scala/scala/meta/tests/Utils.scala
@@ -1,6 +1,7 @@
 package scala.meta.tests
 
 import java.nio.file.{Path, Paths}
+import scala.annotation.tailrec
 import scala.meta.io.AbsolutePath
 
 object Utils {
@@ -11,4 +12,13 @@ object Utils {
   def getAbsResourceOpt(file: String): Option[AbsolutePath] =
     getResourceOpt(file).map(AbsolutePath.apply).filter(_.isFile)
 
+  @tailrec
+  def getFirstAbsResourceOpt(files: String*): Option[AbsolutePath] =
+    files match {
+      case head +: tail =>
+        val res = getAbsResourceOpt(head)
+        if (res.isEmpty) getFirstAbsResourceOpt(tail: _*) else res
+      case _ => None
+    }
+
 }
diff --git a/tests/jvm/src/test/scala/scala/meta/tests/semanticdb/OccurrenceSuite.scala b/tests/jvm/src/test/scala/scala/meta/tests/semanticdb/OccurrenceSuite.scala
index f4bf54e7a..d85be7a1e 100644
--- a/tests/jvm/src/test/scala/scala/meta/tests/semanticdb/OccurrenceSuite.scala
+++ b/tests/jvm/src/test/scala/scala/meta/tests/semanticdb/OccurrenceSuite.scala
@@ -2,7 +2,6 @@ package scala.meta.tests.semanticdb
 
 import java.nio.charset.StandardCharsets
 import java.nio.file.Files
-import java.nio.file.Paths
 import munit.FunSuite
 import scala.meta.inputs.Input
 import scala.meta.inputs.Position
@@ -31,7 +30,7 @@ class OccurrenceSuite extends FunSuite {
     assertNoDiff(body.obtained, expectedCompat)
   }
 
-  ScalaVersion.doIf("OccurrenceSuite", ScalaVersion.is212) {
+  ScalaVersion.doIf("OccurrenceSuite", ScalaVersion.is212 || ScalaVersion.is213) {
     OccurrenceSuite.testCases.foreach { t =>
       test(t.name) {
         t.body.fold(fail(_), testBody)
@@ -62,8 +61,15 @@ object OccurrenceSuite {
       if PathIO.extension(source.toNIO) == "scala"
       if !isExcluded(source)
       relpath = source.toRelative(absdir)
-      expectpathOpt = Utils.getAbsResourceOpt(relpath.toString)
     } yield {
+      val relpathstr = relpath.toString
+      val relpathnoext = relpathstr.stripSuffix(".scala")
+      def forVer(version: String) = relpathnoext + "_" + version + ".scala"
+      val expectpathOpt = Utils.getFirstAbsResourceOpt(
+        forVer(BuildInfo.scalaVersion),
+        forVer(BuildInfo.scalaBinaryVersion),
+        relpathstr
+      )
       new TestCase(relpath.toURI(false).toString)(
         expectpathOpt.toRight("// missing expect file\n").right.map { expectpath =>
           val semanticdb = SemanticdbPaths.toSemanticdb(source.toRelative(sourceroot), targetroot)
diff --git a/tests/shared/src/test/scala-2.13/scala/meta/tests/tokenizers/TokensPositionSuite.scala b/tests/shared/src/test/scala-2.13/scala/meta/tests/tokenizers/TokensPositionSuite.scala
index 67c3d4e41..613ea86fd 100644
--- a/tests/shared/src/test/scala-2.13/scala/meta/tests/tokenizers/TokensPositionSuite.scala
+++ b/tests/shared/src/test/scala-2.13/scala/meta/tests/tokenizers/TokensPositionSuite.scala
@@ -646,7 +646,7 @@ class TokensPositionSuite extends BasePositionSuite(dialects.Scala213) {
     """|Type.ParamClause trait A @@{ self: B => }
        |Ctor.Primary trait A @@{ self: B => }
        |Template { self: B => }
-       |Self self: B
+       |Self self: B =>
        |""".stripMargin
   )
   checkPositions[Stat](
@@ -654,7 +654,7 @@ class TokensPositionSuite extends BasePositionSuite(dialects.Scala213) {
     """|Type.ParamClause trait A @@{ _: B => }
        |Ctor.Primary trait A @@{ _: B => }
        |Template { _: B => }
-       |Self _: B
+       |Self _: B =>
        |""".stripMargin
   )
   checkPositions[Stat](
@@ -662,7 +662,7 @@ class TokensPositionSuite extends BasePositionSuite(dialects.Scala213) {
     """|Type.ParamClause trait A @@{ self => }
        |Ctor.Primary trait A @@{ self => }
        |Template { self => }
-       |Self self
+       |Self self =>
        |""".stripMargin
   )
   checkPositions[Stat](
@@ -670,7 +670,7 @@ class TokensPositionSuite extends BasePositionSuite(dialects.Scala213) {
     """|Type.ParamClause trait A @@{ this: B => }
        |Ctor.Primary trait A @@{ this: B => }
        |Template { this: B => }
-       |Self this: B
+       |Self this: B =>
        |""".stripMargin
   )
 
@@ -723,7 +723,7 @@ class TokensPositionSuite extends BasePositionSuite(dialects.Scala213) {
        |
        |  def foo: Boolean = true
        |}
-       |Self self: X with B with C
+       |Self self: X with B with C =>
        |Type.With X with B with C
        |Type.With X with B
        |Defn.Def def foo: Boolean = true
@@ -745,7 +745,7 @@ class TokensPositionSuite extends BasePositionSuite(dialects.Scala213) {
        |  def foo: Boolean = true // c2
        |  // c3
        |}
-       |Self self: X with B with C
+       |Self self: X with B with C =>
        |Type.With X with B with C
        |Type.With X with B
        |Defn.Def def foo: Boolean = true
diff --git a/tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/FewerBracesSuite.scala b/tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/FewerBracesSuite.scala
index a6a3da46a..44ac7a7a9 100644
--- a/tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/FewerBracesSuite.scala
+++ b/tests/shared/src/test/scala/scala/meta/tests/parsers/dotty/FewerBracesSuite.scala
@@ -682,4 +682,31 @@ class FewerBracesSuite extends BaseDottySuite {
     )
   }
 
+  test("#3296") {
+    val code =
+      """object MyApp:
+        |
+        |  def test(str: String)(block: => Boolean): Unit =
+        |    println(str + " : " + block)
+        |
+        |  test("First test"):
+        |    case class Foo(x: Int, y: String)
+        |    1 == 1
+        |
+        |  test("Second test"):
+        |    1 == 1
+        |""".stripMargin
+    val layout =
+      """|object MyApp {
+         |  def test(str: String)(block: => Boolean): Unit = println(str + " : " + block)
+         |  test("First test") {
+         |    case class Foo(x: Int, y: String)
+         |    1 == 1
+         |  }
+         |  test("Second test")(1 == 1)
+         |}
+         |""".stripMargin
+    assertNoDiff(parseStat(code, dialect).reprint, layout)
+  }
+
 }