| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We need to force info of the `cls` in `parseExceptions`
because we pass `cls` to `addThrowsAnnotation` which in turn calls
`Symbol.isMonomorphicType` that relies on a symbol being initialized
to give right answers.
In the future we should just clean up implementation of
`isMonomorphicType` method to not rely on a symbol being initialized
as there's no inherent reason for that in most cases. In cases where
there's reason for that we should just force the initialization.
This patch does not come with a test-case because it's hard to reproduce
not initialized symbols in partest reliably.
|
|\ \
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
SI-7171 Consider prefix when assessing type finality.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
`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.
|
|\ \ \ \
| | | | |
| | | | | |
refactor the pattern matcher into smaller files
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This brings the optimizations and the analyses closer together.
In the future we may consider using a solver in the optimizations.
For now, implication is checked ad-hoc using hash-consing and equality/subset tests...
NOTE: prepareNewAnalysis resets said hash-consing, so must be
called before approximating a match to propositions
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
There's no change in behavior.
Remove `modelNull` boolean in favor of subclassing.
|
| | | | |
| | | | |
| | | | |
| | | | | |
move instanceOfTpImplies out of CodeGen into TypeAnalysis
|
| | | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The diff was mostly code cleanup, so most of that was propagated from master to 2.10.x.
The remaining diff is encapsulated in compatibility stubs (see below).
(There was also the on/off potential for the 2.10.x "new" pattern matcher.
The old one is gone in 2.11, so no turning off new patmat, of course.)
The stubs:
```
protected final def dealiasWiden(tp: Type) = tp.dealias // 2.11: dealiasWiden
protected final def mkTRUE = CODE.TRUE_typed // 2.11: CODE.TRUE
protected final def mkFALSE = CODE.FALSE_typed // 2.11: CODE.FALSE
protected final def hasStableSymbol(p: Tree) = p.hasSymbol && p.symbol.isStable // 2.11: p.hasSymbolField && p.symbol.isStable
protected final def devWarning(str: String) = global.debugwarn(str) // 2.11: omit
```
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
Fixed error in reflection API docs about linearization order on method baseClasses
|
| | | | |
| | | | |
| | | | |
| | | | | |
baseClasses
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
Shadowed Implict typo (fixes no issue)
|
| | |_|/
| |/| | |
|
|\ \ \ \
| |_|/ /
|/| | | |
Fix typing idempotency bug with Annotated trees
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Fix SI-7130: Memory leaked caused by Statistics
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
As described in the ticket, we were leaking memory by holding reference
to Global through by-name argument that was captured by an instance of
a class stored in global HashMap `qs`.
The fix is simple: do not register quantities in HashMap unless statistics
is enabled. This way, if Statistics is disabled we do not store any
references.
We still leak memory in case of statistics being enabled.
|
|\ \ \
| | | |
| | | | |
SI-7143 Fix scanner docComment production.
|
| |/ /
| | |
| | |
| | |
| | | |
in different places and as a result can get out of sync and as a result
the invariant that docComment has a position is broken.
|
|\ \ \
| | | |
| | | | |
SI-7134: don't require doc.Settings in base api of scaladoc.
|
| |/ / |
|
|\ \ \
| | | |
| | | | |
make Future scaladoc examples up-to-date and compilable
|
| |/ / |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The macro def <-> macro impl correspondence check compares names of the
corresponding parameters in def and impl and reports an error if they
don't match. This was originally designed to avoid confusion w.r.t named
arguments (which ended up being never implemented as described in SI-5920).
Sometimes parameter names are generated by the compiler, which puts the
user in a tough position. Luckily, there's an escape hatch built it, which
omits the name correspondence check if one of the parameters is SYNTHETIC.
Everything went well until we realized that evidences generated by
context bounds aren't SYNTHETIC, which led to the bug at hand.
Marking auto-generated evidence parameters SYNTHETIC was only the first
step, as the correspondence checker uses parameter symbols, not parameter
trees. Why's that a problem? Because SYNTHETIC doesn't get propagated from def
trees to their underlying symbols (see ValueParameterFlags).
Unfortunately one cannot just change ValueParameterFlags, because that
would break printouts generated in TypeDiagnostics, which is designed to not
print synthetic symbols. Thus we modify methodTypeErrorString in
TypeDiagnostics to always print synthetic symbols.
Therefore now we propagate all paramSym.flags when doing correspondent sweeps
to keep them in sync between def trees and their underlying symbols. This
fixes the problem.
|
|\ \
| |/
|/| |
SI-7091 Don't try to put a protected accessor in a package.
|
| |
| |
| |
| |
| |
| |
| | |
This shows up when a protected[pack] class has a constructor
with a default argument.
Regressed in f708b87 / SI-2296.
|
| | |
|
|\ \
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Tolerate symbol sharing between accessor/field.
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Recently, TreeCheckers (-Ycheck) was extended to
report on references to symbols that were not in
scope, which is often a sign that some substitution
or ownership changes have been omitted.
But, accessor methods directly use the type of the
underlying field, without cloning symbols defined
in that type, such as quantified types in existentials,
at the new owner.
My attempt to change this broke pos/existentials.scala.
Instead, I'll just look the other way in TreeCheckers.
|
|\ \ \
| | | |
| | | | |
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-6158 Restore compile error output under partest --show-log
|