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

Explicit imports now shadow locally defined identifiers #6589

Merged
merged 10 commits into from
Jun 13, 2018

Conversation

som-snytt
Copy link
Contributor

@som-snytt som-snytt commented May 2, 2018

Original title: "Import shadows def in other unit, per spec"

Forward port of #5339 .

Fixes scala/bug#2458
Fixes scala/bug#9552

@scala-jenkins scala-jenkins added this to the 2.13.0-M5 milestone May 2, 2018
@som-snytt som-snytt force-pushed the topic/important branch 4 times, most recently from 348fe23 to 8784687 Compare May 3, 2018 20:23
@som-snytt
Copy link
Contributor Author

NB: two import fixes were still required, two others in tests pass after "Forgive import ambiguity". Those changes squashed in lead commit.

@som-snytt

This comment has been minimized.

@SethTisue
Copy link
Member

/synch

@som-snytt
Copy link
Contributor Author

som-snytt commented May 4, 2018

Even Seth doesn't know the password.

Hey, how can settings be broken already? I'm only creating a -Y option that forks language semantics.

Edit: rebased

@SethTisue
Copy link
Member

SethTisue commented May 4, 2018

/synch goddamn it Scabot or I'll come over and put my foot right through your circuits

@hrhino
Copy link
Member

hrhino commented May 4, 2018

"important" is clever but the previous PR had the benefit of iambic trochaic pentameter.

@som-snytt
Copy link
Contributor Author

Sample erroneous shadowing. The import java.util isn't used, of course.

