| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously, handy `sys.BooleanProp.keyExists` ignored the
property value. While trying not to make any real estate puns,
this commit will let it go false if a value is supplied that
is not true in the usual Java sense. But what is truth?
Allows `scala -Dscala.color=off`, for example.
|
|\ \ \ \
| | | | |
| | | | | |
Spec: Add lost references, cleanup
|
| | |_|/
| |/| | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-9359 Fix InnerClass entry flags for nested Java enums
|
| | | | | |
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The access flags in InnerClass entries for nested Java enums were
basically completely off.
A first step is to use the recently introduced backend method
`javaClassfileFlags`, which is now moved to BCodeAsmCommon.
See its doc for an explanation.
Then the flags of the enum class symbol were off. An enum is
- final if none of its values has a class body
- abstract if it has an abstract method
(https://docs.oracle.com/javase/specs/jls/se7/html/jls-8.html#jls-8.9)
When using the ClassfileParser:
- ENUM was never added. I guess that's just an oversight.
- ABSTRACT (together with SEALED) was always added. This is to
enable exhaustiveness checking, see 3f7b8b5. This is a hack and we
have to go through the class members in the backend to find out if
the enum actually has the `ACC_ABSTRACT` flag or not.
When using the JavaParser:
- FINAL was never added.
- ABSTRACT was never added.
This commit fixes all of the above and tests cases (Java enum read
from the classfile and from source).
|
|\ \ \ \
| |_|_|/
|/| | | |
SI-9253 avoid IndexOutOfBoundsException in TypeMaps.correspondingTypeArgument
|
|/ / / |
|
|\ \ \
| |_|/
|/| | |
Fix 36 typos (d-f)
|
|/ / |
|
|\ \
| | |
| | | |
Pin to non-crashy redcarpet
|
|/ / |
|
|\ \
| | |
| | | |
Corral, shade & embed jline.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As usual, the repl will use whatever jline 2 jar on the classpath,
if there is one. Failing that, there's a fallback and an override.
If instantiating the standard `jline.InteractiveReader` fails,
we fall back to an embedded, shaded, version of jline,
provided by `jline_embedded.InteractiveReader`.
(Assume `import scala.tools.nsc.interpreter._` for this message.)
The instantiation of `InteractiveReader` eagerly exercises jline,
so that a linkage error will result if jline is missing or if the
provided one is not binary compatible.
The property `scala.repl.reader` overrides this behavior, if set to
the FQN of a class that looks like `YourInteractiveReader` below.
```
class YourInteractiveReader(completer: () => Completion) extends InteractiveReader
```
The repl logs which classes it tried to instantiate under `-Ydebug`.
# Changes to source & build
The core of the repl (`src/repl`) no longer depends on jline.
The jline interface is now in `src/repl-jline`.
The embedded jline + our interface to it are generated by the `quick.repl` target.
The build now also enforces that only `src/repl-jline` depends on jline.
The sources in `src/repl` are now sure to be independent of it,
though they do use reflection to instantiate a suitable subclass
of `InteractiveReader`, as explained above.
The `quick.repl` target builds the sources in `src/repl` and `src/repl-jline`,
producing a jar for the `repl-jline` classes, which is then transformed using
jarjar to obtain a shaded copy of the `scala.tools.nsc.interpreter.jline` package.
Jarjar is used to combine the `jline` jar and the `repl-jline` into a new jar,
rewriting package names as follows:
- `org.fusesource` -> `scala.tools.fusesource_embedded`
- `jline` -> `scala.tools.jline_embedded`
- `scala.tools.nsc.interpreter.jline` -> `scala.tools.nsc.interpreter.jline_embedded`
Classes not reachable from `scala.tools.**` are pruned, as well as empty dirs.
The classes in the `repl-jline` jar as well as those in the rewritten one
are copied to the repl's output directory.
PS: The sbt build is not updated, sorry.
PPS: A more recent fork of jarjar: https://github.com/shevek/jarjar.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Code that depends on jline is now in package `scala.tools.nsc.interpreter.jline`.
To make this possible, remove the `entries` functionality from `History`,
and add the `historicize` method. Also provide an overload for `asStrings`.
Clean up a little along the way in `JLineHistory.scala` and `JLineReader.scala`.
Next step: fall back to an embedded jline when the expected jline jar
is not on the classpath.
The gist of the refactor: https://gist.github.com/adriaanm/02e110d4da0a585480c1
|
|\ \ \
| |_|/
|/| | |
SI-8930 - Vector updated, +:, and :+ slow when typed as Seq[A]
|
| | |
| | |
| | |
| | |
| | |
| | | |
Vector was intercepting only the IndexedSeq CanBuildFrom to quickly generate new vectors. Now it intercepts immutable.Seq and collection.Seq as well.
There are other possibilities (collection.IndexedSeq), but they will probably arise rarely, and to avoid an absurdly long set of checks we would need a marker trait (that is not binary compatible).
|
|\ \ \
| | | |
| | | | |
Fix some typos (a-c)
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I just used text search to check whether there are no more typos like
these corrected by janekdb, and by the way fixed also some other ones
which I saw.
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
Fix illegal inlining of instructions accessing protected members
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
There were two issues in the new inliner that would cause a
VerifyError and an IllegalAccessError.
First, an access to a public member of package protected class C can
only be inlined if the destination class can access C. This is tested
by t7582b.
Second, an access to a protected member requires the receiver object
to be a subtype of the class where the instruction is located. So
when inlining such an access, we need to know the type of the receiver
object - which we don't have. Therefore we don't inline in this case
for now. This can be fixed once we have a type propagation analyis.
https://github.com/scala-opt/scala/issues/13.
This case is tested by t2106.
Force kmpSliceSearch test to delambdafy:inline
See discussion on https://github.com/scala/scala/pull/4505. The issue
will go away when moving to indy-lambda.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-7773 Restore phase id to icode filename
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Having icode output files of the form `X-24.icode` went in and
out of style using the long-form phase name because it broke
the windows nightly build somehow. Here's hoping using just the
phase id works on this year's infrastructure.
As previously, the long name is still available under `-Ydebug`,
because why not debug.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Doc fixes
|
| | | | | | | |
|
| | | | | | | |
|
| |/ / / / / |
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
SI-9354 ScalaDoc members added via by-name view
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Eligible views were looked up by exact from type without
including the by-name dodge.
By-name views are now included without consideration whether
ScalaDoc processes possible duplicates correctly.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
fix BigDecimal losing MathContext
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
|\ \ \ \ \
| | | | | |
| | | | | | |
[sbt] Allow the REPL to be run from the SBT build
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
- Tell SBT to that we're forking an interactive process
- Automatically add `-usejavacp` so the REPL adds the classes
from the system classloader to the compilers classpath.
JLine seems to be working from within this setup.
```
% sbt
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=384m; support was removed in 8.0
[info] Loading global plugins from /Users/jason/.sbt/0.13/plugins
[info] Loading project definition from /Users/jason/code/scala2/project
[info] *** Welcome to the sbt build definition for Scala! ***
[info] This build definition has an EXPERIMENTAL status. If you are not
[info] interested in testing or working on the build itself, please use
[info] the Ant build definition for now. Check README.md for more information.
> repl/run
[info] Running scala.tools.nsc.MainGenericRunner -usejavacp
Welcome to Scala version 2.11.6-SNAPSHOT-20150528-131650-70f0b1ded8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_25).
Type in expressions to have them evaluated.
Type :help for more information.
scala> 1 + 1
res0: Int = 2
(reverse-i-search)`1': 1 + 1
```
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Fix missing quotes in EBNF of type alias
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-9356 more careful assertion in back-end
|
| | |_|_|_|_|/
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Calling `exists` on a `Symbol` triggers unpickling,
which failed for reasons I did not investigate.
Replaced `sym.exists` by `sym != NoSymbol`, which is good enough here.
Also replaced assertion by a `devWarning`, since the
logic seems too ad-hoc to actually crash the compiler when it's invalidated.
Partially reverts b45a91fe22. See also #1532.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Improve API documentation for ListBuffer and Try
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
spec: Add 'Default Arguments' heading, sentence, example
|
| | |_|/ / / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | | |
The sentence and the accompanying example were stolen from SID-1.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-9348 Fix missing last element in exclusive floating point ranges
|
| | |_|/ / / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Fix exclusive floating point ranges to contain also the last element
when the end-start difference is not an integer multiple of step.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Fix toolbox with varargs constructors
|
| | |/ / / / / /
| |/| | | | | |
| | | | | | | |
| | | | | | | | |
It was already working for methods, but not for constructors.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-8254 List SerializationProxy fails to default(Read/Write)Object
|