| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-6961 no structural sharing in list serialization
|
| |
| |
| |
| |
| |
| |
| | |
Revert list serialization back to what it was in 2.9.x and before.
Partial revert of a6fcd70b60 e234978dfd, which fixed SI-5374.
The ListBuffer part of the fix remains in place.
|
|\ \
| | |
| | | |
SI-6187 Make partial functions re-typable
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- `New(tpe)` doesn't survive a `resetAttrs` / typecheck; use
a name instead.
- Abandon the tree attachment that passed the default
case from `typer` to `patmat`; this tree eluded the
attribute reset performed in the macro. Instead, add it
to the match. Apart from making the tree re-typable, it
also exposes the true code structure to macros, which
is important if they need to perform other code
transformations.
- Install original trees on the declared types of the
parameters of the `applyOrElse` method to ensure that
references to them within the method pick up the correct
type parameter skolems upon retypechecking.
- Propagate `TypeTree#original` through `copyAttrs`,
which is called during tree duplication / `TreeCopiers`.
Without this, the original trees that we installed were
not visible anymore during `ResetAttrs`.
We are not able to reify partial functions yet -- the
particular sticking point is reification of the parentage
which is only available in the `ClassInfoType`.
|
|\ \ \
| | | |
| | | | |
SI-6146 More accurate prefixes for sealed subtypes.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
When analysing exhaustivity/reachability of type tests
and equality tests, the pattern matcher must construct
a set of sealed subtypes based on the prefix of the
static type of and the set of sealed descendent symbols
of that type.
Previously, it was using `memberType` for this purpose.
In simple cases, this is sufficient:
scala> class C { class I1; object O { class I2 } }; object D extends C
defined class C
defined module D
scala> typeOf[D.type] memberType typeOf[C#I1].typeSymbol
res0: u.Type = D.I1
But, as reported in this bug, it fails when there is an
additional level of nesting:
scala> typeOf[D.type] memberType typeOf[c.O.I2 forSome { val c: C }].typeSymbol
res5: u.Type = C.O.I2
This commit introduces `nestedMemberType`, which uses `memberType`
recursively up the prefix chain prefix chain.
scala> nestedMemberType(typeOf[c.O.I2 forSome { val c: C }].typeSymbol, typeOf[D.type], typeOf[C].typeSymbol)
res6: u.Type = D.O.Id
|
|\ \ \ \
| | | | |
| | | | | |
SI-7070 Turn restriction on companions in pkg objs into warning
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The implementation restriction created from SI-5954 in
3ef487ecb6733bfe3c13d89780ebcfc81f9a5ea0 has two problems.
1) The problematic code works fine if compile with sbt. That means the
restriction is breaking some people needlessly.
2) It's not binary compatible.
To fix all that this commit changes the error into a warning and removes
the setting used to get around the restriction.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5082 Cycle avoidance between case companions
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
We can synthesize the case companion unapply without forcing
the info of the case class, by looking at the parameters in
the `ClassDef` tree, rather than at `sym.caseFieldAccessors`.
Access to non-public case class fields routed through the
already-renamed case accessor methods. The renamings are
conveyed via a back-channel (a per-run map, `renamedCaseAccessors`),
rather than via the types to give us enough slack to avoid
the cycle.
Some special treatment of private[this] parameters is needed
to avoid a misleading error message. Fortunately, we can
determine this without forcing the info of the case class,
by inspecting the parameter accessor trees.
This change may allow us to resurrect the case class ProductN
parentage, which was trialled but abandoned in the lead up
to 2.10.0.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7100 Fixed infinite recursion in duplicators
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-6113 typeOf now works for type lambdas
|
| | |_|/ / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
It's not a problem to have an abstract type symbol in a ground type tag
if that symbol is defined in the type being reified.
This mechanics was already built in for existentials, now we extend it to
include type params of poly types.
Credit goes to @katefree
|
|\ \ \ \ \ \ \
| |_|_|_|_|_|/
|/| | | | | | |
SI-6888 Loosen criteria for $outer search.
|
| | |_|_|/ /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In order to cater for nested classes with names that end
with '$', which lead to ambiguity when unmangling expanded
names.
In:
class X { object $ }
We end up with:
orginalName(X$$$$$outer) = $$$outer
This change modifies `outerSource` to consider that to be
and outer accessor name. It is a piecemeal fix, and no doubt
there are other nasty surprises in store for those inclined to
flash their $$$ in identifier names, but the method changed is
not used widely and this solves the reported problem.
SI-2806 remains open to address the deeper problem.
|
|\ \ \ \ \ \
| |_|_|_|_|/
|/| | | | | |
SI-7026 Asking for a parse tree will now never result in a typed tree
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This commit fixes ticket SI-7026. This makes it safe to use
parseTree outside of the presentation compiler thread.
Solved it with an implementation that just parses the source every
time without trying to memorize anything. Added tests that checks
that
1. You get a new parse tree every time you ask for one.
2. You always get a parse tree, never a typed tree.
3. A parse tree should never contain any symbols or types [1].
4. If you ask for a parse tree and then ask for a typed tree it
shouldn't change the parse tree you originally asked for, i.e.
property 3 still holds.
Additionally the parser is now only interruptible when running
on the presentation compiler thread.
[1] There is an exception to this though. Some of the nodes that
the compiler generates will actually contain symbols. I've
chosen to just ignore these special cases for now.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
Add a request to presentation compiler to fetch doc comment information.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Refactor scaladoc base functionality to allow it to be mixed in with Global in the IDE.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
[nomaster] SI-7064 Reflection: forward compat for 2.10.1
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Makes sure that the compiler understands the 2.10.0 format of super
constructor calls after the recent revert from the typemacro-compatible
format.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This reverts commit 40063b0009d55ed527bf1625d99a168a8faa4124.
Conflicts:
src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This reverts commit 0ebf72b9498108e67c2133c6522c436af50a18e8.
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/reflect/scala/reflect/internal/Trees.scala
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This reverts commit 838cbe623c142b7005446793948097f679219fe3.
Conflicts:
src/reflect/scala/reflect/api/Trees.scala
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This reverts commit bb9adfbd76af0a0281912fcef4bcaca409a7c9a3.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This reverts commit 2621918870e531b7a9bcccdf14bddea9b89804b2.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
That method was unnecessary in the first place, because we already had
emptyValDef in scala.reflect.api.Trees: https://github.com/scala/scala/blob/v2.10.0/src/reflect/scala/reflect/api/Trees.scala#L2367.
That's a rudiment from the times when we were unsure what to put into
scala.reflect.base and what goes into scala.reflect.api.
Unfortunately, it's not just a harmless extraneous method. Reifier v2.10.0
emits `u.build.emptyValDef` when it needs to reify `emptyValDef`. Therefore
we need to restore it to be forward compatible.
However we don't need to rollback the changes to the reifier v2.10.1,
which now simply calls `u.emptyValDef`, because, as mentioned above,
that `emptyValDef` was already there in v2.10.0.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This forward compatibility fix is very easy. Have a new method in 2.10.1?
Don't expose it in the public API, and you won't have any problems.
|
| | |_|_|/ /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
NonemptyAttachments in macro API used to be Attachments$NonemptyAttachments.
However it's private, so noone outside scala.reflect.macros can access it,
making it ineligible for the incompatibility criterion.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
[nomaster] Revert "SI-5017 Poor performance of :+ operator on Arrays"
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | | |
This reverts commit 02b2da63409af6a28824cbb74d00d0ec04518c8d.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
[nomaster] SI-6773 Makes the SI-6150 changes binary compatible with 2.10
|
| | |_|_|/ /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The back ported fix of SI-6150 1f0e4880ad7ad816fd82c04f6814c5b165f86981
broke binary compatibility. This commit fixes that by removing the
IndexedSeqFactory class and copy/pasting its one method around to
everything that extended it then re-adds some inner
classes needed by the binary compatibility checker.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
SI-7060 More conservative dead code elim marking
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
In dead code elimination, a DROP instruction that gets marked as useful
and can be reached via several paths needs to also mark all the reaching
definitions as useful, else we'll get unbalanced stacks on the two paths.
A simplistic example:
```
BB1:
CALL X // useful, leaves a LONG on the stack
JUMP BB3
BB2:
LOAD_FIELD Y // not useful
JUMP BB3
BB3:
DROP LONG // useful because "CALL X" is useful
// but unless we mark "LOAD_FIELD Y" as useful too
// we'll get unbalanced stacks when reaching BB3
```
This patch addresses the unbalanced stack problem by adding all the
reaching definitions of a useful DROP as useful instructions too.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-7039 unapplySeq result type independent of subpattern count
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Fixes a bug in the implementation of the `unapplySeq` part of the spec below.
An `unapply` method with result type `R` in an object `x` matches the
pattern `x(p_1, ..., p_n)` if it takes exactly one argument and, either:
- `n = 0` and `R =:= Boolean`, or
- `n = 1` and `R <:< Option[T]`, for some type `T`.
The argument pattern `p1` is typed in turn with expected type `T`.
- Or, `n > 1` and `R <:< Option[Product_n[T_1, ..., T_n]]`, for some
types `T_1, ..., T_n`. The argument patterns `p_1, ..., p_n` are
typed with expected types `T_1, ..., T_n`.
An `unapplySeq` method in an object `x` matches the pattern `x(p_1, ..., p_n)`
if it takes exactly one argument and its result type is of the form `Option[S]`,
where either:
- `S` is a subtype of `Seq[U]` for some element type `U`, (set `m = 0`)
- or `S` is a `ProductX[T_1, ..., T_m]` and `T_m <: Seq[U]` (`m <= n`).
The argument patterns `p_1, ..., p_n` are typed with expected types
`T_1, ..., T_m, U, ..., U`. Here, `U` is repeated `n-m` times.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-5833 Fixes tail-of-Nil problem in RefinedType#normalizeImpl
|
| | |_|_|_|/
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
RefinedType#normalizeImpl was checking to see if the flattened list of
parents had an empty tail then pulling the head if so. But if the list
was empty then boom. This fix makes it check if the whole list has
length 1 instead. Empty lists will flow through to the rest the logic
which has no problems with Nil.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
[nomerge] SI-6667 Demote a new ambiguity error to a lint warning.
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In the interests of not breaking source compability.
A few projects are relying on this bug.
Should not be merged to master.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-6017 Scaladoc: Fix dangling links on index.html
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Use <span> instead of <a href="..."> if there is no page on the letter.
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
There is no reason to do it in JavaScript.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Fix SI-6578. Deprecated `askType` because of possible race conditions in...
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
type checker.
AskType triggers type-checks the given source and returns a typed tree. If that
source is already loaded (a precondition), the background compilation loop may actually
be compiling that same source. The new type checker run may then get into an inconsistent
state and try to add twice the same synthetic members, like `canEqual`.
Most of the times, `askLoadedTyped` (that waits for the type checker to finish, and
returns the most recent typed tree) *is* the right way to go.
Removed occurrences of the deprecated method in tests and interactive.REPL.
@reviewby @huitseeker,@odersky
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-7008 @throws annotations are now populated in reflect
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
As per Jason's comment: How are Scala classes containing @throws annots
treated? I can't figure out whether we pickle the annotation in addition
to adding the exception to the signature. If we do, might we end up with
duplicate annotations in runtime reflection? This warrants a test.
See the context of the discussion here: https://github.com/scala/scala/pull/2040/files#r2874769.
No, we won't end up with duplicates, because classes defined in Scala
are loaded in a different completer. But I'll add a test - you can never
have too many of those.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
https://github.com/scala/scala/pull/2040
|