Commit Graph

36145 Commits

Author SHA1 Message Date
Dale Wijnand 74cffddfa2
Merge pull request #9318 from retronym/ticket/12227 2020-11-17 12:49:35 +00:00
Jason Zaugg ca1cc4d0f9 Fix regressions in immutable.TreeMap merge errors from 2.12.x
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
2020-11-17 10:07:38 +00:00
Lukas Rytz 1df410ac05
Merge pull request #9296 from viktorklang/wip-opportunistic-√ 2020-11-13 10:57:22 +01:00
Lukas Rytz 0044904e69 Update scaladocs 2020-11-13 09:15:51 +01:00
Dale Wijnand 8507cf0152
Merge pull request #9312 from dwijnand/exhaust-nested-in-irrefutable
Patterns under irrefutable extractors are fixed
2020-11-12 09:27:37 +00:00
Dale Wijnand 855b2a8d8e Patterns under irrefutable extractors are fixed
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.
2020-11-11 17:07:37 +00:00
Lukas Rytz a8d3741fb7
Merge pull request #9308 from lrytz/merge-2.12-to-2.13-nov-9 2020-11-10 09:58:39 +01:00
Dale Wijnand 2105dc7b91
Merge pull request #9306 from scalacenter/tasty/block-tuple 2020-11-10 07:11:00 +00:00
Dale Wijnand 9ace1b19bf
Merge pull request #9307 from dotty-staging/fix-fun-sig
Fix type signature for specialized Function0
2020-11-10 07:10:04 +00:00
Seth Tisue 53bb32bbe7
Merge pull request #9279 from octonato/rgc/fix-classOf-object
Allow using classOf with object type
2020-11-09 22:53:12 -08:00
Jason Zaugg 728fa37826 Adapt toolbox/async test for 2.13.x 2020-11-10 13:34:02 +10:00
Lukas Rytz 49911d7d9f fix flags file 2020-11-09 16:50:59 +01:00
Viktor Klang 94390f0da4 Introduces ExecutionContext.opportunistic as a private[scala] instance as an escape-hatch for getting the original 2.13.0 batching global EC 2020-11-09 15:34:50 +01:00
Lukas Rytz 0c0dcce7b7 Merge commit '2d4985d58d' into 2.13.x 2020-11-09 15:26:23 +01:00
Lukas Rytz b3339da136 Merge commit '866e5accea' into 2.13.x 2020-11-09 15:23:22 +01:00
Lukas Rytz 0db6a8399d Merge commit '9a51b6def0' into 2.13.x 2020-11-09 15:14:34 +01:00
Liu Fengyun 4624b74927 Fix type signature for specialized Function0
Dotty is more strict in overriding check: `()Int` cannot
be overridden by parameterless `=> Int`.
2020-11-09 15:01:02 +01:00
bishabosha 080e6432b6 remove broken links in docs 2020-11-09 14:42:26 +01:00
bishabosha 49784e9c52 block scala.Tuple type 2020-11-09 14:42:07 +01:00
Renato Cavalcanti 0f9911ca87
allow using classOf with object type 2020-11-09 11:37:42 +01:00
Lukas Rytz 7e9fd558d2
Merge pull request #9305 from som-snytt/issue/warn-no-interp-this
Notice this when linting for missing interpolator
2020-11-09 09:54:21 +01:00
Lukas Rytz a7d63b98de
Merge pull request #9302 from retronym/topic/extra-lazy-annotation-info 2020-11-09 09:27:22 +01:00
Jason Zaugg 2408badddb Additional test case for annotation cyclic errors 2020-11-09 16:09:22 +10:00
Som Snytt c43487a48c Notice this when linting for missing interpolator 2020-11-07 22:56:49 -08:00
Lukas Rytz 0a1942c82f
Merge pull request #9295 from joroKr21/t12192
Add a regression test for scala/bug#12192
2020-11-05 14:14:24 +01:00
Dale Wijnand e6a6ac653c
Merge pull request #9299 from dwijnand/xlint-unsealed-match
Switch off exhaustivity warnings for unsealed types (by default)
2020-11-05 08:56:41 +00:00
Dale Wijnand 2d4985d58d
Merge pull request #9298 from dwijnand/2.12/repl-summarizes-warnings
[nomerge] Emit warnings in the REPL
2020-11-05 08:54:35 +00:00
Jason Zaugg 9d9635d756 Make annotation typechecking lazier
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.
2020-11-05 16:04:07 +10:00
Dale Wijnand 7101549240
Merge pull request #9292 from dwijnand/non-implicit-enrich-CharSequence
Make the CharSequence wrappers in Predef non-implicit, for JDK 15
2020-11-04 16:26:18 +00:00
Seth Tisue 3a2b0f820c
Merge pull request #9300 from dwijnand/revert-restore-Global.reporter-Reporter
Revert "Restore Global.reporter()Reporter"
2020-11-04 08:13:27 -08:00
Dale Wijnand d72286c283 Revert "Restore Global.reporter()Reporter"
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...
2020-11-04 09:28:21 +00:00
Dale Wijnand 0ae0739eb2 [nomerge] Emit warnings in the REPL 2020-11-03 21:32:28 +00:00
Seth Tisue decbd53f1b
Merge pull request #9287 from dwijnand/unsuppress-exhaustivity-warnings
Unsuppress exhaustivity warnings
2020-11-03 11:43:15 -08:00
Dale Wijnand 35d9bda62d Switch off exhaustivity warnings for unsealed types (by default)
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).
2020-11-03 11:17:35 +00:00
Dale Wijnand 6665ff49cd Resolve some exhaustivity warnings downstream from the compiler 2020-11-02 16:05:47 +00:00
Dale Wijnand da1182f1a8 Unsuppress exhaustivity warnings in the compiler 2020-11-02 16:05:45 +00:00
Dale Wijnand 7ddb4a18f8 Unsuppress exhaustivity warnings in reflect 2020-11-02 16:04:57 +00:00
Dale Wijnand 44f1db4c34 Unsuppress exhaustivity warnings in the library 2020-11-02 16:04:57 +00:00
Dale Wijnand 42f2bd89b0
Merge pull request #9297 from dwijnand/2.12/restore-Global.reporter-Reporter
Restore Global.reporter()Reporter
2020-11-02 12:38:02 +00:00
Dale Wijnand 65fa331411
Merge pull request #9281 from dwijnand/travis-fatal-errors
Travis CI: make a command error fatal
2020-11-02 12:33:06 +00:00
Dale Wijnand 7ef5a60293
Merge pull request #9293 from dwijnand/tasty-reading-behind-a-flag
Stick TASTy reading behind a -Ytasty-reader flag
2020-11-02 12:32:49 +00:00
Dale Wijnand 3743cad6ce Stick TASTy reading behind a -Ytasty-reader flag 2020-11-02 10:25:45 +00:00
Dale Wijnand 8662d4aebb Restore Global.reporter()Reporter
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)
2020-11-02 10:20:41 +00:00
Dale Wijnand bf73ad9ec3
Merge pull request #9291 from retronym/merge/rbtree-builder 2020-11-02 09:58:28 +00:00
Georgi Krastev dd0695ed79 Add a regression test for scala/bug#12192 2020-10-29 16:43:53 +01:00
Lukas Rytz 200c122a8b
Merge pull request #9271 from scalacenter/tasty/read-java-annotations 2020-10-29 15:57:59 +01:00
Seth Tisue b08ccde2c2
Merge pull request #9289 from dwijnand/fix-backported-deprecation-since
[nomerge] Fix backported deprecation "since"
2020-10-29 07:30:02 -07:00
mkeskells 1fe3e2473a RedBlackTree with fast mutable builder
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.
2020-10-29 10:48:43 +00:00
Dale Wijnand f86da35baf Travis CI: make a command error fatal
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.
2020-10-29 09:45:30 +00:00
Dale Wijnand 0230f94fa9 Make the CharSequence wrappers in Predef non-implicit, for JDK 15
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.
2020-10-29 09:39:39 +00:00