| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
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-9750 scala.util.Properties.isJavaAtLeast works with JDK9
|
| |
| |
| |
| |
| | |
Formatting suppressed exceptions required reflection for platform
compatibility. No longer, since Java 8 is assumed. Minor tidying.
|
|/ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example output below. Note that inlining List.map fails because the
trait forwarder uses `INVOKESPECIAL` for now, will change with pr 5177.
$ cat Test.scala
class C {
def foo = Map(1 -> 'a', 2 -> 'b')
def bar(l: List[Int]) = l.map(_ + 1)
}
$ qsc -Yopt-log-inline _ -Yopt:l:classpath Test.scala
Inlining into C.foo (initially 36 instructions, ultimately 72):
- Inlined scala/Predef$ArrowAssoc$.$minus$greater$extension (8 instructions) 2 times: the callee is annotated `@inline`
Inlining into C.bar (initially 12 instructions, ultimately 12):
- Failed to inline scala/collection/immutable/List.map (the callee is a higher-order method, the argument for parameter (bf: Function1) is a function literal): The callee scala/collection/immutable/List::map(Lscala/Function1;Lscala/collection/generic/CanBuildFrom;)Ljava/lang/Object; contains the instruction INVOKESPECIAL scala/collection/TraversableLike.map (Lscala/Function1;Lscala/collection/generic/CanBuildFrom;)Ljava/lang/Object;
that would cause an IllegalAccessError when inlined into class C.
|
|\
| |
| | |
Remove legacy recursive classpath implementation
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
|
| |
Implicit conversions are now in package convert as ImplicitConversions,
ImplicitConversionsToScala and ImplicitConversionsToJava.
Deprecated WrapAsJava, WrapAsScala and the values in package object.
Improve documentation.
|
|
|
|
|
|
| |
:require was re-incarnated in https://github.com/scala/scala/pull/4051,
it seems to be used by the spark repl. This commit makes it work when
using the flat classpath representation.
|
|\
| |
| | |
unset inappropriate execute bits
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I imagine these date back to old Subversion days and are probably the
result of inadvertent commits from Windows users with vcs client
configs.
having the bit set isn't really harmful most of the time,
but it's just not right, and it makes the files stand out in directory
listings for no reason
|
|/
|
|
|
|
|
| |
For each URL
- Where it redirected the target of the redirection was used
- Where is no longer existed a replacement was selected
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit corrects many typos found in scaladocs, comments and
documentation. It should reduce a bit number of PRs which fix one
typo.
There are no changes in the 'real' code except one corrected name of
a JUnit test method and some error messages in exceptions. In the case
of typos in other method or field names etc., I just skipped them.
Obviously this commit doesn't fix all existing typos. I just generated
in IntelliJ the list of potential typos and looked through it quickly.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The part of the functionality of a ClassPathContext has been moved
to the base trait ClassPathFactory so it can be reused by the newly
created FlatClassPathFactory. This new implementation works in
similar manner as the ClassPathContext with this difference that it
just creates instances of flat classpath.
This change doesn't modify the behaviour of the compiler as the
interface and the way ClassPathContext works didn't change. Moreover
FlatClassPathFactory is currently unused.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The method asClasspathString is now deprecated. Moreover it's moved
to ClassFileLookup in the case someone was using it in some project
(an alternative classpath also will support it - just in the case).
All its usages existing in Scala sources are changed to
asClassPathString method. The only difference is the name.
Some operations on files or their names are moved from ClassPath to
the newly created FileUtils dedicated to classpath. It will be
possible to reuse them when implementing an alternative classpath
representation. Moreover such allocation-free extension methods like
the one added in this commit will improve the readability.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit is intended to create the possibility to plug in into
the compiler an alternative classpath representation which would be
possibly more efficient, use less memory etc. Such an implementation
- at least at the beginning - should exist next to the currently
existing one and be possible to turn on using a flag.
Several places in the compiler have a direct dependency on the
classpath implementation. Examples include backend's icode generator
and reader, SymbolLoaders, ClassfileParser. After closer inspection,
one realizes that all those places depend only on a very small subset
of classpath logic: they need to lookup classes from classpath. Hence
there's introduced ClassFileLookup trait that encapsulates that
functionality. The ClassPath extends that trait and an alternative
one also must do it.
There's also added ClassRepresentation - the base trait for ClassRep
(the inner class of ClassPath). Thanks to that the compiler uses
a type which is not directly related to the particular classpath
representation as it was doing until now.
|
|
|
|
|
| |
- Moves mergeUrlsIntoClassPath from Global into ClassPath
- Revises and documents AbstractFile.getURL
|
|
|
|
|
|
|
| |
If you look at the implementation of that method and its usage
its clear that it should have been named `findClassFile` from the
beginning because that's what it does: find a class file and
not a source file.
|
|
|
|
|
|
|
|
|
|
|
| |
This is pretty easy, since a ValueSet is a BitSet.
When the setting is updated, recompute the current
set of values, which is cheap and succinct.
Checking a flag is also easy and fast.
Choices in MultiChoiceSettings may enable other choices.
|
|
|
|
|
| |
MultiChoiceSetting and Xlint with its deprecated aliases is now a bit
simpler, but there's still room for improvement, as noted in comments.
|
|
|
|
|
|
|
| |
The problem is that the repl underneath the script engine evaluates input to
val res0..resN, so it is a one shot operation. To allow repetition,
compile(script) now returns a CompiledScript object whose eval method can be
called any number of times.
|
|
|
|
|
|
|
|
| |
Source lines were counted by "line break chars", including FF.
Clients of `pos.line` seem to all expect the ordinary line num,
so that is what they get.
Unicode processing now precedes line ending processing.
|
|
|
|
|
| |
Code which has been deprecated since 2.10.0 and which allowed
for straightforward removal.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
So that they aren't offered as an autocomplete suggestion:
implicit class Shouty(string: String) extends AnyVal {
def SHOUT_! = string.toUpperCase + "!"
}
"". // autocompletion offers `.string` here
The original incarnation of value classes didn't allow this
sort of encapsulation, so we either invented goofy names like
`__thingToAdd` or just picked `x` or `self`. But SI-7859 has
delivered us the freedom to keep the accessor private.
Should we keep any of these accessors around in a deprecated
form?
The implicit classes in Predef were added in 2.11.0-M2
(c26a8db067e4f), so they are okay.
I think we can make reason that these APIs were both accidental
and unlikely to be interpreted as public, so we can break them
immediately.
scala> Left(1).x
res0: scala.util.Either[Int,Int] = Left(1)
scala> import concurrent.duration._
import concurrent.duration._
scala> 1.n
res1: Int = 1
|
| |
|
|\
| |
| |
| |
| | |
sjrd/topic/remove-classpath-logic-dependent-on-inline
Don't avoid to load trait impl .class without inliner.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the inliner is on, it is necessary to load class
files containing the implementation of traits, i.e.,
those ending in $class.class. This is needed to be
able to inline these methods. However it is useless
if the inliner is disabled.
The previous logic avoided to put these files on the
classpath when the inliner was off. However, this
complicates things, and it makes the classpath
mechanism dependent on something totally unrelated.
On this basis, this commit removes that logic, and
instead trait impl .class files are always kept on
the classpath.
|
| |
| |
| |
| |
| |
| |
| | |
Most of this was revealed via -Xlint with a flag which assumes
closed world. I can't see how to check the assumes-closed-world
code in without it being an ordeal. I'll leave it in a branch in
case anyone wants to finish the long slog to the merge.
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Other methods taking the same kind of decisions were already
in ClassPathContext, e.g., isValidName() or, in some sense,
even toBinaryName().
This makes ClassPath itself be completely agnostic of how
particular kinds of files or directories are named.
It also allows to override this logic at the context level.
Without it, overriding this logic required a fair amount of
code duplication from ClassPath.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The handy stack trace truncation in REPL doesn't
show cause like a regular trace.
This commit fixes that and also adds the usual
indicator for truncation, viz, "... 33 more".
The example from the ticket produces:
```
scala> rewrapperer
java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Point of failure
at .rewrapper(<console>:9)
at .rewrapperer(<console>:10)
... 32 elided
Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Point of failure
at .wrapper(<console>:8)
... 34 more
Caused by: java.lang.RuntimeException: Point of failure
at .sample(<console>:7)
... 35 more
```
Suppressed exceptions on Java 7 are handled reflectively.
```
java.lang.RuntimeException: My problem
at scala.tools.nsc.util.StackTraceTest.repressed(StackTraceTest.scala:56)
... 27 elided
Suppressed: java.lang.RuntimeException: Point of failure
at scala.tools.nsc.util.StackTraceTest.sample(StackTraceTest.scala:29)
at scala.tools.nsc.util.StackTraceTest.repressed(StackTraceTest.scala:54)
... 27 more
```
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After the merge, the test/run/t7733 started to fail on Jenkins.
I tried to reproduce it locally but I couldn't so I think it's
system dependent failure. Per @retronym's suggestion I moved it to pending
to not block the whole merge.
Conflicts:
bincompat-backward.whitelist.conf
bincompat-forward.whitelist.conf
src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala
src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala
src/compiler/scala/tools/nsc/typechecker/Macros.scala
src/compiler/scala/tools/nsc/typechecker/Namers.scala
src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
src/compiler/scala/tools/nsc/util/MsilClassPath.scala
src/compiler/scala/tools/reflect/ToolBoxFactory.scala
src/reflect/scala/reflect/internal/ClassfileConstants.scala
src/reflect/scala/reflect/internal/Importers.scala
src/reflect/scala/reflect/internal/Trees.scala
src/reflect/scala/reflect/runtime/JavaMirrors.scala
test/files/run/macro-duplicate/Impls_Macros_1.scala
test/files/run/t6392b.check
test/files/run/t7331c.check
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Previously PackageScopes from scala.reflect ignored all classes that
had $'s in non-rightmost positions in their names.
Unfortunately this behaviour is inconsistent with how scalac does things,
and I reconciled this as usual, by pulling corresponding logic into
scala-reflect.jar and sharing it between runtime reflection and compiler.
This change has seprate pull requests for 2.10.x and 2.11.0. The latter
deprecates `scala.tools.nsc.util.ClassPath.isTraitImplementation`
whereas the former (which you're looking at right now) does not, because
we can't deprecated members in minor releases.
|
| | |
|
| |
| |
| |
| | |
... now that scala.tools.nsc.Phases is gone.
|
|\ \
| | |
| | | |
SI-7592 Remove scala.tools.nsc.util.MultiHashMap
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
Introduces a scoping operator used to temporarily look into the future.
Backs up scanner data before evaluating a block and restores it after.
Not used anywhere, only necessary for the upcoming quasiquote patch
in order to reliably detect and accordingly process holes in quasiquoted
Scala syntax.
|
|\ \
| | |
| | | |
SI-7592 Replace s.t.n.u.TreeSet with s.c.m.TreeSet
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This means
- migrating usages from the compiler-specific implementation to the
one in the standard library
- removing the now unused compiler-specific implementation
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Before this change s.t.n.u.CommandLine was used instead.
Remove command-line options --ansi, --buildmanager, --show-log
which don't have any effect and don't seem to be used anywhere.
|
|/ /
| |
| |
| |
| |
| |
| | |
tools.cmd.CommandLineParser uses a small hand-rolled parser
TODO: replace partest's usage of scala.tools.nsc.util.CommandLine
by scala.tools.cmd.CommandLine
|
| |
| |
| |
| |
| |
| |
| |
| | |
This reverts commit b0758f5cb9d966b940933d48bdbb45d17a80de66.
This commit sent startup time through the roof, at least
in some circumstances (it is presumably related to one's
current working directory.)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Optimistically, this is preparation for a day when we don't
let numeric types drift with the winds. Even without the optimism
it's a good idea. It flushed out an undocumented change in
the math package object relative to the methods being forwarded (a
type is widened from what is returned in java) so I documented
the intentionality of it.
Managing type coercions manually is a bit tedious, no doubt,
but it's not tedious enough to warrant abandoning type safety
just because java did it.
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Its string name was used in ReflectionUtils and became broken after repl
got factored out. This hints that that classloader belongs to where it is
used, i.e. to scala-reflect.jar.
Moreover AbstractFile is defined in scala-reflect.jar, so it's only
logical to also define a derived classloader in scala-reflect.jar.
|
| |
| |
| |
| |
| |
| |
| | |
The symbol loader need not create and populate package
symbols merely because there is a directory somewhere.
Every package created based on the existence of a directory
should contain a classfile, either directly or indirectly.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Confusing, now-it-happens now-it-doesn't mysteries lurk
in the darkness. When scala packages are declared like this:
package scala.collection.mutable
Then paths relative to scala can easily be broken via the unlucky
presence of an empty (or nonempty) directory. Example:
// a.scala
package scala.foo
class Bar { new util.Random }
% scalac ./a.scala
% mkdir util
% scalac ./a.scala
./a.scala:4: error: type Random is not a member of package util
new util.Random
^
one error found
There are two ways to play defense against this:
- don't use relative paths; okay sometimes, less so others
- don't "opt out" of the scala package
This commit mostly pursues the latter, with occasional doses
of the former.
I created a scratch directory containing these empty directories:
actors annotation ant api asm beans cmd collection compat
concurrent control convert docutil dtd duration event factory
forkjoin generic hashing immutable impl include internal io
logging macros man1 matching math meta model mutable nsc parallel
parsing partest persistent process pull ref reflect reify remote
runtime scalap scheduler script swing sys text threadpool tools
transform unchecked util xml
I stopped when I could compile the main src directories
even with all those empties on my classpath.
|
|\ \
| | |
| | | |
Optimize file metadata access
|