Scala 2.13.12 release planning

This thread is for updates and discussions about the upcoming Scala 2.13.12 release.

As of yet, we don’t know much about the release’s likely timing or contents…

…except that we will address the regressions mentioned in the 2.13.11 release notes:

  • Exhaustivity checker emits spurious warning when matching on Java enum type (2.13.11 regression) (scala/bug#12800)
  • Duplicated @Deprecated annotations when extending Java interface with deprecated default method cause java.lang.annotation.AnnotationFormatError when accessed via Java reflection (2.13.11 regression) (scala/bug#12799)

We can use this thread to ask, propose, discuss.

3 Likes

A few weeks have passed, and 2.13.11 seems to be a solid release. We have resumed actively merging PRs.

There’s no big rush to do the next release, but we would like to ship fixes for the small regressions, and we’d also like to ship the work on actionable diagnostics that’s happening at Implement CodeAction (actionable diagnostic) by eed3si9n · Pull Request #10406 · scala/scala · GitHub .

So for 2.13.12 timing, we’re currently thinking August sometime.

3 Likes

Releasing later this month still seems plausible.

The most significant pending changes include:

The most significant already-merged changes include:

3 Likes

Lukas’s PR to in-source the sbt compiler bridge is now merged.

If anybody (build tool maintainers?) wants to test a published bridge (please do, before 2.13.12 is released!), there’s one here:

https://scala-ci.typesafe.com/artifactory/scala-integration/org/scala-lang/scala2-sbt-bridge/2.13.12-bin-86f40c2/

Once 2.13.12 proper is out, its bridge will be on Maven Central, of course.

1 Like

Added support with a test for it in improvement: Correctly download Scala 2 bridge for Scala 2.13.12 by tgodzik · Pull Request #2133 · scalacenter/bloop · GitHub

I will try to release soon after so that we are ready for the new release :smiley:

Also, will add that to the Scala CLI fork.

3 Likes

We have closed the 2.13.12 milestones. The release candidate is 2.13.12-bin-49d5507.

To test, you can scala-cli -S 2.nightly, or see these instructions.

The community build is running.

Draft release notes: Scala 2.13.12 release notes draft by SethTisue · Pull Request #850 · scala/scala-dev · GitHub

Feedback welcome — no suggestion too small.

2 Likes

I was able to build the Scala Plugin for IntelliJ IDEA using Scala 2.13.12-bin-49d5507 confirming that Exhaustivity checker emits spurious warning when matching on Java enum type (2.13.11 regression) · Issue #12800 · scala/bug · GitHub has been correctly fixed.

It also most likely seems that the latest compiler-bridge sources in the Zinc repository can be successfully compiled for Scala 2.13.12 on the fly. I will open a separate discussion for this, to clarify some points.

Thanks! Looking forward to the final release.

5 Likes

The RC is all good for Scala.js v1.13.2.

1 Like

Scalameta seems good to go, I made a WiP PR here: chore: Update scalameta to most recent release candidate by tgodzik · Pull Request #3323 · scalameta/scalameta · GitHub

Also tested Metals and mdoc, where aside from some minor changes to the tests everything looks good!

2 Likes

As for timing…

Assuming all goes well, I’m suggesting we publish to Maven Central on Wed Sep 6 and then announce on Mon Sep 11, just before Scala Days.

We merged some more PRs for 2.13.12, all of them involving further refining the warnings and errors changes in the release:

Hopefully this has now settled down. The new RC is 2.13.12-bin-f7e30a6. The community build is already green. Let’s keep the same target dates: publish to Maven Central on Wed Sep 6, announce on Mon Sep 11 (just before Scala Days).

3 Likes

We’re now seeing more method isAnnotationType in trait Play2TemplateWrapperBase defined without a parameter list overrides method isAnnotationType in class ScTypeDefinitionImpl defined with a single empty parameter list type of warnings/errors than in the previous RC. Is this expected?

The warnings seem a bit strange. It seems like there are warnings issued across sbt subprojects, but not in the same subproject.

Java dependency:

interface BaseInterface {
  boolean someMethod();
}

In subproject a:

trait BaseTrait extends BaseInterface {
  override def someMethod: Boolean = false
}

class AClass extends BaseTrait {
  override def someMethod: Boolean = true // no warning issued
}

In subproject b, which depends on a:

class BClass extends BaseTrait {
  // there is no override here
  // warning issued (defined without a parameter list overrides method with single empty parameter list
}

I’m typing this without trying it in a separate small reproduction project, just observation from a large one. I will try to open a ticket with a small reproduction tomorrow.

There is a new warning for this case: https://github.com/scala/scala/pull/10520#issuecomment-1697686348.

Your example should not warn as the mismatch is between Java and Scala, and it doesn’t warn in my testing (compiling the Java interface first, then the first Scala file, then the second).

Can you double-check all isAnnotationType methods defined in Scala are consistent?

The error in sbt is the following (copy pasted verbatim):

[error] /Users/vasil/Code/scala-plugin-for-ultimate/play/src/com/intellij/scala/play/language/psi/light/Play2ObjectWrapper.scala:26:13: method isAnnotationType in trait Play2TemplateWrapperBase defined without a parameter list overrides method isAnnotationType in class ScTypeDefinitionImpl defined with a single empty parameter list
[error] final class Play2ObjectWrapper private[language](stub: ScTemplateDefinitionStub[ScObject],

The definition of Play2ObjectWrapper is the following (unfortunately, this is a closed source module, so I have to copy paste it).

final class Play2ObjectWrapper private[language](stub: ScTemplateDefinitionStub[ScObject],
                                                 nodeType: ScTemplateDefinitionElementType[ScObject],
                                                 node: ASTNode,
                                                 debugName: String)
  extends ScObjectImpl(stub, nodeType, node, debugName)
    with ScDeclarationSequenceHolder
    with Play2TemplateImportHolder
    with Play2TemplateWrapperBase[ScObject] { ... }
trait Play2TemplateWrapperBase[T <: ScTemplateDefinition] extends ScalaPsiElement { self: ScTypeDefinitionImpl[T] =>
  override def isAnnotationType = false
}

The chain of overrides then continues here:

Then here:

And then finally, we arrive at the definition:

Worth noting is that Play2ObjectWrapper and Play2TemplateWrapperBase (let’s call it play2) are defined in a separate sbt subproject, while ScTypeDefinitionImpl and PsiClassFake are defined in another (let’s call it scala-impl). play2 depends on scala-impl.

ScTypeDefinitionImpl is an abstract class. In the same subproject, there is a another concrete class ScClassImpl, and no warnings are issued for this one. There are others as well, this is just an example.

Maybe the following is happening:

interface A {
  int someNumber();
}
trait B extends A {
  override def someNumber: Int = 1
}

abstract class C extends B {
  override def someNumber: Int = 2
}

trait D extends B { self: C =>
  override def someNumber: Int = 3
}

class E extends C with D // Warning issued

Edit: For the record, this does not issue the warning, I’m just brainstorming.

1 Like

This is just a PSA for :paste -java in forthcoming REPL. Here is its modest debut:

➜  skala -Xlint -nobootcp
Welcome to Scala 2.13.12-20230830-200406-f7e30a6 (OpenJDK 64-Bit Server VM, Java 20.0.1).
Type in expressions for evaluation. Or try :help.

scala> :paste -java
// Entering paste mode (ctrl-D to finish)

package p;
public interface A {
  int someNumber();
}


// Exiting paste mode, now interpreting.


scala> trait B extends p.A { override def someNumber: Int = 1 }
trait B

scala> abstract class C extends B { override def someNumber: Int = 2 }
class C

scala> trait D extends B { self: C => override def someNumber: Int = 3 }
trait D

scala> class E extends C with D
class E

In some context, I recently considered that override is permitted but not required when a self-type is present. Here, Y is not an X, and the warning is for the mixin.

scala> class X { def f() = 42 }
class X

scala> trait Y { _: X => override def f = 27 }
trait Y

scala> class Z extends X with Y
             ^
       warning: method f in trait Y defined without a parameter list overrides method f in class X defined with a single empty parameter list
class Z

There are two code paths that lead to the “method … without a parameter list overrides … method … with a single empty” warning. Could you maybe attach a debugger to sbt and set a breakpoint in def warnAdaptedNullaryOverride? That would at least tell us if we get there through the NullaryOverrideAdapted attachment or the new code path (most likely). And if you poke around maybe you can find some hints why ScTypeDefinitionImpl.isAnnotationType has an empty parameter list, even though it’s defined without?

Just a small update message.

Lukas and I talked on Discord, he managed to reproduce the warnings that we’re seeing in the Scala Plugin for IntelliJ codebase and he’s investigating.

Sorry for hijacking this discussion.

Thanks again.

2 Likes

Pull request with a fix https://github.com/scala/scala/pull/10524

2 Likes