| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Don't emit a synthetic `apply` (or `unapply`) when it would
clash with an existing one. This allows e.g., a `private apply`,
along with a `case class` with a `private` constructor.
We have to retract the synthetic method in a pretty roundabout way,
as we need the other methods and the owner to be completed already.
Unless we have to complete the synthetic `apply` while completing
the user-defined one, this should not be a problem. If this does
happen, this implies there's a cycle in computing the user-defined
signature and the synthetic one, which is not allowed.
|
| |
|
|\
| |
| | |
SCP-009: Improve direct dependency experience
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The following commit message is a squash of several commit messages.
- This is the 1st commit message:
Add position to stub error messages
Stub errors happen when we've started the initialization of a symbol but
key information of this symbol is missing (the information cannot be
found in any entry of the classpath not sources).
When this error happens, we better have a good error message with a
position to the place where the stub error came from. This commit goes
into this direction by adding a `pos` value to `StubSymbol` and filling
it in in all the use sites (especifically `UnPickler`).
This commit also changes some tests that test stub errors-related
issues. Concretely, `t6440` is using special Partest infrastructure and
doens't pretty print the position, while `t5148` which uses the
conventional infrastructure does. Hence the difference in the changes
for both tests.
- This is the commit message #2:
Add partest infrastructure to test stub errors
`StubErrorMessageTest` is the friend I introduce in this commit to help
state stub errors. The strategy to test them is easy and builds upon
previous concepts: we reuse `StoreReporterDirectTest` and add some
methods that will compile the code and simulate a missing classpath
entry by removing the class files from the class directory (the folder
where Scalac compiles to).
This first iteration allow us to programmatically check that stub errors
are emitted under certain conditions.
- This is the commit message #3:
Improve contents of stub error message
This commit does three things:
* Keep track of completing symbol while unpickling
First, it removes the previous `symbolOnCompletion` definition to be
more restrictive/clear and use only positions, since only positions are
used to report the error (the rest of the information comes from the
context of the `UnPickler`).
Second, it adds a new variable called `lazyCompletingSymbol` that is
responsible for keeping a reference to the symbol that produces the stub
error. This symbol will usually (always?) come from the classpath
entries and therefore we don't have its position (that's why we keep
track of `symbolOnCompletion` as well). This is the one that we have to
explicitly use in the stub error message, the culprit so to speak.
Aside from these two changes, this commit modifies the existing tests
that are affected by the change in the error message, which is more
precise now, and adds new tests for stub errors that happen in complex
inner cases and in return type of `MethodType`.
* Check that order of initialization is correct
With the changes introduced previously to keep track of position of
symbols coming from source files, we may ask ourselves: is this going to
work always? What happens if two symbols the initialization of two
symbols is intermingled and the stub error message gets the wrong
position?
This commit adds a test case and modifications to the test
infrastructure to double check empirically that this does not happen.
Usually, this interaction in symbol initialization won't happen because
the `UnPickler` will lazily load all the buckets necessary for a symbol
to be truly initialized, with the pertinent addresses from which this
information has to be deserialized. This ensures that this operation is
atomic and no other symbol initialization can happen in the meantime.
Even though the previous paragraph is the feeling I got from reading the
sources, this commit creates a test to double-check it. My attempt to be
better safe than sorry.
* Improve contents of the stub error message
This commit modifies the format of the previous stub error message by
being more precise in its formulation. It follows the structured format:
```
s"""|Symbol '${name.nameKind} ${owner.fullName}.$name' is missing from the classpath.
|This symbol is required by '${lazyCompletingSymbol.kindString} ${lazyCompletingSymbol.fullName}'.
```
This format has the advantage that is more readable and explicit on
what's happening. First, we report what is missing. Then, why it was
required. Hopefully, people working on direct dependencies will find the
new message friendlier.
Having a good test suite to check the previously added code is
important. This commit checks that stub errors happen in presence of
well-known and widely used Scala features. These include:
* Higher kinded types.
* Type definitions.
* Inheritance and subclasses.
* Typeclasses and implicits.
- This is the commit message #4:
Use `lastTreeToTyper` to get better positions
The previous strategy to get the last user-defined position for knowing
what was the root cause (the trigger) of stub errors relied on
instrumenting `def info`.
This instrumentation, while easy to implement, is inefficient since we
register the positions for symbols that are already completed.
However, we cannot do it only for uncompleted symbols (!hasCompleteInfo)
because the positions won't be correct anymore -- definitions using stub
symbols (val b = new B) are for the compiler completed, but their use
throws stub errors. This means that if we initialize symbols between a
definition and its use, we'll use their positions instead of the
position of `b`.
To work around this we use `lastTreeToTyper`. We assume that stub errors
will be thrown by Typer at soonest.
The benefit of this approach is better error messages. The positions
used in them are now as concrete as possible since they point to the
exact tree that **uses** a symbol, instead of the one that **defines**
it. Have a look at `StubErrorComplexInnerClass` for an example.
This commit removes the previous infrastructure and replaces it by the
new one. It also removes the fields positions from the subclasses of
`StubSymbol`s.
- This is the commit message #5:
Keep track of completing symbols
Make sure that cycles don't happen by keeping track of all the
symbols that are being completed by `completeInternal`. Stub errors only
need the last completing symbols, but the whole stack of symbols may
be useful to reporting other error like cyclic initialization issues.
I've added this per Jason's suggestion. I've implemented with a list
because `remove` in an array buffer is linear. Array was not an option
because I would need to resize it myself. I think that even though list
is not as efficient memory-wise, it probably doesn't matter since the
stack will usually be small.
- This is the commit message #6:
Remove `isPackage` from `newStubSymbol`
Remove `isPackage` since in 2.12.x its value is not used.
|
|\ \
| | |
| | | |
SI-10231 Skip outer parameter when classfile parsing java param names
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Nested java classes have a synthetic outer parameter, which the classfile parser
skips for the constructor symbol. When assigning parameter names from the
MethodParameters classfile attribute, we also need to skip the first name in this
case.
|
|\ \ \
| | | |
| | | | |
SI-8417 Check adapts of each param section
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | | |
Previously, adaptations like auto-tupling were checked
only on the last param section of an application.
This commit runs the sanity check always.
|
| | |
| | |
| | |
| | | |
noticed by the sharp-eyed @smarter
|
| |/
|/| |
|
|\ \
| | |
| | | |
Add tests for ConsoleReporter.
|
| | | |
|
|\ \ \
| |/ /
|/| | |
Don't use `equals` for comparing java.lang.Double/Float
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes https://github.com/scala/scala-dev/issues/329
The `equals` method for java.lang.Double/Float behaves differently than comparing
the `doubleValue`s / `floatValues` for `-0.0`/`0.0`/`NaN`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Integration builds now have version number like `2.12.2-bin-sha7` or `2.13.0-pre-sha7`
and are published to scala-integration (no longer scala-release-temp).
scala-release-temp is still used in the bootstrap script for publishing intermediate
artifacts (starr, locker).
Various cleanups in the scripts.
|
|\ \ \
| | | |
| | | | |
Avoid compiler crash with missing transitive dependencies
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Although this is cheap, when debugging log output of info
transformer activity this was a major source of noise.
This commit avoids the info lookup for methods other
than `+`, and then for `+` uses the typer phase info
to distinguish concatentation from addition.
|
|\ \ \ \
| |_|/ /
|/| | | |
Improved error messages for identically named, differently prefixed types
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Gaze deeper for errors before committing to conversion
of assignment to update. The error buried in the transformed
tree escapes notice of retypechecking and leaks to backend.
|
|\ \ \ \
| | | | |
| | | | | |
Fix regression introduced by 5751763
|
| | |_|/
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
enterClass/Module may return an existing symbol, but in 5751763 the return value was dropped leading to assertion failures. This may show up only in the presentation compiler, which explains why it went unnoticed.
Here's what needs to happen:
- a class with a companion is loaded by the IDE, but the class name is different than the file name. This is from source
- the same class and companion object exist as binary, and are loaded from classfiles when the package is completed (since they have different names than the source file, the classpath abstraction will only "know" that there is a classfile, and no corresponding source file)
It seems that companionClass always prefers to return the companion defined in a source file, but if this assertion is called from the code path that tries to load the binary version, the newly created module will not match.
|
| | | | |
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix erasure of the qualifier of ##
|
| | |/ /
| |/| | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-10194: Fix abstract type resolution for overloaded HOFs
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Types in the applicable overload alternatives need to be seen from
the respective owners of the individual alternative, not from the
target’s owner (which can be a subtype of the types that define the
methods).
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Refactor lookupCompanion
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | | |
- Check for module class up front to use sourceModule
- Consolidate most of the logic in Contexts
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-10190 Elide string to empty instead of null
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Avoid NPE when eliding string-valued functions.
For example, `log(s"$cheap$expensive")` needn't print null.
This is a natural and inexpensive way to elide strings.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-9881 Fix ImportHandler's reporting of importedNames and importedSymbols
|
| | |_|_|/ /
| |/| | | | |
|
|\ \ \ \ \ \
| |_|_|_|_|/
|/| | | | | |
SI-10133 Require escaped single quote char lit
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Folks from other languages might mistakenly enclose
a string in single quotes. Since this presents as
a symbol literal followed by the unpaired single
quote, we can add a syntax reminder.
Also polish the wording for bad string
interpolation.
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The spec specifically requires `'\''` and not `'''`.
The error consumes all consecutive single quotes.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Faster and simpler Java 9 classpath implementation
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Take advantage of the `/packages` index provided by the
jrt file system to avoid (expensive) Files.exist for
non-existent entries across the full list of modules.
- Extends ClassPath directly which leads to a simpler
implemnentation that using the base class.
- Add a unit test that shows we can read classes and packages
from the Java standard library.
Fixes scala/scala-dev#306
With this change bootstrap time under Java 9 was comparable to
Java 8. Before, it was about 40% slower.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-10178 Route reporter.echo to stdout
|
| | |_|_|_|/
| |/| | | |
| | | | | |
| | | | | |
| | | | | | |
`echo` is currently used only for usage information, and that makes a lot more sense to
go to stdout instead of stderr. This allows grepping through the extensive list of
compiler options.
|
| |_|_|_|/
|/| | | |
| | | | |
| | | | | |
The test for non-zero must recognize `-0e+00f` and variants.
|
|\| | | | |
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
janekdb/topic/2.12.x-scaladoc-spelling-corrections-2
Fix typos in compiler and reflect
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Miscellania:
Miscellania is a small island off the northernmost part
of the Fremennik Isles - RunScape Wiki
Miscellanea:
A collection of miscellaneous objects or writings - Merriam-Webster
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-10148 Follow Java for float literals
|
| | | |_|/ /
| | |/| | |
| | | | | |
| | | | | |
| | | | | | |
Use `Float.parseFloat` instead of converting from Double.
Error when a value rounds to zero.
|
| |\ \ \ \ \
| | | | | | |
| | | | | | | |
SI-9636 More precise error pos on apply inference
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
If a method type arg is inferred Any, warn about the
function and not the innocent arg.
|