| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
The fix for SI-1247 went too far, and could result in
premature evaluation of the expression that yields the
Function0.
This commit checks that said expression is safe to inline.
If not, a wrapper `() => ....` is still required.
The optimization is still enabled in sitations like the
original test case, run/t1247.scala.
|
|\
| |
| | |
SI-7240 fixes language feature lookup
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As I discovered today, Definitions.getMember have a fallback clause,
which accounts for the phases which have inner classes flattened.
This fallback uses nme.flattenedName to compute a flattened name, but
unfortunately nme.flattenedName produces a TermName, not a TypeName,
which means that the fallback will commence search in a wrong namespace
with predictable results.
The commit also changes another usage of nme.flattenedName in a type name
context. That one was correctly converting a TermName result to TypeName,
so this is not a bugfix, but just a refactoring for the sake of being
consistent.
|
|\ \
| | |
| | | |
SI-6725 `f` interpolator now supports %n tokens
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Currently the `f` interpolator supports format specifiers which
specify conversions for formatted arguments. However Java formatting
is not limited to argument-related conversions as explained in:
http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#detail.
Conversions which don't correspond to any arguments are `%` (used to
emit verbatim `'%'` characters) and `n` (used to emit platform-specific
line separators). Of those only the former is supported, and this patch
fixes the oversight.
|
|\ \
| | |
| | | |
SI-7132 - don't discard Unit type in interpreter
|
| | | |
|
|\ \ \
| | | |
| | | | |
SI-5710 has fixed itself
|
| | |/
| |/|
| | |
| | | |
My job here is only to submit tests.
|
|\ \ \
| | | |
| | | | |
reifier is now aware of SI-7235
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
SI-7235 is caused by a long-standing todo in typedRefinement, which leads
to originals of compound type trees swallowing their stats.
I'm not sure how exactly to fix SI-7235, but what I am sure about is that
we shouldn't silently discard stats during reification. This patch
introduces a new implementation restrictions, which now reports that
reify of compound type trees with non-empty stats isn't going to work.
|
|\ \ \
| | | |
| | | | |
SI-7214 outer check based on dealiased pattern type.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
A Typed Pattern (_: T) is more than `.isInstanceOf`: if `T` is a
path dependent type, the scrutinee's $outer reference is also
compared against the prefix of `T`.
The code that synthesises this is split into two places.
`needsOuterCheck` determines whether to add this check, based on
the type `T`, and the type of the scrutinee. If it gives the
go-ahead, `treeCondStrategy.outerCheck` synthesizes the check.
The new test case demonstrates the problems caused by the failure
to dealias in `needsOuterCheck`: it could either wrongly lead to
synthesis of an outer test (which would crash), or wrongly omit
the outer test (meaning overly liberal matching.)
A simple `dealias` remedies this. `dealiasWiden` is *not*
appropriate here; we need to keep hold of singleton types.
I'll also note that there is already a little slack between these
methods, as commented:
> ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix`
> by `Select(q, > outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix`
> if there's an outer accessor, otherwise the condition becomes `true`
> TODO: can we improve needsOuterTest so there's always an outerAccessor?
So this is probably a fragile area that warrants a careful review
with a view to design improvements.
|
|\ \ \ \
| | | | |
| | | | | |
SI-7215 Fix transpose of an empty Array[Array[T]].
|
| |/ / / |
|
|\ \ \ \
| |_|/ /
|/| | | |
SI-7185 Avoid NPE in TreeInfo.isExprSafeToInline
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
We got there typechecking code with a redundant
layer of Block.
We can't express that in source code, so we test
this with manual tree construction and with XML
literals, which as reported produce such trees.
|
|\ \ \ \
| | | | |
| | | | | |
Revert SI-6240 synchronization for runtime reflection
|
| | |/ /
| |/| |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This commit reverts #2083:
- 387b2590db runtime reflection: death from thousand threads
- 73d079fb38 removes the assertion in missingHook
- f4dd56ca5d synchronizes names
- dd148de5a8 synchronizes pendingVolatiles
- 4cbb9357c5 synchronizes toolboxes
- 07bcb6176a SI-7045 reflection now auto-initializes selfType
- bebd62d566 optimizes Scala reflection GIL
- 735634f1d6 initializes lazy vals and inner objects in advance
- 5b37cfb19a introduces GIL to Scala reflection
- 981da8edfc cleans up initialization of runtime reflection
- b2c2493b22 reflection no longer uses atPhase and friends
- a9dca512d8 synchronizes symbols
- 0262941b3c removes the crazy extraneous log
- 21d5d3820b moves Symbol#SymbolKind to Symbols
|
|\ \ \ \
| |/ / /
|/| | | |
Merge 2.10.1 into 2.10.x
|
| |\ \ \ |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Freshly released Java 1.6.0_41 for OSX fails with "IllegalAccessError:
tried to access class JavaSimpleEnumeration_1 from class sun.proxy.$Proxy6",
and rightfully so, because that class isn't public.
I think I will avoid the usual "how could this even work before" in this
commit message.
|
| | |\ \ \
| | | | | |
| | | | | | |
SI-7163 backport of annotated retyping to 2.10.1
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
typedAnnotated transforms an Annotated tree into a Typed tree. The
original field of the result is set to the Annotated tree.
The bug was that typedAnnotated was using the untyped Annotated tree
as original, but also set its type. When re-typing later on the same
Annotated tree, the typer would consider it as alreadyTyped. This
is incorrect, the typer needs to convert Annotated trees to Typed.
Also, the Annotated tree only had its type field set, but its children
were still untyped. This crashed the compiler lateron, non-typed trees
would get out of the typing phase.
|
| | |/ / / |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This reverts commit 54a84a36d5b435a787d93ca48d45399136c7e162.
This is necessary to maintain binary compatibility with 2.10.0.
run/t6989.check had to be updated as it also (indirectly) tested SI-6548
Conflicts:
test/files/lib/javac-artifacts.jar.desired.sha1
test/files/run/t6548.check
test/files/run/t6548/Test_2.scala
|
|\ \ \ \ \
| |/ / / /
|/| | | | |
SI-6240 synchronization for runtime reflection
|
| | | | |
| | | | |
| | | | |
| | | | | |
not anymore
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
selfType joins the happy family of flags, annotations and privateWithin,
which automatically trigger initialization, when used within runtime
reflection.
|
| |/ / / |
|
|\ \ \ \
| | | | |
| | | | | |
resetAttrs now always erases This.tpe
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The symbol of This, if it points to a package class, isn't touched, just
as usual, so that our Select(Select(Select(...))) => This(...) optimization
works fine with attr reset.
However the tpe is now erased, so that subsequent reflective compilation
doesn't spuriously fail when seeing that some subtrees of a tree being
compiled are typed.
Erasing the tpe doesn't pose even a tiniest problem, because, as it can
be seen in typedThis, type is trivially reconstructed from the symbol.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-7074 Fix xml attribute sorting
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Sorting the attributes of an xml element could drop some of the
attributes. It was caused by the incorrect use of MetaData#copy() to
concatenate "smaller" with the rest of the attributes. The
MetaData#copy() method is similar to the following hypothetical method
on a List:
def copy(other: List): List = head :: other
The fix prepends all elements of "smaller" to the rest of the attributes
in the proper order.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
fixes the test for SI-7112
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Freshly released Java 1.6.0_41 for OSX fails with "IllegalAccessError:
tried to access class JavaSimpleEnumeration_1 from class sun.proxy.$Proxy6",
and rightfully so, because that class isn't public.
I think I will avoid the usual "how could this even work before" in this
commit message.
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`Type#isFinalType` determines if a type could have a
non-bottom subtype. This property is exploited by
the pattern matcher to flag impossible patterns.
This check was ignoring the type's prefix, and
incorrectly deemed that `T#A` in `trait T { final class A }`
was a final type. But it could have been subtyped by
`U#A` where `U` <:< `T`, or, more simply, by `T.this.A`.
Now, type finality requires that the prefix is stable.
The existing test cases in neg/patmat-type-check.scala
still correctly flag incompatiblities.
`isFinalType` is also used by some code that massages
pattern matches post specialization. That is actually
either broken or obsolete under virtpatmat, I've opened
SI-7172 to invesigate that.
It is also used by GenICode to determine whether to emit
the appropriate equality checks that are correct in the
face of boxing. It is possible that this change will force
the slow path in some rare cases, but it won't affect
correctness.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
typedAnnotated transforms an Annotated tree into a Typed tree. The
original field of the result is set to the Annotated tree.
The bug was that typedAnnotated was using the untyped Annotated tree
as original, but also set its type. When re-typing later on the same
Annotated tree, the typer would consider it as alreadyTyped. This
is incorrect, the typer needs to convert Annotated trees to Typed.
Also, the Annotated tree only had its type field set, but its children
were still untyped. This crashed the compiler lateron, non-typed trees
would get out of the typing phase.
|
|\ \ \
| | | |
| | | | |
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>
|
|\ \ \ \
| | | | |
| | | | | |
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.
|