Fix range position for vars with default initializer#103
Closed
Fix range position for vars with default initializer#103
Conversation
JDK issues about the problem: * https://bugs.openjdk.java.net/browse/JDK-8136353
5ebcc7a to
428ce14
Compare
|
I'm thinking a test would be good. Outside of a checkfile of |
This reverts commit 8662d4a. 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...
…orter-Reporter Revert "Restore Global.reporter()Reporter"
…ings [nomerge] Emit warnings in the REPL
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 scala#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 scala#8338). Backporting this fix makes that test start passing on 2.12.x. Backports scala#9302
…ation-info [backport] Make annotation typechecking lazier
fix ClassTag#cache leak
…ompat Avoid use of binary incompatible super accessors in SortedMap/Set
… 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. Backport of scala#9292 from 2.13.x to 2.12.x
[backport] Make the CharSequence wrappers in Predef non-implicit, for JDK 15
as per discussion on scala#9292
deprecate ArrayCharSequence
this regressed in scala#9091 the problem turned up in the Scala 2.12 community build -- when Scala 3 support was added to the scala-collection-compat repo, a test case there was altered in a way that happened to tickle this
fix never-released 2.12.13 regression where Array[Unit].empty caused NPE
Catch exceptions for the InlineInfoAttribute reader
The `= _` should be include in the range position of the ValDef.
Pass the position of the RHS explicitly rather than using `rhs.pos` within TreeBuilder, as that doesn't carry the position of the `_` represented by the singleton tree `EmptyTree`.
428ce14 to
a02ecf5
Compare
Owner
Author
|
@dwijnand Agreed. We can can test this sort of thing with a junit test employing Submitted upstream as scala#9355 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes scala/bug#12213