| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-7592 Remove scala.tools.nsc.util.MultiHashMap
|
| | |
|
|\ \
| | |
| | | |
SI-7174 Fix initialization issues
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Without constant inlining, the compiler would not even bootstrap
because it depends on constant inlining hiding initialization issues
which would cause a NPE otherwise.
In this case, global is null at runtime, but no NPE is happening
despite accessing members of global (see SubComponent), because
constant inlining has copied the values of those members to the
call-sites and eliminated the dereference of global.
This commit fixes the initialization order.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The failure was caused by recent refactoring that moved fields that are
expected by reflection Reifier from early init block to the body of the
class. According to checkinit this may cause initialization issues
although they do not really happen in real life as most of these fields
aren't used during quasiquotes' reification.
|
| | |
| | |
| | |
| | | |
This reverts commit 71fb0b83a, which itself reverted the fix for SI-6812.
|
|\ \ \
| | | |
| | | | |
SI-4594 Repl settings command
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Previously, multi-valued settings (String- and Phase- valued) could be
augmented but not cleared. Also, phase settings included lazily cached
values that were not recomputed when the setting was changed.
|
|\ \ \ \
| | | | |
| | | | | |
Quasiquotes
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
10229316db allowed macro impls to take and return values of type c.Tree
in addition to the usual c.Expr. However it didn't take into account that
it is often useful to return subtypes of trees (e.g. with quasiquotes
that expand into expressions typed as precisely as possible). This patch
fixes that oversight.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Reintroduces treeBuilder at its old location (Global.treeBuilder) by
routing it from the new location (Parsers.treeBuilder) for the sake of
being friendly to tools that might depend on it.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Adds a macro hook into the unapply part of `doTypedApply`, provides
`macroExpandUnapply` in the macro engine and applies a couple of minor
refactorings along the way (renames the ugly `macroExpand1` into
oblivion, changes the ctor of `Fingerprint` to be private and upgrades
`MacroRole` from a string to a value class).
Unapply macros haven't been approved for inclusion in 2.11.0, however
they are necessary for pattern-matching quasiquotes. Therefore I'm only
allowing them to expand for QuasiquoteClass_api_unapply.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- Additions to the reflection API:
- The Quasiquotes implicit class that defines `q`, `tq`, `pq` and `cq`
interpolators which now become a part of the `scala.reflect.api.
Universe`.
- Implementations of the interpolators are macro-based
and are hardwired through `FastTrack`.
- The `Liftable` class and the `StandardLiftables` slice of the cake
that provide a type class and a bunch of its instances that allow
to easily splice user-defined types into quasiquotes.
- Additional methods in `BuildUtils` that are used by the quasiquote
macro to generate trees, notably:
- `SyntacticClassDef`. An extractor/constructor that allows to
construct and deconstruct classes using arguments that mirror
syntactic form of ClassDefs (e.g. constructor outside of the
body).
- `TupleN`, `TupleTypeN`. Extractor/constructor for easy
construction of ast that represents a tuple term or type
with given amount of elements.
- Actual implementation of quasiquotes in the `scala.tools.reflect.
quasiquotes` package which is organized into a cake called
`Quasiquotes` with slices introducing core abstractions necessary to
splice into Scala syntax, routines for interfacing with the parser,
and customized reifiers for tree construction and deconstruction.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Quasiquoting macros are surprisingly similar to reifying macros, since
both take something and then produce Scala ASTs for that something.
Therefore the upcoming quasiquote patch reuses the vanilla reifier,
adjusting it in key points to enable splicing and extraction to
support string interpolation syntax.
In this commit we prepare the reifier for being reused later on,
adding a modest amound of extensibility hooks.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This routine is going to be necessary in scala-reflect.jar to support
ClassDef construction/deconstruction in the upcoming quasiquote patch.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This is the second of the two patches to the parser necessary for
quasiquotes to function.
This one applies just a couple of minor changes to the way parser works,
so that quasiquotes will be able to extend it to support some
corner cases arising from splicing (see the subsequent quasiquote commit
for more details).
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This is the first of the two patches to the parser necessary for
quasiquotes to function.
This one moves TreeBuilder from Global to the internals of the Parsers,
so that quasiquotes will be able to override it later to support some
corner cases arising from splicing (see the subsequent quasiquote commit
for more details).
Surprisingly enough, almost noone used TreeBuilder outside the parser,
and it was necessary to move just a couple of methods to TreeGen to
satisfy broken dependencies.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6574 Support @tailrec for extension methods.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Currently, when the body of an extension method is transplanted
to the companion object, recursive calls point back to the original
instance method. That changes during erasure, but this is too late
for tail call analysis/elimination.
This commit eagerly updates the recursive calls to point to the
extension method in the companion. It also removes the @tailrec
annotation from the original method.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
SI-7638 Superaccessor lookup after specialization
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The crash was caused by a symbol lookup to rewire the super calls,
done after pickler, but specialization added new traits and new
members, thus making the super rewiring impossible. To avoid such
problems, this patch moves symbol lookup after specialization,
so the changes done by specialization (and miniboxing) become
visible to mixin.
Review by @adriaanm or @retronym.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Separate jars for XML, Parser Combinators. Use released JLine.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Notes:
- no longer specifying terminal by class name in scripts (using 'unix')
- jline doesn't need a separate jansi dependency;
it includes its own version according to:
http://mvnrepository.com/artifact/jline/jline/2.11
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Summary:
- Remove the last vestiges of xml from Predef and Contexts.
- Change build to compile scala.xml to scala-xml.jar.
- Deploy scala-xml module to maven.
- Update partest accordingly.
Note:
An older compiler cannot use the new standard library to
compile projects that use XML. Thus, skipping locker will
break the build until we use 2.11.0-M4 for STARR.
In the future build process, where we drop locker,
we would have to release a milestone that supports the old
and the new approach to xml. As soon as we'd be using that
new milestone for starr, we could drop support for the old approach.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
SI-6221 inference with Function1 subtypes.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
There appears to be no upper bound on the number of places
we have to remove calls to typeSymbol and introduce calls to
baseType. This one was type inference for function parameter
types: worked when expected type was A => B, but not if there
was an implicit conversion from A => B to the expected type.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Move some code from s.t.n.io to s.t.n.interactive
|
| | |_|_|/ /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The only usages of scala.tools.nsc.io.{Lexer,Pickler,PrettyWriter,
Replayer} can be found in scala.tools.nsc.interactive.
Let's move those files closer to their dependencies.
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
SI-7582 Only inline accessible calls to package-private Java code
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Two problems here.
The inliner was using `isPrivate` / `isProtected` to determine access.
The fallthrough considered things to be (bytecode) public. This is okay
in practice for Scala code, which never emits package private code.
Secondly, we must check accessibility of the called symbol *and* its
owner. This case is tested in `run/t7582b`.
This commit tightens the check for Java defined symbols: a) check the owner,
and b) don't assume that `! isPrivate` is accessible.
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The `privateWithin` attribute of Java companion module classes was
correctly set under joint compilation (ie, when using JavaParser),
but not under separate compilation.
This commit remedies this. The test covers variety of Java symbols.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
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
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Lint-like fixes found by Semmle
|
| | | | | | |
|
| | | | | | |
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Merge 2.10.x into master
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Namers.scala
src/partest/scala/tools/partest/PartestTask.scala
|
| | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-7603 Speculative fix for annotation binding error
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Reports of:
error: trait Test is abstract; cannot be instantiated
11:09:50 [ant:scalac] @Test def testClientRequestNum = {
11:09:50 [ant:scalac] ^
Suggest that the deferred processing of a LazyAnnotationInfo is binding
the identifier `Test` to the wrong symbol. Inspection of the code shows
that the closure also defers capture of the (mutable) field
`Namer#typer.context`.
This commit captures the context eagerly, and adds logging to let us
know if that eagerly captured context ever differs from the its value
at the point when the annotation info is forced.
I spent a few hours trying to craft a test to back this up, but to no
avail. Here's what the log output will look like:
[log typer] The var `typer.context` in scala.tools.nsc.typechecker.Namers$NormalNamer@1f5ebb08 was mutated before the annotation new a() was forced.
current value = Context(C@Import unit=<console> scope=123861466 errors=false, reportErrors=true, throwErrors=false)
original value = Context(C@Import unit=<console> scope=123861466 errors=false, reportErrors=true, throwErrors=false)
This confirms the hypothesis for the cause of SI-7603. If you see this message, please comment on that ticket.
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
SI-7344 Specialize methods in private scopes
|
| | | |/ / / / / /
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
This performs method specialization inside a scope other than a {class,
trait, object}: could be another method or a value. This specialization
is much simpler, since there is no need to record the new members in
the class signature, their signatures are only visible locally.
It works according to the usual logic:
- we use normalizeMember to create the specialized symbols
- we leave DefDef stubs in the tree that are later filled in by tree
duplication and adaptation
The solution is limited by SI-7579: since the duplicator loses the sym
annotations when duplicating, this expansion and rewiring can only take
place in code that has not been subject to duplication. You can see the
test case for an example.
Review by @dragos, @paulp or @axel22.
|
| |\| | | | | | |
| | |_|_|_|_|_|/
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
src/library/scala/concurrent/Future.scala
test/files/jvm/scala-concurrent-tck.scala
|
| | |\ \ \ \ \ \
| | | |/ / / / /
| | |/| | | | | |
SI-7571 Allow nesting of anonymous classes in value classes
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
5d9cde105e added deep prohibition of nested classes within
a value class. This has the undesirable side effect of
prohibiting partial functions literals in method bodies
of a value class.
The intention of that prohibition was to avoid problems
in code using Type Tests, such as:
class C(val inner: A) extends AnyVal {
class D
}
def foo(a: Any, other: C) = a match { case _ : other.D }
Here, the pattern usually checks that `a.$outer == other`.
But that is incongruent with the way that `other` is erased
to `A`.
However, not all nested classes could lead us into this trap.
This commit slightly relaxes the restriction to allow anonymous
classes, which can't appear in a type test.
The test shows that the translation generates working code.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Specialization rewires class parents during info transformation, and
the new info then guides the tree changes. But if a symbol is created
during duplication, which runs after specialization, its info is not
visited and thus the corresponding tree is not specialized.
One manifestation is the following:
```
object Test {
class Parent[@specialized(Int) T]
def spec_method[@specialized(Int) T](t: T, expectedXSuper: String) = {
class X extends Parent[T]()
// even in the specialized variant, the local X class
// doesn't extend Parent$mcI$sp, since its symbol has
// been created after specialization and was not seen
// by specialzation's info transformer.
...
}
}
```
We can fix this by forcing duplication to take place before specialization.
Review by @dragos, @paulp or @axel22.
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
It was never used since its introduction in 3ee6b3653 by @dragos.
Review by @dragos or @axel22 or @paulp.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7591 Migrate command-line parsing to s.t.cmd
|