Heed the comments in the source about what needed to be adapted
to the new key-retention semantic in 2.13.x.
Make the test work despite scala/bug#12228
The reason that:
sealed trait May[+A]
final case class Just[+A](value: A) extends May[A]
final case class Nada() extends May[Nothing]
object Possibly {
def unapply[A](may: May[A]): Some[May[A]] = Some(may)
}
def usingMay[A](may: May[A]) = may match { // missing Nada case
case Possibly(Just(a)) => a
}
... also reports "Just" in addition to "Nada" is that the compiler
doesn't know under what conditions the Possibly extractor returns Nada
(which is the root of the unhandled case) so it gives you both the
input's possible types: Just and Nada. Like before (with the "are
custom extractors idempotent") I think `Some[may.type]` fixes that, but
noone writes that.
Now that `Typer.stabilize` ends up checking for `@uncheckedStable`
annotations to support defs's as stable paths, new opportunities
arise for cyclic errors.
This PR reduces the likelihood of cycles by typechecking the only core of
an annotation (_not_ the full application to the annotation arguments)
to determine its type symbol.
pos/unchecked-stable-cyclic-error.scala test case started to fail
since #8338 with:
```
|-- object Test BYVALmode-EXPRmode (site: package <empty>)
| |-- super APPSELmode-EXPRmode-POLYmode-QUALmode (silent: <init> in Test)
| | |-- this EXPRmode (silent: <init> in Test)
| | | \-> Test.type
| | \-> Test.type
| |-- def foo BYVALmode-EXPRmode (site: object Test)
| | |-- attr EXPRmode (site: method foo in Test)
| | | |-- Int TYPEmode (site: method attr in Test)
| | | | \-> Int
| | | |-- new anno APPSELmode-BYVALmode-EXPRmode-FUNmode-POLYmode (site: object Test)
| | | | |-- new anno APPSELmode-EXPRmode-POLYmode-QUALmode (site: object Test)
| | | | | |-- anno FUNmode-TYPEmode (site: object Test)
| | | | | | \-> anno
| | | | | \-> anno
| | | | \-> (a: Any): anno
| | | |-- (a: Any): anno : pt=anno EXPRmode (site: value <local Test> in Test)
| | | | |-- foo : pt=Any BYVALmode-EXPRmode (site: value <local Test> in Test)
| | | | | caught scala.reflect.internal.Symbols$CyclicReference: illegal cyclic reference involving method foo: while typing foo
/Users/jz/code/scala/sandbox/test.scala:7: error: recursive method foo needs result type
@anno(foo) def attr: Int = foo
^
| | | | \-> anno
```
Another variant, pos/annotation-cycle.scala, fails only on 2.12.x
(after the backport of #8338). Backporting this fix makes that test
start passing on 2.12.x.
This reverts commit 8662d4aebb.
It is a very important API, but the compiler's binary API isn't stable.
This got confused because scala-rewrites is special in the
community-build as it uses binary dependencies (for scalafix/scalameta
dependency graph problems). Additionally I optimistically "fix"
semanticdb-scalac-core's cross version when consuming Scala nightlies...
Replaces `-Xno-unsealed-patmat-analysi` with `-Xlint:strict-unsealed-patmat`, switching the default behaviour to opt-in to this strictness.
:(
However, at least by being in the Xlint family, it's on if you opt-in to `-Xlint`.
Reverts commit 0416c57a01 (w/ tweaks).
It's an important binary API:
[scala-rewrites] [error] java.lang.NoSuchMethodError: scala.tools.nsc.Global.reporter()Lscala/tools/nsc/reporters/Reporter;
[scala-rewrites] [error] at scala.meta.internal.semanticdb.scalac.SemanticdbPlugin.init(SemanticdbPlugin.scala:25)
[scala-rewrites] [error] at scala.tools.nsc.plugins.Plugins.$anonfun$loadPlugins$9(Plugins.scala:162)
Cherry picked from e9d811ef..e6e2e3df / #8794
The various approaches used to maintain serialization compatibility
in 2.12.x can be dropped as they are obviated by use of serialization
proxies in 2.13.x.
I saw a CI log where the failure to build and bootstrap didn't kill the
job, trying to fetch that starr version to testOsgi did... Previously
this wasn't the case because there was a "set -e" (aka "-o errexit")
present which I just recently removed, because I confused it with "set
-x" (which is "-o xtrace"). -.-
There's a bit of an holy war on "set -e" usage but I (still?) tend to
lean on the "don't rely on it" side. I'd initially gone with my "append
everything important with `|| travis_terminate 1`" solution, but I found
the "make it one big command with `&&`" way to be perhaps better because
I think it's harder to not do the wrong thing that way (i.e. forget to
append travis_terminate). I think the downside is a failure reports the
entire chain of commands rather than explicitly which one failed...
However, as many other scripts use "set -e" so we'll keep it consistent.
In JDK 15 CharSequence has an isEmpty method with a default
implementation, which clashes with our Array[Char]#isEmpty,
IndexedSeq[Char]#isEmpty, as well as our StringBuilder and reflect's
Name.