| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
This is necessary to maintain binary compatibility with 2.10.0.
|
|
|
|
|
|
|
|
| |
Reworks d526f8bd74.
This is necessary to maintain binary compatibility with 2.10.0.
matchName="scala.collection.mutable.MutableList.tailImpl"
problemName=MissingMethodProblem
|
|
|
|
|
|
|
|
|
| |
Also revert "SI-4664 [Make scala.util.Random Serializable] Add test case"
This reverts commit 0b92073a38f9d1823f051ac18173078bfcfafc8a.
This reverts commit 2aa66bec86fd464712b0d15251cc400ff9d52821.
This is necessary to maintain binary compatibility with 2.10.0.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reverts commit a557a973608a75c7a02f251bbcf49fe6f6b6655e.
This is necessary to maintain binary compatibility with 2.10.0.
Mima says:
matchName="scala.collection.immutable.Range.head"
problemName=IncompatibleResultTypeProblem
The bridge method appeared because result is now Int, whereas
the super-method's result type erases to Object
|
|
|
|
|
|
|
|
|
|
| |
Using @gkossakowski's contribution to mima (in 0.1.5-SNAPSHOT),
make sure bc.run doesn't fail by filtering out all binary incompatibilities.
Each subsequent commit will comment out the filters it makes irrelevant,
until we only need to filter out permitted binary incompatibilities.
We only allow binary incompatibilities in scala.reflect.internal.
|
|\
| |
| | |
Fixing binary compat for $super regression
|
| |
| |
| |
| |
| | |
A binary incompatibility with 2.10.0 revealed a bug I had
introduced in c58647f5f2.
|
| |
| |
| |
| |
| | |
def sameMethodAndFieldSignatures compares two classes to verify
they have all the same methods and fields, and no others.
|
|\ \
| |/
|/| |
SI-6591 Reify and path-dependent types
|
| |
| |
| |
| | |
https://github.com/scala/scala/pull/2072
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Top-level (i.e. owned by a package) => Ident(symbol)
Nested (i.e. owned by an object or a package object) => Select(owner, symbol)
Inner (i.e. owned by a static class) => selectTerm/selectType(owner, name)
Non-locatable (i.e. everything else) => see GenTrees.scala for more details
Changes w.r.t the previous approaches:
* Top-level refs are no longer reified as Select(This(package), symbol).
Proposed reification scheme is as resistant to resetAttrs as previous one,
but is at the same time much shorter.
* Refs to definitions from package objects are no longer Ident(symbol).
Otherwise reflective compilation of things like `_ :: _` fails.
* Contents of Predef._ and scala._ are no longer treated specially.
This increases the size of reificode, but is more hygienic.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Reification scheme changed. Now Select an SelectFromTypeTree trees
reified appropriately, as Select and SelectFromTypeTree accordingly.
Packages and Predef object was excluded in order not to break the
existing reification scheme and not to break tests which rely on it.
Reified free terms can contain flag <stable> to make reified values
become stable identifiers. For example in the case of
reify_newimpl_15.scala
class C {
type T
reify { val v: List[T] = List(2) }
}
class C reified as free term C$value, and List[C.T] becomes
List[C$value().T], so C$value.apply() need to pass stability test
isExprSafeToInline at scala.reflect.internal.TreeInfo. For this purpose
special case for reified free terms was added to isExprSafeToInline
function.
test run/reify_newipl_30 disabled due to SI-7082
test t6591_4 moved to pending due to SI-7083
|
|\ \
| | |
| | | |
SI-5675 Discard duplicate feature warnings at a position
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When -feature has not been enabled, we were double counting
identical feature warnings that were emitted at the same position.
Normal error reporting only reports the first time a warning
appears at a position; feature warning counter incrementing
should behave the same way.
@hubertp: Fixed .check files that were broken in the original commit.
|
|\ \ \
| | | |
| | | | |
SI-7096 SubstSymMap copies trees before modifying their symbols
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
I removed some strange code in a06d31f6a2 and replaced it by something
incorrect: SubstSymMap should never have side-effects: otherwise,
calling 'tpe1 <: tpe2' for instance would modify the symbols in
annotations of tpe2.
SubstSymMap now always creates new trees before changing them.
|
|\ \ \ \
| | | | |
| | | | | |
Booking more progress on SI-6666
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
During development of the fix for SI-6666, I encountered:
% test/files/pos/t4842.scala
test/files/pos/t4842.scala:10: error: contravariant class Bar occurs in covariant position in type ()this.Bar of constructor Bar
this(new { class Bar { println(Bar.this); new { println(Bar.this) } }; new Bar } ) // okay
I had incorrectly set the INCONSTRUCTOR flag on the class symbol
`Bar`. (It isn't directly in the self constructor call, as it
is nested an intervening anonymous class.)
But, this flag shares a slot with CONTRAVARIANT, and the variance
validation intepreted it as such.
ClassSymbol already has this code to resolve the ambiguous
flags for display purposes:
override def resolveOverloadedFlag(flag: Long) = flag match {
case INCONSTRUCTOR => "<inconstructor>" // INCONSTRUCTOR / CONTRAVARIANT / LABEL
case EXISTENTIAL => "<existential>" // EXISTENTIAL / MIXEDIN
case IMPLCLASS => "<implclass>" // IMPLCLASS / PRESUPER
case _ => super.resolveOverloadedFlag(flag)
}
This commit overrides `isContravariant` to reflect the same logic.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
As we did for self/super calls, add a backstop into
explicitouter and lambdalift to check when we try to
get an outer pointer to an under-construction instance.
|
| | | | |
| | | | |
| | | | |
| | | | | |
Replaces more VerifyErrors with implementation restrictions.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This one lands in the new implementation restriction
which beats the VerifyError.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This flag is calcualed in Namers, and assigned to class
and module class symbols that are defined in self/super-calls,
and in early definitions.
For example, class D is INCONSTRUCTOR in each case below:
class C extends Super({class D; ()})
class C(a: Any) {
def this(a: Any) = this({class D; ()})
}
new { val x = { class D; () } with Super(())
But, the calculation of this flag failed to account for
nesting, so it was not set in cases like:
class C(a: Any) {
def this(a: Any) = this({val x = {class D; ()}; x})
}
This patch searches the enclosing context chain, rather than
just the immediate context. The search is terminated at the
first non term-owned context. In the following example, this
avoids marking `E` as INCONSTRUCTOR; only `D` should be.
class C extends Super({class D { class E }; ()})
This closes SI-6259 and SI-6506, and fixes one problem
in the recently reopened SI-6957.
|
| | | | |
| | | | |
| | | | |
| | | | | |
We'll address them in subsequent commits.
|
|\ \ \ \ \
| |_|_|_|/
|/| | | | |
[backport] SI-6478 Fixing JavaTokenParser ident
|
| | |/ /
| |/| |
| | | |
| | | |
| | | | |
Backport of 256934160007079f473131469af2df4d023c2cfc from PR
https://github.com/scala/scala/pull/1466
|
|\ \ \ \
| | | | |
| | | | | |
SI-6989 privateWithin is now populated in reflect
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Originally composed to accommodate pull request feedback, this test has
uncovered a handful of bugs in FromJavaClassCompleter, namely:
* SI-7071 non-public ctors get lost
* SI-7072 inner classes are read incorrectly
I'm leaving the incorrect results of FromJavaClassCompleters in the check
file, so that we get notified when something changes there.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Runtime reflection in JavaMirrors previously forgot to fill in
privateWithin when importing Java reflection artifacts. Now this is fixed.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-5824 Fix crashes in reify with _*
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Reification crashes if "foo: _*" construct is used. This happens besause type tree is represented either with TypeTree, or with Ident (present case), and `toPreTyperTypedOrAnnotated' only matches of the former. The fix is to cover the latter too. A test is included.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
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.
|