| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
test/files/run/t6223's check file expects a specific
ordering of the reflected values. The ordering is not
guaranteed by the runtime/reflection API and can change.
Therefore, sort the values before comparing them.
|
|\
| |
| | |
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-7233 Account for aliased imports in EtaExpansion / Erasure
|
| | |
| | |
| | |
| | | |
When we discard the fiction of `scala.Any`.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Buggy:
treeCopy.Select(sel, sel.qual, sel.name) setSymbol null
Select(sel, sel.qual, sel.name)
Okay:
treeCopy.Select(sel, sel.qual, sel.name)
Select(sel, sel.qual, sel.symbol.name) // but doesn't copyAttrs!
It is an easy mistake to make, I've found one more occurance:
def foo(a: Any) = { import a.{toString => toS}; toS }
error: uncaught exception during compilation: scala.reflect.internal.FatalError
scala.reflect.internal.FatalError: class Object does not have a member toS
at scala.reflect.internal.Definitions$DefinitionsClass.scala$reflect$internal$Definitions$DefinitionsClass$$fatalMissingSymbol(Definitions.scala:1028)
A followup commit will address that problem.
|
|\ \ \
| | | |
| | | | |
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-7328 Bail out of names/defaults when args are error typed
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
To avoid a crasher later on with a null type inside a
sequence argument.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-7234 Make named args play nice with dep. method types
|
| | |_|_|/
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | | |
Some care is needed to avoid interaction with constant
types (e.g pos/z1730.scala) and with existentials
(e.g. t3507-old.scala).
|
|\ \ \ \ \
| | | | | |
| | | | | | |
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-7226 Fix inference regression caused by TypeVar equality
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
TypeVars, being mutable creatures, mustn't have structural
equality/hashing, otherwise TypeRefs that differ only by
having distinct TypeVars as components get wrongly uniqued
together.
The reported bug showed the disaterous consequences: constraints
from the `C?[Int]` in the return type applied to the `?C[?A]` in
the parameter list.
This commit overrides `equals` and `hashCode` in `TypeVar`
to use reference equality. An alternative fix would be to drop
the `case`-ness of the class, as was the case before 0cde930b
when this regressed.
|
|\ \ \ \
| |_|/ /
|/| | | |
Fix SI-7224.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
Don't focus positions assigned to the TypeTree of a parent of a Template
when the parent exists in the source. A focused position (instance
of `OffsetPosition`) makes it invisible to the presentation compiler
when it looks for the innermost enclosing tree of a given position
(breaking hyperlinking, for example).
|
|\ \ \
| | | |
| | | | |
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-7109 SI-7153 Generalize the API to get docComments: allow to force do...
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
for given fragments. Don't type-check when forcing doc comments, but rather
do it directly. Test the new functionality as well as better tests for
the old one.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
merge 2.10.1 into 2.10.x
|
| |\ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
The fix for SI-7183 in 440bf0a8c2 was forward ported in f73d50f46c.
Conflicts:
src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
test.done again checks bin compat (using mima 0.1.5)
|
| | | | | | | | |
|
| | |\ \ \ \ \ \
| | | |/ / / / /
| | |/| | | | | |
[nomaster] SI-7195 minor version mustn't introduce warnings
|
| | |/ / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
We want 2.10.1 to be a drop-in replacement for 2.10.0,
so we can't start warning where we weren't warning in 2.10.0.
See SI-5954 (#1882, #2079) for when it was an implementation restriction,
which was then weakened to a warning. It's now hidden behind -Ydebug.
|
| | |\ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-7183 Disable unreachability for withFilter matches.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This avoids spurious unreachable warnings on code
that the user didn't write.
The parser desugars for-comprehensions such as:
for (A(a) <- List(new A)) yield a
To:
List(new A()).withFilter(((check$ifrefutable$2) =>
check$ifrefutable$2: @scala.unhecked match {
case A((a @ _)) => true
case _ => false
})
)
But, if `A.unapply` returns `Some[_]`, the last case is dead code.
(Matching against a regular case class *would* fall through in
the caes of a null scrutinee.)
In SI-6902, we enabled unreachability warnings, even if the
scrutinee was annotated as @unchecked. That was consistent
with the 2.9.2 behaviour, it was only disabled temporarily
(actually, accidentally) in 2.10.0. But, the old pattern matcher
didn't warn about this code.
This commit makes the pattern matcher recognise the special
scrutinee based on its name and disables both exhaustivity
*and* unreachability analysis.
To do so, the we generalize the boolean flag `unchecked` to
the class `Suppression`.
|
| | |\ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-7126 Account for the alias types that don't dealias.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
The kind-polymorphic nature of Nothing and Any in
concert with type argument inference could lead to
types like `T[T]` (where `type T=Any`).
Compensatory action is taken later on to recover;
see the usages of `TypeRef#typeParamsMatchArgs`.
But this these types have a nasty property, they
can dealias to themselves. Callers recursing through
types who fail to account for this hit an infinite
recursion, as was reported in SI-7126.
This commit simply dealiases `T` when registering
the type bound in `unifySimple`.
We should try to weed out additional sources of
these types.
|
| | | |/ / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
After this change:
qbin/scalac -Ydebug test/files/pos/t7126.scala 2>&1 | grep warning
warning: dropExistential did not progress dealiasing Test.this.T[Test.this.T], see SI-7126
one warning found
T[T]? Really? The true bug lies somewhere else; the comments of
the ticket illuminate the general areas of concern.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This is a forward port of #2168 (originally for 2.10.1,
but the pattern matcher has since been refactored in 2.10.x.)
|
| | | | | | | | |
|
| | | | | | | | |
|
| | |_|_|_|/ /
| |/| | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
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.
|
|\ \ \ \ \ \ \ \
| |_|_|/ / / / /
|/| | | | | | | |
SI-7190 macros no longer give rise to bridges
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Amazingly enough, this got through all the testing we performed. But now
erasure knows that it shouldn't generate bridges for macro methods.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
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
|