diff --git a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala index 075ea2423f86..4e544718645b 100644 --- a/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala +++ b/compiler/src/dotty/tools/dotc/config/ScalaSettings.scala @@ -37,7 +37,8 @@ object ScalaSettings: ScalaRelease.values.toList.map(_.show) def supportedSourceVersions: List[String] = - SourceVersion.values.toList.map(_.toString) + SourceVersion.values.diff(SourceVersion.illegalInSettings) + .map(_.toString).toList def defaultClasspath: String = sys.env.getOrElse("CLASSPATH", ".") diff --git a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala index 75fcaaf544a3..0ebe67834b36 100644 --- a/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala +++ b/compiler/src/dotty/tools/dotc/core/tasty/TreePickler.scala @@ -630,8 +630,13 @@ class TreePickler(pickler: TastyPickler) { case tree: TypeTree => pickleType(tree.tpe) case SingletonTypeTree(ref) => - writeByte(SINGLETONtpt) - pickleTree(ref) + val tp = ref.tpe + val tp1 = tp.deskolemized + if tp1 ne tp then + pickleType(tp1) + else + writeByte(SINGLETONtpt) + pickleTree(ref) case RefinedTypeTree(parent, refinements) => if (refinements.isEmpty) pickleTree(parent) else { diff --git a/tests/neg/indentRight.scala b/tests/neg/indentRight.scala index 8eb9deb23389..e76c83a02c23 100644 --- a/tests/neg/indentRight.scala +++ b/tests/neg/indentRight.scala @@ -24,8 +24,8 @@ object Test { } trait A - case class B() extends A // error: Line is indented too far to the right - case object C extends A // error: Line is indented too far to the right + case class B() extends A + case object C extends A if (true) // OK println("hi") diff --git a/tests/pos/i23194.scala b/tests/pos/i23194.scala new file mode 100644 index 000000000000..347b98efd877 --- /dev/null +++ b/tests/pos/i23194.scala @@ -0,0 +1,14 @@ +class R[T] extends annotation.StaticAnnotation + +class A[T]: + val next: A[T] = null + val self: this.type = this + val selfnext: this.next.type = this.next + def f: (A[T] @R[this.type], A[T] @R[this.next.type]) = ??? + def g: (A[T] @R[self.type], A[T] @R[selfnext.type]) = ??? + +class Test: + def test = + val (a, b) = A[String]().f + val (a2, b2) = A[String]().g + \ No newline at end of file