| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Backport #2605 to 2.10.x: SI-7149 Use a WeakHashSet for type uniqueness
|
| |
| |
| |
| |
| |
| |
| | |
Replaces scala.reflect.internal.WeakHashSet with a version that
* extends the mutable.Set trait
* doesn't leak WeakReferences
* is unit tested
|
|\ \
| | |
| | | |
SI-7782 Derive type skolems at the ground level
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Rather than at the current value of `skolemizationLevel`,
which could be influenced by an in-flight existential
subtype computation.
This method is called in `PolyTypeCompleter`, which
could be constructed by the lazy type completer of the
enclosing class. So currently it is closing over a mutable
variable; hence the Heisenbug.
This issue was exposed by the changes in b74c33eb860,
which was introduced in Scala 2.10.1.
|
|\ \ \
| |_|/
|/| | |
SI-4760 Parser handles block-ending import
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Don't molest the RBRACE.
Updated with additional parse tests suggested
by @retronym. "What are you lazy?" Yes, I
must be lazy. Can't ScalaCheck or Par-Test
generate these tests automatically? That seems
like a reasonable expectation.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Rather than relying on the cloner to copy the
provided gitignore.SAMPLE files.
This finishes the job started in c48509598, mostly
by reverting that commit and moving the two existing
SAMPLE files to the final destinations.
Use `.git/info/exclude` to augment the list of patterns
with entries specific to your workflow.
(cherry picked from commit b51cb581270da7021b2ea122dc059847101d56a7)
==============================================
Paring back the scope of our shared .gitignore
Importantly, limit the exclusion of build.properties
to the file in the root directory, paving the way for
the return of an SBT build.
- Unignores .bak, .jar, and ~
- limit ignorance of qbin to the root directory
.log files, generated by partest, are still ignored.
To see ignored files in your workspace, try:
git ls-files --others --ignored --exclude-standard -- test | grep log
git status --ignored -- test
(cherry picked from commit f0bbd2ca32acb40be37dc382c1f95081deca3f22)
|
|\ \
| | |
| | | |
SI-7775 Harden against the shifting sands of System.getProperties
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If another thread writes a new system property (which can happen
in pretty innocuous code such as `new Date`!), the compiler startup
could fail with a `ConcurrentModificationException` as it iterated
all bindings in the properties map in search of a boot classpath
property for esoteric JVMs.
This commit uses `Properties#getStringProperties` to get a snapshot
of the keys that isn't backed by the live map, and iterates these
instead. That method will also limit us to bindings with String
values, which is all that we expect.
|
|\ \ \
| | | |
| | | | |
SI-7779 Account for class name compactification in reflection
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We have to assume that the classes we are reflecting on were
compiled with the default value for -Xmax-classfile-name (255).
With this assumption, we can apply the same name compactification
as done in the regular compiler.
The REPL is particularly prone to generating long class names
with the '$iw' prefixes, so this is an important fix for runtime
reflection.
Also adds support for getting the runtime class of `O.type` if
`O` is a module.
|
|\ \ \
| |_|/
|/| | |
Merge/2.10.2 to 2.10.x
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Moved an existing test from `pending` to `pos`. Not sure why
it was moved to `pending` in the first place.
Adds a new test distilled from building Scalaz with 2.10.3-RC1.
|
| |\ \
| | |/
| |/|
| | |
| | |
| | |
| | | |
Better late than never.
Conflicts:
src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
|
| | |\
| | | |
| | | | |
SI-7532 Fix regression in Java inner classfile reader
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
395e90a modified the detection of top-level classes in
ClassfileParser in two ways:
1. used `Name#containsChar` rather than `toString.indexOf ...` (good!)
2. decoded the name before doing this check (bad!)
That code is actually only run for non-Scala classfiles, whose
names don't need decoding. Attempting to do so converted `R$attr`
to `R@tr`, which no longer contains a '$', and was wrongly treated
as a top level class.
This commit reverts the use of `decodedName`, and inlines the method
to its only call site for clarity.
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- Discovered in 2.10.2-RC1
- Ostensibly regressed in 7e52fb910b, which conceptually reverted
part of 0cde930b so that (mutable) TypeVars don't use structural equality.
- But, does *not* fail if 7e52fb910b is cherry-picked directly after 0cde930b,
suggesting that it shone a light on a behaviour change in some other commit
in between the two.
- Indeed, the true regression came in https://github.com/scala/scala/commit/e5da30b843#L5L3176
- A targeted revert of e5da30b843 is undesirable, as we'd like SI-6846 to stay fixed
What's happening here? In the enclosed test case, higher kinded type
inference explores two possibilities:
Composed.this.Split[A]
K[[T]A[B[T]]] // `Split[A]` dealiased
The difference in the flow of type inference can be seen from the diff
below. Notice how now we no longer register `?K.addBound(Composed.this.Split)`,
we instead only register `?K.addBound(K)`
```patch
--- sandbox/old.log 2013-05-30 00:27:34.000000000 +0200
+++ sandbox/new.log 2013-05-30 00:28:28.000000000 +0200
@@ -1,55 +1,114 @@
?K.unifyFull(Composed.this.Split[A])
?K.unifySpecific(Composed.this.Split[A])
- ?K.addBound(Composed.this.Split)
?B.unifyFull(T)
?B.unifySpecific(T)
`-> false
?B.unifyFull(Any)
?B.unifySpecific(Any)
`-> false
`-> false
?K.unifySpecific(L[[T]A[B[T]]])
- ?K.addBound(L)
?B.unifyFull(B[T])
?B.unifySpecific(B[T])
?B.addBound(B)
`-> true
?B.unifyFull(B[T])
?B.unifySpecific(B[T])
?B.addBound(B)
`-> true
?B.unifyFull(B[T])
?B.unifySpecific(B[T])
?B.addBound(B)
`-> true
?B.unifyFull(B[T])
?B.unifySpecific(B[T])
?B.addBound(B)
`-> true
+ ?K.addBound(L)
`-> true
?K.unifyFull(Composed.this.Split[A])
?K.unifySpecific(Composed.this.Split[A])
- ?K.addBound(Composed.this.Split)
?B.unifyFull(x)
?B.unifySpecific(x)
`-> false
`-> false
?K.unifySpecific(L[[T]A[B[T]]])
+ ?B.unifyFull(B[T])
+ ?B.unifySpecific(B[T])
+ ?B.addBound(B)
+ `-> true
+ ?B.unifyFull(B[T])
+ ?B.unifySpecific(B[T])
+ ?B.addBound(B)
+ `-> true
+ ?B.unifyFull(B[T])
+ ?B.unifySpecific(B[T])
+ ?B.addBound(B)
+ `-> true
+ ?B.unifyFull(B[T])
+ ?B.unifySpecific(B[T])
+ ?B.addBound(B)
+ `-> true
?K.addBound(L)
+ `-> true
+?K.unifyFull(Composed.this.Split[A])
+ ?K.unifySpecific(Composed.this.Split[A])
+ ?B.unifyFull(T)
+ ?B.unifySpecific(T)
+ `-> false
+ ?B.unifyFull(Any)
+ ?B.unifySpecific(Any)
+ `-> false
+ `-> false
+ ?K.unifySpecific(L[[T]A[B[T]]])
?B.unifyFull(B[T])
?B.unifySpecific(B[T])
?B.addBound(B)
`-> true
?B.unifyFull(B[T])
?B.unifySpecific(B[T])
?B.addBound(B)
`-> true
?B.unifyFull(B[T])
?B.unifySpecific(B[T])
?B.addBound(B)
`-> true
?B.unifyFull(B[T])
?B.unifySpecific(B[T])
?B.addBound(B)
`-> true
+ ?K.addBound(L)
+ `-> true
+?K.unifyFull(Composed.this.Split[A])
+ ?K.unifySpecific(Composed.this.Split[A])
+ ?B.unifyFull(x)
+ ?B.unifySpecific(x)
+ `-> false
+ `-> false
+ ?K.unifySpecific(L[[T]A[B[T]]])
+ ?B.unifyFull(B[T])
+ ?B.unifySpecific(B[T])
+ ?B.addBound(B)
+ `-> true
+ ?B.unifyFull(B[T])
+ ?B.unifySpecific(B[T])
+ ?B.addBound(B)
+ `-> true
+ ?B.unifyFull(B[T])
+ ?B.unifySpecific(B[T])
+ ?B.addBound(B)
+ `-> true
+ ?B.unifyFull(B[T])
+ ?B.unifySpecific(B[T])
+ ?B.addBound(B)
+ `-> true
+ ?K.addBound(L)
+ `-> true
+?K.unifyFull(L[A])
+ ?K.unifySpecific(L[A])
+ ?K.addBound(L)
+ `-> true
+?K.unifyFull(L[A])
+ ?K.unifySpecific(L[A])
+ ?K.addBound(L)
`-> true
```
|
| | |\
| | | |
| | | | |
SI-7516 Revert "SI-7234 Make named args play nice w. depmet types"
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
This reverts commit 83c9c764b528a7a1c1d39c480d22c8e3a71d5a58.
The tests are shunted to 'pending'.
Why revert this seemingly innocous commit? 83c9c764 generates a ValDef whose
tpt TypeTree has no original; this contains a reference to the symbol for `d`.
resetAttrs and the retypecheck assigns a new symbol for d and leaves a the
reference to the prior symbol dangling. The real bug is the resetAttrs concept.
|
| | |\ \
| | | |/
| | |/| |
SI-7486 Regressions in implicit search.
|
| | | |
| | | |
| | | |
| | | | |
Revert e86832d7e8 and dd33e280e2.
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The fix for SI-7238 caused this regression.
This commit marks taints whole Apply with an ErrorType if it
has an erroneous argument, so as to stop a later crash trying
to further process the tree.
|
|/ /
| |
| |
| |
| |
| |
| | |
I'm looking at the changes made in 47f35b587, which
prevented cyclic errors in class file parsing. That fix
is insufficient for, or otherwise complicit in, SI-7778, for
which I've enclosed a pending test.
|
|\ \
| | |
| | | |
SI-7716 Exclude patmat synthetics from bounds checking
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Consider this pattern match translation, that occurs *before* refchecks:
scala> val e: java.lang.Enum[_] = java.util.concurrent.TimeUnit.SECONDS
scala> e match { case x => x }
<console>:9: error: type arguments [_$1] do not conform to class Enum's type parameter bounds [E <: Enum[E]]
e match { case x => x }
^
[[syntax trees at end of refchecks]] // <console>
package $line5 {
case <synthetic> val x1: Enum[_$1] = $line3.$read.$iw.$iw.e;
case4(){
matchEnd3(x1)
};
matchEnd3(x: Enum[_$1]){
x
}
RefChecks turns a blind eye to the non-conformant type `Enum[_$1]` in
the label defs because of `65340ed4ad2e`. (Incidentally, that is far
too broad, as I've noted in SI-7756.)
This commit extends this exception to cover the synthetic ValDef `x1`.
Commit log watchers might notice the similarities to SI-7694.
|
|\ \ \
| |/ /
|/| | |
[nomaster] macro expansions are now auto-duplicated
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The fix still requires macro developers to be careful about sharing trees
by references, because attributed DefTrees will still bring trouble.
However this is an improvement, because it doesn't make matters worse
and automatically fixes situations similar to one in the test.
A much more thorough discussion with a number of open questions left:
http://groups.google.com/group/scala-internals/browse_thread/thread/492560d941b315cc
Was fixed ages ago in master in one of the paradise backports.
Never got to 2.10.x, but it's very useful, so I'm backporting it now.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
These are passed through from `InferencerContextErrors#applyErrorMsg`
to `withDisambiguation` as the `locals` parameter, which is promptly
ignored. This looks to be an unintended change in 39938bcc299.
Without this patch, the enclosed test case enters a pathalogical
disambiguation session, that not only flirts with unpleasant big-O
complexities, but also flails about appending "(in method foo)"
only to find that *all* occurences of the same-named type parameter
come from some method named "foo".
[snipping error message 40 seconds in the making]
method foo), O(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), P(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), Q(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), R(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), S(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), T, U(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), V)
cannot be applied to (Int)
foo((1))
|
|\ \ \
| | | |
| | | | |
SI-7014 Annot arg may refer to annotated class's member
|
| | | |
| | | |
| | | |
| | | | |
This only reduces the crasher to a warning.
|
|\ \ \ \
| | | | |
| | | | | |
[Rebase #2771] SI-7694 @uncheckedBounds, an opt-out from type bounds checking
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Followup to the previous commit that added the compiler support
for opting out of bounds checking.
With both pieces, we can test that the temporaries introduced
by the named/default arguments transform don't trigger bounds
violations.
|
|\ \ \ \
| |/ / /
|/| | | |
SI-7020 Determinism for pattern matcher warnings
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Use LinkedHashSet for the DPLL algorithm for determistic
counter example generation.
Before, the test compiled with:
[info] v2.10.2 => /Users/jason/usr/scala-v2.10.2-0-g60d462e
test/files/neg/t7020.scala:3: warning: match may not be exhaustive.
It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List(_, _)
List(5) match {
^
test/files/neg/t7020.scala:10: warning: match may not be exhaustive.
It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List(_, _)
List(5) match {
^
test/files/neg/t7020.scala:17: warning: match may not be exhaustive.
It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(??, _)
List(5) match {
^
test/files/neg/t7020.scala:24: warning: match may not be exhaustive.
It would fail on the following input: List(_, _)
List(5) match {
^
|
|\ \ \ \
| |/ / /
|/| | | |
SI-7733 reflective packages now more consistent with scalac
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously PackageScopes from scala.reflect ignored all classes that
had $'s in non-rightmost positions in their names.
Unfortunately this behaviour is inconsistent with how scalac does things,
and I reconciled this as usual, by pulling corresponding logic into
scala-reflect.jar and sharing it between runtime reflection and compiler.
This change has seprate pull requests for 2.10.x and 2.11.0. The latter
deprecates `scala.tools.nsc.util.ClassPath.isTraitImplementation`
whereas the former (which you're looking at right now) does not, because
we can't deprecated members in minor releases.
|
|\ \ \
| | | |
| | | | |
showRaw now prints symbols of def trees
|
| | | |
| | | |
| | | |
| | | | |
A very useful addition that came in handy when hacking macro annotations
|
|\ \ \ \
| | | | |
| | | | | |
currentRun.compiles now correctly works in toolboxes
|
| | |/ /
| |/| |
| | | |
| | | | |
Another random bug uncovered and extinguished when hacking macro annots.
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Back then when I implemented macros for inclusion in trunk (Spring 2012),
partest didn't support the _1, _2, ... convention for neg tests, so I had
to use toolboxes to test macro-generated exceptions.
Unfortunately toolboxes aren't very good with positions (mostly because
their inputs are almost always constructed without corresponding sources)
so I didn't notice that errors signalizing about macro-generated
exceptions actually don't carry positions with them because of a typo.
This patch fixes the oversight, but it doesn't need to be ported to master,
because over there everything's already fixed by one of the backports
from macro paradise.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This commit gets rid off code wrapping that was previously used by
toolbox to get into correct parsing mode. Instead combination of
templateStats/accept(EOF) is used. This is the same solution as the one
used in repl and built-in scriptRunner
This pull request doesn't attempt to generalize this approach in any
way and re-use it all over the place due to the caution of possible
accidental compatibility breakage. I plan to do it separately against
master.
Additionally there are a few more changes that make importers be aware
of positions and a test for that (via @jedesah).
|
|\ \ \
| | | |
| | | | |
Assorted toolbox fixes
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Apparently there are still discrepancies between how the vanilla compiler
turns class files into symbols and how the reflective compiler does it.
Working on bringing these guys in sync, one bug at a time.
|
| | | |
| | | |
| | | |
| | | | |
Not sure which partest bug allowed this, but the old name was wrong.
|
|\ \ \ \
| | | | |
| | | | | |
SI-7455 Drop dummy param for synthetic access constructor
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Java synthesizes public constructors in private classes to
allow access from inner classes. The signature of
that synthetic constructor (known as a "access constructor")
has a dummy parameter appended to avoid overloading clashes.
javac chooses the type "Enclosing$1" for the dummy parameter
(called the "access constructor tag") which is either an
existing anonymous class or a synthesized class for this purpose.
In OpenJDK, this transformation is performed in:
langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java
(Incidentally, scalac would just emits a byte-code public
constructor in this situation, rather than a private constructor /
access constructor pair.)
Scala parses the signature of the access contructor, and drops
the $outer parameter, but retains the dummy parameter. This causes
havoc when it tries to parse the bytecode for that anonymous class;
the class file parser doesn't have the enclosing type parameters
of Vector in scope and crash ensues.
In any case, we shouldn't allow user code to see that constructor;
it should only be called from within its own compilation unit.
This commit drops the dummy parameter from access constructor
signatures in class file parsing.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
SI-7636 Fix a NPE in typing class constructors
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
If we encountered an erroneous super call due to a
failure in parent type argument inference, we must
avoid inspecting the untyped children of erroneous
trees.
|
| |_|/ /
|/| | |
| | | |
| | | |
| | | |
| | | |
| | | | |
introduced in 5b54681: the end position of Postfix operators should
take the operator length into account.
review by @som-snytt
|