Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix 3.3.3 #19818

Merged
merged 5 commits into from
Feb 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
164 changes: 164 additions & 0 deletions changelogs/3.3.3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,164 @@
# HOTFIX 3.3.3

This is a hotfix release to [a subtle bug](https://github.com/playframework/playframework/issues/12418) in the TASTy reader managed to survive the Release Candidate (RC) process. The bug caused 3.3.2 to emit TASTy files incompatible with previous releases in the LTS line, namely 3.3.1 and 3.3.0.

Below you can find the original release notes for 3.3.2:

# Highlights of the release

- Improvements to the Coverage (detailed list below)
- Add Stable Presentation Compiler [#17528](https://github.com/lampepfl/dotty/pull/17528)

# Other changes and fixes

## Backend

- Make sure synthetic apply methods are generated in deterministic order [#18210](https://github.com/lampepfl/dotty/pull/18210)

## Coverage

- Only lift inner expressions when lifting repeated `Typed` arguments [#18424](https://github.com/lampepfl/dotty/pull/18424)
- Fix: scoverage statement's line number should be 1-base [#18932](https://github.com/lampepfl/dotty/pull/18932)
- Do not lift applications of context functions [#18498](https://github.com/lampepfl/dotty/pull/18498)
- Don't lift the argument of a `synchronized` block in scoverage [#16941](https://github.com/lampepfl/dotty/pull/16941)
- Fix the issue with coverage inside of a TypeApply [#18420](https://github.com/lampepfl/dotty/pull/18420)
- Coverage: mark case bodies as branches; don't ignore branches with synthetic spans [#18437](https://github.com/lampepfl/dotty/pull/18437)

## Documentation

- Compiler plugin Scaladoc: document phase requirement [#18394](https://github.com/lampepfl/dotty/pull/18394)

## Exports

- Refine override exclude criterion for export forwarders [#17590](https://github.com/lampepfl/dotty/pull/17590)

## Incremental Compilation

- Fix overcompilation due to unstable context bound desugaring [#18280](https://github.com/lampepfl/dotty/pull/18280)

## Inline

- Don't generate a super accessor for an inline method call [#17598](https://github.com/lampepfl/dotty/pull/17598)

## Linting

- Wunused: Only use type treverser for checking refinements in refined type trees [#17929](https://github.com/lampepfl/dotty/pull/17929)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "treverser" should probably be "traverser"


## Parser

- Add examples taken from reference page [#18066](https://github.com/lampepfl/dotty/pull/18066)
- Test for #18345 [#18349](https://github.com/lampepfl/dotty/pull/18349)

## Pattern Matching

- Properly refine type of inlined unapply pattern [#18292](https://github.com/lampepfl/dotty/pull/18292)

## Presentation Compiler

- Bugfix: suggest correct arg name completions for lambda expressions [#18379](https://github.com/lampepfl/dotty/pull/18379)
- Improvement: print better bracket suffix in completion item label [#18380](https://github.com/lampepfl/dotty/pull/18380)
- Fix presentation compiler autoimports, update presentation compiler dependencies [#18264](https://github.com/lampepfl/dotty/pull/18264)
- Update scala3-presentation-compiler to 39e349e [#18296](https://github.com/lampepfl/dotty/pull/18296)
- Update presentation compiler with changes from PR 5287 [#18301](https://github.com/lampepfl/dotty/pull/18301)
- Update presentation compiler to a829a6a [#18347](https://github.com/lampepfl/dotty/pull/18347)
- Bugfix: highlight enum cases correctly [#18362](https://github.com/lampepfl/dotty/pull/18362)

## Quotes

- Do not beta-reduce/eta-expand pattern splices with contextual function types [#18198](https://github.com/lampepfl/dotty/pull/18198)
- XcheckMacro types of Block expression and Apply/TypeApply function [#18242](https://github.com/lampepfl/dotty/pull/18242)
- Fix owner of splices in class statements [#18359](https://github.com/lampepfl/dotty/pull/18359)
- Handle macro dependencies through class of `this` [#18396](https://github.com/lampepfl/dotty/pull/18396)
- Add missing span in `QuoteMatcher` [#18178](https://github.com/lampepfl/dotty/pull/18178)
- Fix stale symbol crashes in some path depended types in macro contexts [#18077](https://github.com/lampepfl/dotty/pull/18077)
- Simplify avoidance of local types of Hole [#17571](https://github.com/lampepfl/dotty/pull/17571)

## Reporting

- Detail "not a constant type" message [#17626](https://github.com/lampepfl/dotty/pull/17626)
- Suggest imports for the expected type of the underlying implicit not found error [#17976](https://github.com/lampepfl/dotty/pull/17976)
- Fix: report correct location on a repeat modifier [#17982](https://github.com/lampepfl/dotty/pull/17982)
- Warn when calling synchronized on AnyVal [#18021](https://github.com/lampepfl/dotty/pull/18021)
- Fix compile error message in wildcard exports [#18189](https://github.com/lampepfl/dotty/pull/18189)
- Improve parameter type inference error messaging [#18190](https://github.com/lampepfl/dotty/pull/18190)
- Don't report warnings in migration when performing rewrites [#15589](https://github.com/lampepfl/dotty/pull/15589)
- Fix crash reporter, units and phases [#17754](https://github.com/lampepfl/dotty/pull/17754)
- Omit more prefixes in non-package module printing [#17758](https://github.com/lampepfl/dotty/pull/17758)
- Fix pretty printer to handle using and erased modifier [#17952](https://github.com/lampepfl/dotty/pull/17952)
- Add -Yprint-tasty compiler flag [#17986](https://github.com/lampepfl/dotty/pull/17986)
- Add actionable item to PatternMatchExhaustivity diagnostic [#18314](https://github.com/lampepfl/dotty/pull/18314)

## Scaladoc

- Fix: -no-link-warnings does not work [#17028](https://github.com/lampepfl/dotty/pull/17028)
- Fix: Validation for API link [#17099](https://github.com/lampepfl/dotty/pull/17099)
- Scaladoc: type rendering fixes and improvements [#17213](https://github.com/lampepfl/dotty/pull/17213)
- Feat: Add a custom icon [#17241](https://github.com/lampepfl/dotty/pull/17241)
- Fix: Correction of the siteRoot path [#17297](https://github.com/lampepfl/dotty/pull/17297)
- Fix: Correct the navigation to anchor [#17910](https://github.com/lampepfl/dotty/pull/17910)
- Fix: Style for wiki syntax [#18079](https://github.com/lampepfl/dotty/pull/18079)
- Fix NoSuchElementException in scaladoc [#18184](https://github.com/lampepfl/dotty/pull/18184)
- Update jsoup dependency of Scaladoc to 7.2 [#19584](https://github.com/lampepfl/dotty/pull/19584)

## SemanticDB

- Check for primary constructor in namePresentInSource [#18325](https://github.com/lampepfl/dotty/pull/18325)
- Add -semanticdb-text compiler option [#18307](https://github.com/lampepfl/dotty/pull/18307)

## Typer

- Fix pattern generation in "ordinal" mirror method [#17570](https://github.com/lampepfl/dotty/pull/17570)
- Fix superType of SuperType [#17574](https://github.com/lampepfl/dotty/pull/17574)
- Avoid crash in erasure when reference cannot be emitted [#18056](https://github.com/lampepfl/dotty/pull/18056)
- Disallow overloading from breaking stable patterns [#18327](https://github.com/lampepfl/dotty/pull/18327)
- Fix widen types before checking an implicit view exists [#18719](https://github.com/lampepfl/dotty/pull/18719)
- Properly handle SAM types with wildcards [#18201](https://github.com/lampepfl/dotty/pull/18201)
- Handle recursion in collectParts [#18214](https://github.com/lampepfl/dotty/pull/18214)
- Allow eta-expansion of inline defs [#18249](https://github.com/lampepfl/dotty/pull/18249)
- Stable names for lambda lifted methods [#18281](https://github.com/lampepfl/dotty/pull/18281)
- Fix expandParam's use of argForParam/isArgPrefixOf. [#19412](https://github.com/lampepfl/dotty/pull/19412)

# Contributors

Thank you to all the contributors who made this release possible 🎉

According to `git shortlog -sn --no-merges 3.3.1..3.3.2` these are:

```
42 Paweł Marks
38 Nicolas Stucki
28 Chris Kipp
15 Sébastien Doeraene
13 Lucas Leblanc
13 Martin Odersky
12 Guillaume Martres
11 Dale Wijnand
10 Jamie Thompson
8 ghostbuster91
6 Florian3k
5 Kacper Korban
4 Jan Chyb
4 Jędrzej Rochala
4 Katarzyna Marek
4 Quentin Bernet
4 Seth Tisue
3 Lucas
3 Matt Bovel
2 Julien Richard-Foy
2 Wojciech Mazur
1 Aleksey Troitskiy
1 Arnout Engelen
1 Bjorn Regnell
1 Eugene Yokota
1 Fabián Heredia Montiel
1 Justin Reardon
1 Kisaragi
1 Martin Kučera
1 Matthew Rooney
1 Matthias Kurz
1 Ondrej Lhotak
1 Rikito Taniguchi
1 Stefan Wachter
1 Yuito Murase
1 rochala
```
18 changes: 8 additions & 10 deletions compiler/src/dotty/tools/dotc/core/NameKinds.scala
Original file line number Diff line number Diff line change
Expand Up @@ -290,18 +290,16 @@ object NameKinds {
*/
val ContextBoundParamName: UniqueNameKind = new UniqueNameKind("evidence$")

/** The name of an inferred contextual function parameter:
*
* val x: A ?=> B = b
*
* becomes:
*
* val x: A ?=> B = (contextual$1: A) ?=> b
*/
val ContextFunctionParamName: UniqueNameKind = new UniqueNameKind("contextual$")
// Reuse an existing NameKind to avoid breaking the tasty readers of Scala 3.3.0 and 3.3.1
// see https://github.com/playframework/playframework/issues/12418
val ContextFunctionParamName: UniqueNameKind = ContextBoundParamName
val CanThrowEvidenceName: UniqueNameKind = ContextBoundParamName

// Generate NameKinds matching the ones used in 3.3.2 so we can unpickle 3.3.2 code.
val ContextFunctionParamName_332: UniqueNameKind = new UniqueNameKind("contextual$")
val CanThrowEvidenceName_332: UniqueNameKind = new UniqueNameKind("canThrow$")

/** Other unique names */
val CanThrowEvidenceName: UniqueNameKind = new UniqueNameKind("canThrow$")
val TempResultName: UniqueNameKind = new UniqueNameKind("ev$")
val DepParamName: UniqueNameKind = new UniqueNameKind("(param)")
val LazyImplicitName: UniqueNameKind = new UniqueNameKind("$_lazy_implicit_$")
Expand Down
2 changes: 1 addition & 1 deletion project/Build.scala
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ object Build {

val referenceVersion = "3.3.1"

val baseVersion = "3.3.2"
val baseVersion = "3.3.3"

// Versions used by the vscode extension to create a new project
// This should be the latest published releases.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package app

import lib.*

@main def test = println:
given String = "foo"
Wrap.foo[Long]
7 changes: 7 additions & 0 deletions sbt-test/scala3-compat/name-kinds-backward-3.3.1/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lazy val lib = project.in(file("lib"))
.settings(
scalaVersion := "3.3.1"
)

lazy val app = project.in(file("app"))
.dependsOn(lib)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package lib

object Wrap:
def foo[T: Numeric]: String ?=> T =
summon[Numeric[T]].fromInt(summon[String].length)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sbt._
import Keys._

object DottyInjectedPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements

override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion")
)
}
1 change: 1 addition & 0 deletions sbt-test/scala3-compat/name-kinds-backward-3.3.1/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> app/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package app

import lib.*

@main def test = println:
given String = "foo"
Wrap.foo[Long]
7 changes: 7 additions & 0 deletions sbt-test/scala3-compat/name-kinds-backward-3.3.2/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lazy val lib = project.in(file("lib"))
.settings(
scalaVersion := "3.3.2"
)

lazy val app = project.in(file("app"))
.dependsOn(lib)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package lib

object Wrap:
def foo[T: Numeric]: String ?=> T =
summon[Numeric[T]].fromInt(summon[String].length)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sbt._
import Keys._

object DottyInjectedPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements

override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion")
)
}
1 change: 1 addition & 0 deletions sbt-test/scala3-compat/name-kinds-backward-3.3.2/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> app/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package app

import lib.*

@main def test = println:
given String = "foo"
Wrap.foo[Long]
7 changes: 7 additions & 0 deletions sbt-test/scala3-compat/name-kinds-forward-3.3.1/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lazy val lib = project.in(file("lib"))

lazy val app = project.in(file("app"))
.dependsOn(lib)
.settings(
scalaVersion := "3.3.1"
)
5 changes: 5 additions & 0 deletions sbt-test/scala3-compat/name-kinds-forward-3.3.1/lib/Foo.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package lib

object Wrap:
def foo[T: Numeric]: String ?=> T =
summon[Numeric[T]].fromInt(summon[String].length)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sbt._
import Keys._

object DottyInjectedPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements

override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion")
)
}
1 change: 1 addition & 0 deletions sbt-test/scala3-compat/name-kinds-forward-3.3.1/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> app/run
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
package app

import lib.*

@main def test = println:
given String = "foo"
Wrap.foo[Long]
7 changes: 7 additions & 0 deletions sbt-test/scala3-compat/name-kinds-forward-3.3.2/build.sbt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
lazy val lib = project.in(file("lib"))

lazy val app = project.in(file("app"))
.dependsOn(lib)
.settings(
scalaVersion := "3.3.2"
)
5 changes: 5 additions & 0 deletions sbt-test/scala3-compat/name-kinds-forward-3.3.2/lib/Foo.scala
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
package lib

object Wrap:
def foo[T: Numeric]: String ?=> T =
summon[Numeric[T]].fromInt(summon[String].length)
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import sbt._
import Keys._

object DottyInjectedPlugin extends AutoPlugin {
override def requires = plugins.JvmPlugin
override def trigger = allRequirements

override val projectSettings = Seq(
scalaVersion := sys.props("plugin.scalaVersion")
)
}
1 change: 1 addition & 0 deletions sbt-test/scala3-compat/name-kinds-forward-3.3.2/test
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
> app/run
4 changes: 2 additions & 2 deletions tests/neg/i11350.check
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
-- [E081] Type Error: tests/neg/i11350.scala:1:39 ----------------------------------------------------------------------
1 |class A1[T](action: A1[T] ?=> String = "") // error
| ^
| Could not infer type for parameter contextual$1 of anonymous function
| Could not infer type for parameter evidence$1 of anonymous function
|
| Partially inferred type for the parameter: A1[<?>]
|
| Expected type for the whole anonymous function: (A1[<?>]) ?=> String
-- [E081] Type Error: tests/neg/i11350.scala:2:39 ----------------------------------------------------------------------
2 |class A2[T](action: A1[T] ?=> String = summon[A1[T]]) // error
| ^
| Could not infer type for parameter contextual$2 of anonymous function
| Could not infer type for parameter evidence$2 of anonymous function
|
| Partially inferred type for the parameter: A1[<?>]
|
Expand Down
2 changes: 1 addition & 1 deletion tests/run-staging/multi-staging.check
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
stage1 code: ((q1: scala.quoted.Quotes) ?=> {
val x1: scala.Int = 2
scala.quoted.runtime.Expr.quote[scala.Int](1.+(scala.quoted.runtime.Expr.splice[scala.Int](((contextual$5: scala.quoted.Quotes) ?=> scala.quoted.Expr.apply[scala.Int](x1)(scala.quoted.ToExpr.IntToExpr[scala.Int])(contextual$5))))).apply(using q1)
scala.quoted.runtime.Expr.quote[scala.Int](1.+(scala.quoted.runtime.Expr.splice[scala.Int](((evidence$5: scala.quoted.Quotes) ?=> scala.quoted.Expr.apply[scala.Int](x1)(scala.quoted.ToExpr.IntToExpr[scala.Int])(evidence$5))))).apply(using q1)
})
3
2 changes: 1 addition & 1 deletion tests/run-staging/quote-nested-2.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
((q: scala.quoted.Quotes) ?=> {
val a: scala.quoted.Expr[scala.Int] = scala.quoted.runtime.Expr.quote[scala.Int](4).apply(using q)
((contextual$2: scala.quoted.Quotes) ?=> a).apply(using q)
((evidence$2: scala.quoted.Quotes) ?=> a).apply(using q)
})
2 changes: 1 addition & 1 deletion tests/run-staging/quote-nested-5.check
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
((q: scala.quoted.Quotes) ?=> {
val a: scala.quoted.Expr[scala.Int] = scala.quoted.runtime.Expr.quote[scala.Int](4).apply(using q)
((q2: scala.quoted.Quotes) ?=> ((contextual$2: scala.quoted.Quotes) ?=> a).apply(using q2))
((q2: scala.quoted.Quotes) ?=> ((evidence$2: scala.quoted.Quotes) ?=> a).apply(using q2))
}.apply(using q))
Loading