[warn] /home/amarki/projects/scala/test/junit/scala/tools/nsc/DeterminismTest.scala:5: imported `util' is permanently hidden by definition of package util in package nsc

Copy link
Member

@lrytz lrytz left a comment

Choose a reason for hiding this comment

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

I think we should split out the -Yimports change into a separate PR.

The changes should come with tests.

Could you also summarize the changes in the commit messages?

What's the reason for changing the imports (the second commit)?

val pkg = sym.enclosingPackage.name
!unitDefinesClassOrObject(pkg, sym.name) && !hasExplicitImport(body, pkg, sym.name)
}
if (!ok) report(sym)
Copy link
Member

Choose a reason for hiding this comment

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

@som-snytt
Copy link
Contributor Author

I was hoping for feedback on simple -Yimports versus the other proposal, but I think the folks who want the mechanism are just using Haskell.

The imports in the few changed files are ambiguous.

Very well, I'll split out -Yimports; I don't think the code requires working imports, but using them correctly does. I think that these two-year-old PRs are more likely to die on the vine again.

The linked PR on 2.12 has full commit messages; I didn't expect it to get shut down.

@som-snytt
Copy link
Contributor Author

Also, the other PR includes the spec change for the precedence of "root" imports. As the message here says, this was a minimal forward port.

@lrytz
Copy link
Member

lrytz commented Jun 8, 2018

I definitely like what I saw from -Yimports, but I didn't test it locally to see what it does in detail. Reverse-engineering all corner cases from looking at the code was a bit too hard, so either test cases or more description would help discussing the proposal.

The imports in the few changed files are ambiguous.

It confused me that the commit fixing imports comes after the change to imports handling. But now I see that's a case of https://help.github.com/articles/why-are-my-commits-in-the-wrong-order

@som-snytt
Copy link
Contributor Author

That just happened to me on another PR. I'll rebase and recreate commits here, adding what's missing from the 2.12 PR. Thanks for taking a look. I have high hopes for -Yimports, especially as a way for newbies to auto-import implicits, such as ExecutionContext.Implicits etc.

For example,
```
import p._ ; package p { S }
```
where S is both made available in p and also explicitly
imported in enclosing scope.

The usage S is ambiguous because it must not shadow the import.
Fixes the implementation of point 4. from SLS chapter 2:

> Definitions made available by a package clause not in the
> compilation unit where the reference occurs have lowest precedence.

The implementation walks the context chain, but tries to be smart
about how far it must walk, checking whether it has risen to an
adequate depth. This check was previously broken for this case.
"Root" imports, implicitly supplied by the compiler,
are lowest precedence.
If a definition and an import introduce an ambiguity,
because the definition is at level 4 binding
precedence, but imported symbol is just the definition,
then ignore the import at that location.

The pos test for ambiguous import was failing before.
Add words and counterexamples.
@som-snytt som-snytt changed the title important Import shadows def in other unit, per spec Jun 8, 2018
@SethTisue
Copy link
Member

specs2 diffs — this one was easier

xuwei-k added a commit to xuwei-k/specs2 that referenced this pull request Aug 5, 2018
maybe due to scala/scala#6589

https://scala-ci.typesafe.com/job/scala-2.13.x-integrate-community-build/1302/consoleFull

```
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:62:31: too many arguments (2) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]   val nameProp = Prop("name", "eric")
[specs2-more] [error]                               ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:63:18: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]   val noValues = new Prop("name")
[specs2-more] [error]                  ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:64:25: type mismatch;
[specs2-more] [error]  found   : Int(18)
[specs2-more] [error]  required: String
[specs2-more] [error]   val actualOnly = Prop(18)
[specs2-more] [error]                         ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:65:22: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]   val expectedOnly = new Prop("", Property(), Property(18))
[specs2-more] [error]                      ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:66:20: wrong number of type arguments for scala.sys.Prop, should be 1
[specs2-more] [error]   val constrained: Prop[String, String] = Prop("name", "eric", (s1: String, s2: String) => s1 must contain(s2))
[specs2-more] [error]                    ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:66:56: too many arguments (3) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]   val constrained: Prop[String, String] = Prop("name", "eric", (s1: String, s2: String) => s1 must contain(s2))
[specs2-more] [error]                                                        ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:67:34: too many arguments (3) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]   val withMatcher = Prop("name", "eric", contain(_:String))
[specs2-more] [error]                                  ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:75:20: too many arguments (3) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]     e6 := Prop("", 1, be_>(0).mute).execute    === Success("")
[specs2-more] [error]                    ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:76:20: 3 more arguments than can be applied to method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]     e7 := Prop("", 1, 2, be_>(0).mute).execute === Success("")
[specs2-more] [error]                    ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:80:11: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]     e1 := new Prop("name", expected = Property("fanny")).toString       === "name: _ (expected: fanny)"
[specs2-more] [error]           ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:80:28: not found: value expected
[specs2-more] [error]     e1 := new Prop("name", expected = Property("fanny")).toString       === "name: _ (expected: fanny)"
[specs2-more] [error]                            ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:81:11: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]     e2 := new Prop("name", actual = Property("eric")).toString          === "name: eric"
[specs2-more] [error]           ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:81:28: not found: value actual
[specs2-more] [error]     e2 := new Prop("name", actual = Property("eric")).toString          === "name: eric"
[specs2-more] [error]                            ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:82:11: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]     e3 := new Prop("name", Property("eric"), Property("eric")).toString === "name: eric"
[specs2-more] [error]           ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:86:24: too many arguments (2) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]     e1 := Prop("name", "eric")("paolo").expected.toOption must_== Some("paolo")
[specs2-more] [error]                        ^
[specs2-more] [error] 15 errors found
[specs2-more] [error] (form / Test / compileIncremental) Compilation failed
```
etorreborre pushed a commit to etorreborre/specs2 that referenced this pull request Aug 5, 2018
maybe due to scala/scala#6589

https://scala-ci.typesafe.com/job/scala-2.13.x-integrate-community-build/1302/consoleFull

```
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:62:31: too many arguments (2) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]   val nameProp = Prop("name", "eric")
[specs2-more] [error]                               ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:63:18: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]   val noValues = new Prop("name")
[specs2-more] [error]                  ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:64:25: type mismatch;
[specs2-more] [error]  found   : Int(18)
[specs2-more] [error]  required: String
[specs2-more] [error]   val actualOnly = Prop(18)
[specs2-more] [error]                         ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:65:22: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]   val expectedOnly = new Prop("", Property(), Property(18))
[specs2-more] [error]                      ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:66:20: wrong number of type arguments for scala.sys.Prop, should be 1
[specs2-more] [error]   val constrained: Prop[String, String] = Prop("name", "eric", (s1: String, s2: String) => s1 must contain(s2))
[specs2-more] [error]                    ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:66:56: too many arguments (3) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]   val constrained: Prop[String, String] = Prop("name", "eric", (s1: String, s2: String) => s1 must contain(s2))
[specs2-more] [error]                                                        ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:67:34: too many arguments (3) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]   val withMatcher = Prop("name", "eric", contain(_:String))
[specs2-more] [error]                                  ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:75:20: too many arguments (3) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]     e6 := Prop("", 1, be_>(0).mute).execute    === Success("")
[specs2-more] [error]                    ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:76:20: 3 more arguments than can be applied to method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]     e7 := Prop("", 1, 2, be_>(0).mute).execute === Success("")
[specs2-more] [error]                    ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:80:11: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]     e1 := new Prop("name", expected = Property("fanny")).toString       === "name: _ (expected: fanny)"
[specs2-more] [error]           ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:80:28: not found: value expected
[specs2-more] [error]     e1 := new Prop("name", expected = Property("fanny")).toString       === "name: _ (expected: fanny)"
[specs2-more] [error]                            ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:81:11: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]     e2 := new Prop("name", actual = Property("eric")).toString          === "name: eric"
[specs2-more] [error]           ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:81:28: not found: value actual
[specs2-more] [error]     e2 := new Prop("name", actual = Property("eric")).toString          === "name: eric"
[specs2-more] [error]                            ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:82:11: trait Prop is abstract; cannot be instantiated
[specs2-more] [error]     e3 := new Prop("name", Property("eric"), Property("eric")).toString === "name: eric"
[specs2-more] [error]           ^
[specs2-more] [error] /home/jenkins/workspace/scala-2.13.x-integrate-community-build/target-0.9.13/project-builds/specs2-more-db45127d55bd79c54d280645a81534fbc13e7a8b/form/src/test/scala/org/specs2/form/PropSpec.scala:86:24: too many arguments (2) for method apply: (key: String)(implicit evidence$1: sys.Prop.Creator[T])scala.sys.Prop[T] in object Prop
[specs2-more] [error]     e1 := Prop("name", "eric")("paolo").expected.toOption must_== Some("paolo")
[specs2-more] [error]                        ^
[specs2-more] [error] 15 errors found
[specs2-more] [error] (form / Test / compileIncremental) Compilation failed
```
@som-snytt som-snytt deleted the topic/important branch August 5, 2018 21:01
@dwijnand dwijnand changed the title Import shadows def in other unit, per spec Explicit imports now shadow locally defined identifiers Jun 21, 2019
ijuma added a commit to apache/kafka that referenced this pull request Jul 2, 2019
Scala 2.13 support was added to build via #5454. This PR adjusts the code so that
it compiles with 2.11, 2.12 and 2.13.

Changes:
* Add `scala-collection-compat` dependency.
* Import `scala.collection.Seq` in a number of places for consistent behavior between
Scala 2.11, 2.12 and 2.13.
* Remove wildcard imports that were causing the Java classes to have priority over the
Scala ones, related Scala issue: scala/scala#6589.
* Replace parallel collection usage with `Future`. The former is no longer included by
default in the standard library.
* Replace val _: Unit workaround with one that is more concise and works with Scala 2.13
* Replace `filterKeys` with `filter` when we expect a `Map`. `filterKeys` returns a view
that doesn't implement the `Map` trait in Scala 2.13.
* Replace `mapValues` with `map` or add a `toMap` as an additional transformation
when we expect a `Map`. `mapValues` returns a view that doesn't implement the
`Map` trait in Scala 2.13.
* Replace `breakOut` with `iterator` and `to`, `breakOut` was removed in Scala
2.13.
* Replace to() with toMap, toIndexedSeq and toSet
* Replace `mutable.Buffer.--` with `filterNot`.
* ControlException is an abstract class in Scala 2.13.
* Variable arguments can only receive arrays or immutable.Seq in Scala 2.13.
* Use `Factory` instead of `CanBuildFrom` in DecodeJson. `CanBuildFrom` behaves
a bit differently in Scala 2.13 and it's been deprecated. `Factory` has the behavior
we need and it's available via the compat library.
* Fix failing tests due to behavior change in Scala 2.13,
"Map.values.map is not strict in Scala 2.13" (scala/bug#11589).
* Use Java collections instead of Scala ones in StreamResetter (a Java class).
* Adjust CheckpointFile.write to take an `Iterable` instead of `Seq` to avoid
unnecessary collection copies.
* Fix DelayedElectLeader to use a Map instead of Set and avoid `to` call that
doesn't work in Scala 2.13.
* Use unordered map for mapping in SimpleAclAuthorizer, mapping of ordered
maps require an `Ordering` in Scala 2.13 for safety reasons.
* Adapt `ConsumerGroupCommand` to compile with Scala 2.13.
* CoreUtils.min takes an `Iterable` instead of `TraversableOnce`, the latter does
not exist in Scala 2.13.
* Replace `Unit` with `()` in a couple places. Scala 2.13 is stricter when it expects
a value instead of a type.
* Fix bug in CustomQuotaCallbackTest where we did not necessarily set `partitionRatio`
correctly, `forall` can terminate early.
* Add a couple of spotbugs exclusions that are needed by code generated by Scala 2.13
* Remove unused variables, simplify some code and remove procedure syntax in a few
places.
* Remove unused `CoreUtils.JSONEscapeString`.

Reviewers: Manikumar Reddy <manikumar.reddy@gmail.com>, José Armando García Sancio <jsancio@users.noreply.github.com>
@SethTisue
Copy link
Member

There is now some further discussion and justification at scala/bug#11593

nicl added a commit to guardian/riff-raff that referenced this pull request Jan 5, 2022
Scala -> 2.13 (previously 2.12)
Play  -> 2.8 (2.6)
SBT   -> 1.5.6 (0.13)

This was a bit of a gigantic upgrade due to dependency binary
incompatibilities (dependency coupling) and general breaking
changes.

Hopefully in future we can do smaller and more frequent updates.

To break down the changes:

1. Removal of some niche dependencies

The list is: diffson-play-json, scala-ssh, henkan-convert.

These were either unused or used only a little.

2. .mapValues -> .view.mapValues(...).toMap

https://docs.scala-lang.org/overviews/core/collections-migration-213.html#what-are-the-breaking-changes

3. other Scala 2.12 and 2.13 changes

* .par now requires a special import
* Seq is now core.immutable.Seq
* import precendence and shadowing seems to have changed (see:
  scala/scala#6589), which caused issues
  as task and deployment_types packages share many names
* requirement to drop parens when a method (typically controller
  method) was defined without them
* etc.

4. library breaking changes

For example, in the Guardian's own Play Secret and GoogleAuth
libraries, or in the Boostrap ('b3') library, especially in
how forms are defined.

5. SBT changes

The deprecation of 'in' for '/' instead.
nicl added a commit to guardian/riff-raff that referenced this pull request Jan 6, 2022
Scala -> 2.13 (previously 2.12)
Play  -> 2.8 (2.6)
SBT   -> 1.5.6 (0.13)

This was a bit of a gigantic upgrade due to dependency binary
incompatibilities (dependency coupling) and general breaking
changes.

Hopefully in future we can do smaller and more frequent updates.

To break down the changes:

1. Removal of some niche dependencies

The list is: diffson-play-json, scala-ssh, henkan-convert.

These were either unused or used only a little.

2. .mapValues -> .view.mapValues(...).toMap

https://docs.scala-lang.org/overviews/core/collections-migration-213.html#what-are-the-breaking-changes

3. other Scala 2.12 and 2.13 changes

* .par now requires a special import
* Seq is now core.immutable.Seq
* import precendence and shadowing seems to have changed (see:
  scala/scala#6589), which caused issues
  as task and deployment_types packages share many names
* requirement to drop parens when a method (typically controller
  method) was defined without them
* etc.

4. library breaking changes

For example, in the Guardian's own Play Secret and GoogleAuth
libraries, or in the Boostrap ('b3') library, especially in
how forms are defined.

5. SBT changes

The deprecation of 'in' for '/' instead.
@mbarton mbarton mentioned this pull request Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
release-notes worth highlighting in next release notes
Projects
None yet
7 participants