scala / scala-dev

Scala 2 team issues. Not for user-facing bugs or directly actionable user-facing improvements. For build/test/infra and for longer-term planning and idea tracking. Our bug tracker is at https://github.com/scala/bug/issues
Apache License 2.0
130 stars 15 forks source link

Scala 2.13.12 release notes draft #850

Closed SethTisue closed 10 months ago

SethTisue commented 11 months ago

rendered

feedback encouraged

no suggestion too small

let's make this as clear and helpful as it can be

som-snytt commented 11 months ago

As there is no nit too picky, the git query does not account for co-authorship, which I believe counts for unit contribution and not 0.5. This more correct accounting vaults Georgi in front of Nicolas, in alphabetical suborder.

Lukas also shares a co-authorship credit, but it seems a couple of his PRs are sponsored, so I'm not sure how that adds up. I think it means Lukas takes every one out for biers?

SethTisue commented 11 months ago

the git query does not account for co-authorship

@som-snytt hmm... yeah, that's not ideal. I would use a more correct automated method if one existed, but I don't think I'm sufficiently motivated to build one myself.

SethTisue commented 10 months ago

this is now live at https://github.com/scala/scala/releases/tag/v2.13.12

It's not too late to make further edits — feel free to continue commenting here.

som-snytt commented 10 months ago

per discussion on discord chat, perhaps the item on scala3-migration noise deserves a note that changes in behavior were made noisier, and that it's expected to -Wconf:cat=scala3-migration:s in some form.

My first comment was that for override inference, Scala 3 style is desirable, but is not backward-compatible. The user should be aware of the difference; the desirable action is to make the old inferred type explicit (for compatibility) or adjust the warning, if the new behavior is acceptable.

scala 2.13.12> trait T { def f: Option[Int] }
trait T

scala 2.13.12> class C extends T { def f = None }
                                       ^
               error: under -Xsource:3, inferred Option[Int] instead of None.type [quickfixable]
               Scala 3 migration messages are errors under -Xsource:3. Use -Wconf / @nowarn to filter them or add -Xmigration to demote them to warnings.
               Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=scala3-migration, site=C.f

scala 2.13.12> :replay -Wconf:cat=scala3-migration:w
replay> trait T { def f: Option[Int] }
trait T

scala 2.13.12> class C extends T { def f = None }
                                       ^
               warning: under -Xsource:3, inferred Option[Int] instead of None.type [quickfixable]
class C

The other example in chat was the access modifiers on case class methods when the constructor is private.

scala 2.13.12> case class C private (c: String)
                          ^
               error: constructor modifiers are assumed by synthetic `copy` method
               Scala 3 migration messages are errors under -Xsource:3. Use -Wconf / @nowarn to filter them or add -Xmigration to demote them to warnings.
               Applicable -Wconf / @nowarn filters for this fatal warning: msg=<part of the message>, cat=scala3-migration, site=C

scala 2.13.12> :replay -Wconf:cat=scala3-migration:w
Nothing to replay.

scala 2.13.12> case class C private (c: String)
                          ^
               warning: constructor modifiers are assumed by synthetic `copy` method
                          ^
               warning: constructor modifiers are assumed by synthetic `apply` method
class C

If it's desirable to keep the old access, it would be necessary to write the methods by hand.

It would be nice to have these use cases in the release notes.

Example -Xsource:3 which does not make noise:

scala 2.13.12> import collection.*
import collection._
SethTisue commented 10 months ago

@som-snytt maybe you and I could work together (not this week) on documenting -Xsource:3 properly. maybe with three lists: enabled behaviors, modified behaviors, disabled/discouraged/deprecated behaviors... something like that. and a good introductory text that explains what the flag is and why, and include any useful usage advice about -Xmigration and -Wconf and so on.

In the meantime, though, if you have any suggested edits to the release notes themselves, feel free to go ahead and make them. but let's not add too much. or if we do find we've added too much, let's have a goal of moving it to a more permanent location.

SethTisue commented 10 months ago

@som-snytt oh, I guess the broader topic of documenting -Xsource:3 should continue on https://github.com/scala/scala-dev/issues/470

SethTisue commented 10 months ago

@som-snytt the release notes now have:

I remain interested in properly documenting -Xsource:3 (but not this week or next).