| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| |
| |
| | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Implicits.scala
|
| |\
| | |
| | | |
silences t6323a
|
| | |
| | |
| | |
| | |
| | |
| | | |
Tag materialization notices enabled with -Xlog-implicits are now echoes
not printlns. Therefore, they go into stderr, not stdout, getting logged
by partest and not spamming stdout of partest.
|
| |\ \
| | | |
| | | | |
SI-6514 Avoid spurious dead code warnings
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`deadCode.expr` stores the method symbol most recently encountered
in `handleMonomorphicCall`, and uses this to avoid warnings
for arguments to label jumps and `Object#synchronized` (which
sneakily acts by-name without advertising the fact in its type.)
But this scheme was insufficient if the argument itself contains
another method call, such as `matchEnd(throw e(""))`.
This commit changes the single slot to a stack, and also
grants exemption to `LabelDef` trees. They were incorrectly
flagged in the enclosed test case after I made the the first change.
|
| |\ \ \
| | | | |
| | | | | |
SI-6225 Fix import of inherited package object implicits
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The prefix in the ImplicitInfo must be com.acme.`package`.type,
rather than com.acme.
|
| |\ \ \ \
| | | | | |
| | | | | | |
SI-6935 Added readResolve in BoxedUnit
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | | |
When deserializing Unit, it would return an instance of Object, but not a Scala Unit.
By adding readResolve, the deserialization of Unit will work.
|
| |\ \ \ \
| | |_|_|/
| |/| | | |
SI-6370 changed ListMap apply0 method to produce correct error message
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
a key is not found
Current implementation of apply0 relies on tail method to iterate over all keys.
When the list gets to its end, tail produces an 'empty map' message in its exception, which is thrown by ListMap.
This change checks if the collection is empty before calling tail and provides a more appropriate key not found message.
Signed-off-by: Vinicius Miana <vinicius@miana.com.br>
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-6355, weakend implementation restriction on applyDynamic.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
I realized one can successfully call an overloaded applyDynamic,
under conditions such as these:
def applyDynamic[T1](m: String)(x1: T1): Any = 1
def applyDynamic[T1, T2](m: String)(x: T1, y: T2): Any = 2
def applyDynamic[T1, T2, T3](m: String)(x: T1, y: T2, z: T3): Any = 3
So I weakened the overloading restriction to allow overloading
if each method has a distinct number of type parameters. This very
likely still allows the creation of uncallable overloads, but an
overly restrictive rule is worse. If the overload cannot be called,
it will still be discovered at the call site.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
1) Deprecates much of Predef and scala.Console, especially:
- the read* methods (see below)
- the set{Out,Err,In} methods (see SI-4793)
2) Removed long-deprecated:
- Predef#exit
- Predef#error should have gone, but could not due to sbt
At least the whole source base has now been future-proofed
against the eventual removal of Predef#error.
The low justification for the read* methods should be readily
apparent: they are little used and have no call to be in global
namespace, especially given their weird ad hoc semantics and
unreasonably tempting names such as readBoolean().
3) Segregated the deprecated elements in Predef from the part
which still thrives.
4) Converted all the standard Predef implicits into implicit
classes, value classes where possible:
- ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value)
- SeqCharSequence, ArrayCharSequence (non-value)
Non-implicit deprecated stubs prop up the names of the
formerly converting methods.
|
|\| | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
* origin/2.10.x:
Fix for paramaccessor alias regression.
Expanded bytecode testing code.
SI-5675 Discard duplicate feature warnings at a position
accommodates pull request feedback
term and type reftrees are now reified uniformly
SI-6591 Reify and path-dependent types
SI-7096 SubstSymMap copies trees before modifying their symbols
SI-6961 no structural sharing in list serialization
SI-6187 Make partial functions re-typable
[backport] SI-6478 Fixing JavaTokenParser ident
SI-7100 Fixed infinite recursion in duplicators
SI-6146 More accurate prefixes for sealed subtypes.
SI-5082 Cycle avoidance between case companions
SI-6113 typeOf now works for type lambdas
SI-5824 Fix crashes in reify with _*
SI-7026: parseTree should never return a typed one
SI-7070 Turn restriction on companions in pkg objs into warning
Conflicts:
src/compiler/scala/reflect/reify/codegen/GenSymbols.scala
src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
src/compiler/scala/tools/reflect/ToolBoxFactory.scala
src/library/scala/collection/immutable/List.scala
src/reflect/scala/reflect/internal/TreeInfo.scala
src/reflect/scala/reflect/internal/Types.scala
src/reflect/scala/reflect/internal/settings/MutableSettings.scala
src/reflect/scala/reflect/runtime/Settings.scala
test/files/buildmanager/t2650_1/t2650_1.check
test/files/buildmanager/t2657/t2657.check
test/files/neg/t3234.check
test/files/run/idempotency-this.check
test/files/run/macro-typecheck-macrosdisabled2.check
test/files/run/showraw_tree.check
test/files/run/showraw_tree_ids.check
test/files/run/showraw_tree_kinds.check
test/files/run/showraw_tree_types_ids.check
test/files/run/showraw_tree_types_typed.check
test/files/run/showraw_tree_types_untyped.check
test/files/run/showraw_tree_ultimate.check
test/files/run/t2886.check
test/files/run/t5225_2.check
test/files/run/t5374.check
test/files/run/t5374.scala
test/files/run/t6329_repl.check
test/files/run/toolbox_typecheck_macrosdisabled2.check
|
| |\ \ \ \
| | |_|_|/
| |/| | | |
Fixing binary compat for $super regression
|
| | | |/
| | |/|
| | | |
| | | |
| | | | |
A binary incompatibility with 2.10.0 revealed a bug I had
introduced in c58647f5f2.
|
| |\ \ \
| | |/ /
| |/| | |
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
|
| |\ \ \ \ \ \
| | |_|_|_|/ /
| |/| | | | | |
[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
|
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
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.
|
| |\ \ \ \ \ \ \ \ \ \
| | |_|_|_|_|_|/ / / /
| |/| | | | | | | | | |
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.
|
| |\ \ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
[nomaster] SI-7064 Reflection: forward compat for 2.10.1
|