| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
adds MacroPlugin.pluginsIsBlackbox
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is an important omission in the current macro plugin API, which was
designed before the blackbox vs whitebox separation was implemented.
Even if one overrides pluginsTypedMacroBody and pluginsMacroExpand,
that would still be not enough to write a custom macro expander, because
typedImplicit1 uses isBlackbox, which is tightly coupled with the standard
way of reading/writing macro signatures.
|
|\ \
| | |
| | | |
macro args now correctly preserve range positions
|
| |/
| |
| |
| |
| |
| |
| |
| | |
Somewhen in the 2.11.0 development cycle we started duplicating macro arguments
for increased robustness. What wasn't taken into account though is that
Tree.duplicate destroys range positions. This commit fixes the problem.
2.10.x is unaffected by this bug, because it doesn't duplicate the args yet.
|
|\ \
| | |
| | | |
SI-8657 don't miss tailrec defs in more positions
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
1) First operand of boolean expression using `&&` or `||`. Second operands of
those boolean exprs were already treated specially here but handling for first
operands was missing.
2) Condition of `If`. Also added a test for guards.
|
|\ \ \
| | | |
| | | | |
SI-8185 Correct grammar for single-warning compilation run
|
| | | | |
|
|\ \ \ \
| | | | |
| | | | | |
SI-7372 fix wrong insertion point for binary & linear search.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
It should return the position the value would have if it was a part of
the sequence. Somehow even the test was wrong.
|
|\ \ \ \ \
| |_|_|/ /
|/| | | | |
SI-6967 Fix ClassTag unapply for primitives
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
This commit fixes the behavior of ClassTag's Any-accepting unapply
overload. Previously, ClassTag had overloads of unapply that accepted
all of the Java primitive aliases (language-supported magic classes
extending AnyVal), as well as an implementation that accepted an Any.
All of the AnyVal-accepting (more specific) versions of the methods
worked correctly. However, the Any-accepting version incorrectly handled
these types. For example, ClassTag.Int.unapply(3) would return Some(3)
(through the Int-accepting overload), while ClassTag.Int.unapply(3: Any)
would return None (through the Any-accepting overload). This commit
unifies these behaviors, making ClassTag.Int.unapply(3: Any) return
Some(3). It accomplishes this by adding a pattern match on the type of
that method's argument, which will delegate to one of the
more-specifically-typed overloads if possible. It also improves the
formatting of the code a bit.
One thing to note (though I doubt anyone will ever do this based on this
message) is that the AnyVal-subtype-accepting overloads should be
removed in Scala 2.12, as they are unneeded. I placed a note to this
effect into the code.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The first sentence of a Scaladoc comment is parsed as the summary.
However, this was breaking of the sentence at the first `.`, even
if that was immediately followed by another character.
This commit only considers a period followed by whitespace, EOL or
EOF as the end of a sentence.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-8631 Treat `A with Sealed` as enumerable for pattern matching
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Enumerate the subtypes of sealed parent types of refinement
types, and filter those that conform to the refinement type.
Such types can crop up easily when LUB-bing case classes which
add `Product with Serializable` to the mix.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8611 Avoid accidental patmat unification with refinement types
|
| |/ / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In the enclosed test, t8611a.scala, the patterns `O.{A, B}` were
incorrect treated as equivelent by the combination of
`uniqueTpForTree` and `Const.uniqueTpForTree`.
`uniqueTpForTree` used `Type#narrow` to try to create a distinct
type for each new pattern tree it encountered. However, narrowing a
`RefinedType` does not create a distinct type as we are used to
when narrowing, e.g. a class type.
// Type
def narrow: Type =
if (phase.erasedTypes) this
else {
val cowner = commonOwner(this)
refinedType(this :: Nil, cowner, EmptyScope, cowner.pos).narrow
}
// CompoundType
override def narrow: Type = typeSymbol.thisType
This commit creates a fresh existential type symbol rather than
trying to use `narrow`.
I've included a unit test to show the sublteties of narrowing
refinment types.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
SI-5905 Clarify test case
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The language feature options are discovered reflectively, but it
is nice to enforce that expected options are supplied.
Short of that, the code string includes a rowdy postfix operator.
It still does enforce that at least one option was discovered.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Java 8 agnostism for our test suite
|
| | | | | | | |
|
| | |_|/ / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Under Java 8, the output contains newly added methods in
j.u.Iterator.
I've created cut down, test-local versions of the relevant types
to decouple.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Java 8 support for run/repl-javap-app.check
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Just adding the java 8 output.
No attempt to finesse anything.
But the partest mechanism does still need auto-update of these
conditional check files, plus expression evaluation of the condition.
|
|\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
Merge 2.10.x to 2.11.x
|
| |\ \ \ \ \ \
| | |/ / / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
merge/2.10.x-to-2.11.x-20140604
Conflicts:
src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Regressed in SI-7915 / 3009a525b5
We should be deriving the position of the synthetic `Select`
from `basefun1`, rather than `basefun`. In the new, enclosed
test, the difference amounts to:
new Container().typeParamAndDefaultArg[Any]()
`------------ basefun1 --------------'
`----------------- basefun ---------------'
For monomorphic methods, these are one and the same, which is
why `presentation/t7915` was working. I've extended that test
to a polymorphic method to check that hyperlink resolution works.
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Allows the test to pass on both backends
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
This makes it pass under -Ybackend:GenBCode
|
|\ \ \ \ \ \ \
| |/ / / / / /
|/| | | | | | |
SI-8553 WrappedArray throws exception on lastIndexWhere when index out of range
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Adds a check in `IndexedSeqOptimized#lastIndexWhere(A => Boolean, Int)`
to begin searching in the end of the collection if `end` is greater than
the collection's length.
Discussed in
https://groups.google.com/d/topic/scala-internals/-MacXivbY0Q/discussion.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8637 fixes toolbox phase corruption
|
| | |_|_|_|_|/
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
It turns out, Toolbox.typecheck hasn't been properly re-initializing its state
between requests.
In particular, globalPhase was left untouched, which made the compiler
think that it's past typer, and that in turn disabled implicits.
This commit applies a symptomatic fix to this problem.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8630 lineToString no longer long by one at eof
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
One more EOL crasher, or lack-of-EOL crasher, when the text
is at EOF.
It was not caught by the last round of excellent and
thorough tests because
```
// If non-whitespace tokens run all the way up to EOF,
// positions go wrong because the correct end of the last
// token cannot be used as an index into the char array.
// The least painful way to address this was to add a
// newline to the array.
```
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-8475 GroupedIterator is also lazy when padded
|
| |/ / / / / / /
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This is the related case which dnlgtm in the previous fix.
The old code seems to be tilting for laziness, but we have
to fill the buffer with the current group anyway, so there
is no reason to be coy about calling ArrayBuffer.length.
|
|\ \ \ \ \ \ \ \
| |_|_|_|_|_|/ /
|/| | | | | | | |
More type safe implementation of BType, cleanups in GenBCode
|
| | | | | | | | |
|
| | |_|_|_|/ /
| |/| | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8607 Fix erasure for value class inheriting from private class
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
In the previous commit, we avoided an awkward chain of casts
by exploiting the knowledge that Scala defined classes will
by JVM accessible, and as such immune to `LinkageError`s when
used as the target of a cast.
This commit generalized this to the entire fix for SI-4283,
rather than just for derived value classes.
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The fix for SI-4283 added a pre-emptive cast of the qualifier of
a selection `qual.a` to avoid later casting to the owner of `a`
if that owner might be inaccessible at the call site. This fixed
a `LinkageError`.
In the enclosed test, this cast led to the following diff in the
tree shapes (with respect to a version with a public base class).
[erasure]
- new p1.C.<init>(c.$asInstanceOf[scala.this.Int]()).a();
+ new p1.C.<init>(new p1.C.<init>(c.$asInstanceOf[scala.this.Int]()).$asInstanceOf[ErasedValueType( class C, scala.this.Int)]().$asInstanceOf[scala.this.Int]()).a();
[posterasure]
- new p1.C.<init>(c).a();
+ new p1.C.<init>(new p1.C.<init>(c).$asInstanceOf[scala.this.Int]().$asInstanceOf[scala.this.Int]()) .a();
()
What we really wanted to end up with is:
new p1.C.<init>(c).$asInstanceOf[C]().a();
The stray cast leads to the crash:
error: should have been unboxed by erasure: new p1.C.<init>(c).$asInstanceOf[scala.this.Int]()
Rather than trying to fix this in erasure/posterasure, this commit
instead relies on the fact the owner of `a` cannot be Java defined
if `qual`s type is a derived value class. This follows from the
restrictions we place on value classes.
With this knowledge, we elide the cast altogether in this case.
|
|\ \ \ \ \ \ \ \
| |_|_|/ / / / /
|/| | | | | | | |
SI-8346 Rebuild invariant sets in #toSet, avoiding CCE
|
| | |/ / / / /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
SI-3953 caused several types of sets' operations to trivially throw
`ClassCastException` after using inherited covariant #toSet method, by
doing an unchecked cast that is only safe for intrinsically covariant
set data structures like `HashSet`, but totally unsafe for others like
`TreeSet` or `Enumeration.ValueSet`.
This change moves the cast to the leaves of the class hierarchy where
that is safe, and incidentally undeprecates overriding Set#toSet.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8475 Fix off by one in GroupedIterator when Streaming
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
This also affected sliding and grouped since they defer to GroupedIterator
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-8625 fix unreachability analysis for boolean expressions
|
| | | | | | | | | |
|