| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When checking `M[X] <:< M[Y]` for an `M` with an invariant
parameter, we have to check that `X <:< Y && Y <:< X`. This is
done in `isSubArgs`.
The compile time of that program in the ticket jumps from 20s in
2.10.4 to too-long-to-measure in 2.11.0. This commit reverts the
a subtle change to `isSubArgs` in ea93654 that was ultimately
responsible.
The search for this was unusually circuitious, even for scalac.
It appeared in 9c09c1709 due a tiny error that has since been
reverted in 58bfa19. But 58bfa19 still exhibited abysmal performance,
due to an intervening regression that I'm targeting here.
I haven't managed to extract a performance test from Slick. Using
the test that @cvogt provided, however, with this patch:
% time qbin/scalac -J-Xmx4G -classpath /Users/jason/code/slick-presentation/target/scala-2.10/classes:/Users/jason/.sbt/0.13/staging/b64b71d1228cdfe7b6d8/slick/target/scala-2.10/classes:/Users/jason/.ivy2/cache/org.slf4j/slf4j-api/jars/slf4j-api-1.6.4.jar /Users/jason/code/slick-presentation/src/main/scala/SlickPresentation.scala
real 0m21.853s
user 0m33.625s
sys 0m0.878s
Which is back to 2.10.x style performance.
|
|\
| |
| | |
SI-8329 Better hygiene for patmat partial functions
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Don't enter synthetic parameters of `applyOrElse` et al into
scope when typechecking the user-code; instead reference those
symbolically.
There is an exception to this principle. Currently we allow:
val x: PartialFunction[A, B] = x => x match { ... }
For this pattern of code, we use the given name `x` for the
corresponding method parameter of `applyOrElse` and `isDefinedAt`
and we actually need this to be in scope when we typecheck the
scrutinee. This construct is tested in `run/virtpatmat_partial.scala`.
A new parameter, `paramSynthetic`, differentiates this
case from the more typical `val x: PF[A, B] = { case ... => ... ; ... }
case, which uses a fresh name need not be in scope. (We could get
away with it, as it is fresh, but I thought it better to exclude it.)
|
|\ \
| | |
| | | |
SI-8463 Avoid unpositioned errors from search for views
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Ideally, I'd like to fix this using `saveErrors = false` here to
firewall the enclosing context from the ambiguiouty error encountered
during implicit search.
I originally proposed that patch as a fix for SI-8419 in
https://github.com/scala/scala/pull/3460 but withdrew from
that approach as I uncovered a deeper bug that meant that
we actually shouldn't have even been looking for views in
that case.
But, this runs into SI-8230 and these failures:
test/partest --update-check \
/Users/jason/code/scala/test/files/pos/t2504.scala \
/Users/jason/code/scala/test/files/pos/t4457_1.scala \
/Users/jason/code/scala/test/files/neg/t4457_2.scala
Turns out that typechecking the ostensible straight forward
application, `Array("abc")`, hinges on us leaking an ambiguity
error from `viewExists` to find a path through overload resolution!
This commit takes a tiny step forward by using `context.tree`
rather than `EmptyTree` as the argument to `inferImplicit`.
This avoids unpositioned type errors.
|
|\ \ \
| | | |
| | | | |
SI-8514 Remove scaladoc html inconsistencies
|
| | | |
| | | |
| | | |
| | | | |
Some classes only got inline comments instead of getting the full comment.
|
|\ \ \ \
| | | | |
| | | | | |
SI-8520 Fix -Dscalac.patmat.analysisBudget=off
|
| |/ / /
| | | |
| | | |
| | | | |
Correctly parse "off" instead of throwing java.lang.NumberFormatException
|
|\ \ \ \
| | | | |
| | | | | |
SI-8497 Fix regression in pickling of AnnotatedTypes
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Fixes an inconsistency introduced in these two spots:
https://github.com/scala/scala/pull/3033/files#diff-6ce1a17ebee31068f41c36a8a2b3bc9aR79
https://github.com/scala/scala/pull/3033/files#diff-c455cb229f5227b1bcaa1544478fe3acR452
The bug shows up when pickling then unpickling an AnnotatedType
that has only non-static annotations.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-8144 permalinks in scaladoc
|
| | | | | | |
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8430 Less non-determinism in patmat exhautiveness warnings
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Another mole whacked on the head by using `LinkedHashMap`.
Caution: `LinkedHashMap` doesn't preserve its runtime type if
you map through the generic interface. I've noted this gotcha as
SI-8434. I've structured this patch to enforce that concrete
collection with types, which is a good idea anyway.
My method to track this down was to place breakpoints in
`Hash{Map,Set}`.{foreach,iterator}` to see where that was
used from within pattern match translation. This approach was
drastically faster than my previous rounds of whack-a-mole.
The counter-examples are still a bit off; I'm going to merge
that aspect of this ticket with SI-7746, in which we've
pinpointed the culpable part of the implementation, but haven't
had success in fixing the bug.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8415 Exception handling in REPL init
|
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Incremental robustness, and probe for typer phase.
The probe would be unnecessary if repl contributed a
terminal phase that "requires" whatever it needs; that
is checked when the Run is built.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-7992 Fix super-accessor generation after a local class
|
| | |_|_|_|_|_|/
| |/| | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
The transformer in the superaccessors phase uses the var
`validCurrentOwner` to track whether we're in a part of the
code that won't end up in the host method, and as such, will
need to access super-method via a super-accessor.
But, this bit of bookkeeping was not correctly reset after traversing
out of a local class. A `VerifyError` ensued.
This commit changes `atOwner` to save and restore that flag, rather
than leaving it set to `true`.
I've also added a test variation using a by-name argument.
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
SI-8450 no "implicit numeric widening" in silent mode
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Before this fix, we get a second, spurious warning.
```
t8450.scala:5: warning: implicit numeric widening
def elapsed: Foo = (System.nanoTime - 100L).foo
^
t8450.scala:11: warning: implicit numeric widening
def elapsed: Foo = (System.nanoTime - 100L).foo
^
error: No warnings can be incurred under -Xfatal-warnings.
two warnings found
one error found
```
By respecting silent contexts, we now get only one.
I sneakily fixed similar occurrences without adding a test.
|
|\ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|/ /
|/| | | | | | | | |
SI-8461 -Xsource:2.10 mode for macro signature checks
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
I can't get the test to fail in partest, so I've resorted to
a manual test case.
% qbin/scalac -nobootcp -Dscala.usejavacp=false -Xsource:2.10 -classpath $HOME/.m2/repository/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.jar:$HOME/.m2/repository/org/scala-lang/scala-reflect/2.10.3/scala-reflect-2.10.3.jar test/files/pos/t8461/Impl.scala
warning: there were 1 deprecation warning(s); re-run with -deprecation for details
one warning found
% qbin/scalac -nobootcp -Dscala.usejavacp=false -Xsource:2.11 -classpath $HOME/.m2/repository/org/scala-lang/scala-library/2.10.3/scala-library-2.10.3.jar:$HOME/.m2/repository/org/scala-lang/scala-reflect/2.10.3/scala-reflect-2.10.3.jar test/files/pos/t8461/Impl.scala
test/files/pos/t8461/Impl.scala:6: error: macro implementations cannot have implicit parameters other than WeakTypeTag evidences
def reads[A] = macro readsImpl[A]
^
one error found
Before this change, when using a 2.10 JAR for scala-reflect, the
macro signature validation checks failed. This was due to the fact
that `scala.reflect.macros.Context` was changed in 2.11 to be
a type alias.
To get things working again, I've had to route both
`defintions.{WhiteBoxContextClass, BlackBoxContextClass}` to the
old location. This might mean that we misclassify the boxity under
this mode. All that we can actually handle are blackbox macros, really,
as macro expansion is likely to hit binary incompatibilites very
quickly. We can refine this in subsequent releases.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Correction in the documentation.
|
| | |_|_|_|_|_|/ /
| |/| | | | | | | |
|
|/ / / / / / / / |
|
|/ / / / / / /
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
While we must use full version, rather than the cross version
(12720e699), we need to use latest non-snapshot version.
This should avoid failures like:
https://jenkins.scala-ide.org:8496/jenkins/view/Scala%20Xsource%20flag%20nightlies/job/Akka/63/console
Such as:
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: UNRESOLVED DEPENDENCIES ::
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
[warn] :: org.scala-lang.plugins#scala-continuations-plugin_2.11.0-SNAPSHOT;1.0.1:
not found
[warn] ::::::::::::::::::::::::::::::::::::::::::::::
sbt.ResolveException: unresolved dependency:
org.scala-lang.plugins#scala-continuations-plugin_2.11.0-SNAPSHOT;1.0.1:
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8466 fix quasiquote crash on recursively iterable unlifting
|
| | |_|_|_|_|/
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
In order to handle unquoting quasiquotes needs to know if type is
iterable and whats the depth of the iterable nesting which is called
rank. (e.g. List[List[Tree]] is rank 2 iterable of Tree)
The logic that checks depth of iterable nesting didn't take a situation
where T is in fact Iterable[T] which caused infinite recursion in
stripIterable function.
In order to fix it stripIterable now always recurs no more than
non-optional limit times.
|
| | | | | | | |
|
| | | | | | | |
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Implicit search detects likely cycles by looking at the stack of
open implicits and checking the same implicit appears twice, and
if the second occurrence is trying satisfy an implicit search for
a "dominant" type.
Originally, this condition immediately failed the entire implicit
search. However, since Scala 2.10, this mechanism has been refined to
continue searching after the first divergent implicit is detected.
If a second divergence is found, we fail immediately. If the followup
search fails, we report the first divergence. Otherwise, we
take the successful result.
This mechanism was originally built around exceptions. This proved
to be fragile, and was refactored in SI-7291 / accaa314 to instead
use the `Context.errors` to control the process.
But, since that change, the pattern of implicits in scalanlp/breeze
and Shapeless have been prone to reporting the divergent implicit
errors where they used to recover.
So long as we left the `DivergentImplictTypeError` that originates
from a nested implicit search in `context.errors`, we are unable to
successfully typecheck other candidates. This commit instead
stashes the first such error away in `DivergentImplicitRecovery`,
to clear the way for the alternative path to succeed.
We must retain any other divergent implicit errors, as witnessed by
test/files/neg/t2031.scala, which loops unless we retain divergent
implicit errors that we don't stash in `DivergentImplicitRecovery`.
|
|/ / / / / /
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Better encapsulation for `DivergentImplicitRecovery` by replacing
the vars `countDown` and `implicitSym` with a single var holding
`Option[DivergentImplicitTypeError]`.
Also adds a pending test for SI-8460 that will be addressed in the
next commit. This commit is just groundwork and should not change
any results of implicit search.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
The continuations plugin should instead be a dependency of scala-dist,
as scala-library-all should be a drop-in replacement for scala-library,
and as such should not (indirectly) depend on plugins/the compiler.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8388 consistently match type trees by originals
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
Due to the fact that all TypTrees are transformed into TypeTrees
during typechecking one couldn't treat typed type trees in the same
way as they treat untyped type trees.
This change implements support for pattern matching of TypeTrees as their
corresponding TypTree equivalent using tree preserved in the original.
The implementation itself is a trivial wrapping of regular TypTree
extractors into MaybeTypeTreeOriginal.
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
SI-8350 SI-8387 tweak handling of new trees
|
| | | | | | | | |
|
| | |_|_|_|/ /
| |/| | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
q"new C" and q"new C()" have identical trees after parsing. This
commit adds knowledge of this invariant to SyntacticNew.
|
|\ \ \ \ \ \ \
| |_|_|/ / / /
|/| | | | | | |
SI-8451 makes uncurry more forgiving
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Apparently even though the rhs of a secondary constructor looks like an expr,
it always gets wrapped in a block by the parser. This works just fine with
the typer, but crashes in uncurry. This commit brings quasiquotes in line with the parser.
|
|\ \ \ \ \ \
| |/ / / / /
|/| | | | | |
SI-8437 macro runtime now also picks inherited macro implementations
|
| |/ / / /
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Previously it didn't matter much that we used Class.getDeclaredMethods
instead of just getMethods, but with the introduction of macro bundles
it can make a difference which is fixed in this commit.
I'd also like to note that the fact that getMethods only returns public
methods and getDeclaredMethods also sees private methods, doesn't make
a difference, because macro implementations must be public.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
SI-8411 match desugared partial functions
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
I just realized that our tag-based shortcuts were incomplete, because
they only work with root mirrors (doing just u.typeTag[T].tpe means that
the type is going to be resolved in u.rootMirror because that's the default).
This commit fixes this oversight. I'm hoping for 2.11.0-RC3, but also feel
free to reschedule to 2.12.0-M1 if it becomes clear that RC3 isn't happening.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8200 provide an identity liftable for trees
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
This liftable hasn't been originally included in the set of standard
liftables due to following contradiction:
1. On one hand we can have identity lifting that seems to be quite
consistent with regular unquoting:
q"..${List(1,2)}" <==> q"1; 2"
q"${List(1,2)}" <==> q"s.c.i.List(1, 2)"
q"..${List(q"a", q"b")}” <==> q"a; b"
q"${List(q"a", q"b")}" <==> q"s.c.i.List(a, b)"
This is also consistent with how lisp unquoting works although they
get lifting for free thanks to homoiconicity:
// scala
scala> val x = List(q"a", q"b); q"f($x)"
q"f(s.c.i.List(a, b))"
// scheme
> (let [(x (list a b))] `(f ,x))
'(f (list a b))
2. On the other hand lifting is an operation that converts a value into
a code that when evaluated turns into the same value. In this sense
Liftable[Tree] means reification of a tree into a tree that
represents it, i.e.:
q"${List(q"a", q"b")}"
<==>
q"""s.c.i.List(Ident(TermName("a")), Ident(TermName("b")))"""
But I belive that such lifting will be very confusing for everyone
other than a few very advanced users.
This commit introduces the first option as a default Liftable for trees.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-8420 don't crash on unquoting of non-liftable native type
|
| | |/ / / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Previously quasiquote's type-based dispatch failed to handle situation
where unquotee's type is native but non-liftable and was used to splice
with non-zero cardinality.
|