| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
| |
So we can eliminate tail calls within.
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
# By Jason Zaugg (8) and others
# Via Adriaan Moors (6) and Josh Suereth (5)
* origin/2.10.0-wip:
Removing controversial `either` method from Futures API.
SI-6624 set info of case pattern binder to help find case field accessors
Fixes SI-6628, Revert "Fix for view isEmpty."
SI-6661 - Remove obsolete implicit parameter of scala.concurrent.promise method
Fixes SI-6559 - StringContext not using passed in escape function.
SI-6648 copyAttrs must preserve TypeTree#wasEmpty
Fix raw string interpolator: string parts which were after the first argument were still escaped
Update comment.
SI-6646 `ident` or Ident is always new binding.
SI-6440 Address regressions around MissingRequirementError
Refine the message and triggering of MissingRequirementError.
SI-6640 Better reporting of deficient classpaths.
SI-6644 Account for varargs in extmethod forwarder
SI-6646 Fix regression in for desugaring.
Update tools/epfl-publish
|
| |\
| | |
| | | |
SI-6624 better lookup of case field accessors for case class pattern with complicated type
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
sometimes the type checker infers a weird type for a sub-pattern of a case class/extractor pattern
this confuses the pattern matcher and it can't find the case field accessors for the sub-pattern
use the expected argument type of the extractor corresponding to the case class that we're matching
as the info for the sub-pattern binder -- this type more readily admits querying its caseFieldAccessors
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This field tracks whether the type is an inferred
on, subject to removal in `resetAttrs`, or an explicit
type, which must remain.
In ae5ff662, `ResetAttrs` was modified to duplicate
trees, rather than mutate trees in place. But the
tree copier didn't pass `wasEmpty` on to the new tree,
which in turn meant that the subsequent typing run
on the tree would not re-infer the types. If the
type refers to a local class, e.g. the anonymous
function in the enclosed test case, the reference
to the old symbol would persist.
This commit overrides `copyAttrs` in TypeTree to
copy `wasEmpty`.
We might consider representing this as a tree
attachment, but this would need to be validated
for the performance impact.
|
|\ \
| | |
| | | |
Fixes SI-6551.
|
| | |
| | |
| | |
| | | |
Don't rewrite an explicit apply method to dynamic polytypes.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This has been broken since https://github.com/scala/scala/commit/b7b81ca2#L0L567.
The existential rash is treated in a similar manner as in fc24db4c.
Conceptually, the fix would be `def selfTypeSkolemized =
widen.skolemizeExistential.narrow`, but simply widening before
narrowing achieves the same thing. Since we're in existential voodoo
territory, let's go for the minimal fix: replacing `this.narrow` by
`widen.narrow`.
--
Original patch by @retronym in #1074, refined by @paulp to
only perform widen.narrow incantation if there are
existentials present in the widened type, as
narrowing is expensive when the type is not a singleton.
The result is that compiling the entirety of quick, that
code path is hit only 143 times. All the other calls hit
.narrow directly as before. It looks like the definition
of negligible in the diff of -Ystatistics when compiling
src/library/scala/collection:
< #symbols : 306315
---
> #symbols : 306320
12c13
< #unique types : 293859
---
> #unique types : 293865
I'm assuming based on the 2/1000ths of a percent increase
in symbol and type creation that wall clock is manageable,
but I didn't measure it.
|
|\| |
|
| |\
| | |
| | | |
Fix for SI-6600, regression with ScalaNumber.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Not much in the end; I divided ScalaNumericConversions
into two traits such that the ScalaNumericAnyConversions can
be used in value classes, and ScalaNumericConversions can
override methods in ScalaNumber (since one trait cannot do
both those things.)
The fact that ScalaNumber is privileged for equality but a) extends
java.lang.Number and therefore b) cannot be a value class is something
we will want to revisit real soon.
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
e6b4204604 moved access widenings from ExplicitOuter to
SuperAccessors to reflect them in pickled signatures so
that the inliner can take advantage of them under separate
compilation.
The followup discussion [1] determined that this wasn't
the right solution: while it enabled new separate compilation
inlinings, it failed to widen access of outer pointers and
hence prevented certain inlinings.
A better solution was proposed: modify the inliner to know
that access widening is guaranteed to have happened in
ExplicitOuter for any field accessed by an @inline-d method
body, rather than relying solely on the pickled types.
But this hasn't happened yet. In the meantime 07f94297 / #1121
reinstated the access widening to SuperAccessors, but took a
slightly different approach, using `Symbol#enclMethod` rather
than `closestEnclMethod`. That deviation triggers SI-6562.
This commit goes back to `closestEnclMethod`.
[1] https://groups.google.com/forum/#!topic/scala-internals/iPkMCygzws4
|
| |\
| | |
| | | |
SI-6556 no assert for surprising ctor result type
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previous fix to value classes uncovered some questionable cases in the backend where result types of constructor signatures are surprising. It's not a big deal because these types will be ignored afterwards anyway. But
the method uncovered some questionable situations which we should follow up on. However, breaking 2.9 code because of this is way too harsh. That's why the asserts were converted to warnings.
review by @paulp, @adriaanm
|
| |\ \
| | | |
| | | | |
Fixes SI-5031 for separate compilation scenario.
|
| | |/
| | |
| | |
| | |
| | |
| | |
| | | |
When you have a conflicting member in package object and normal package that share the same namespace we remove the latter ClassSymbol from the scope. Now, this has an unpleasant consequence that companionClass/companionModule/companionSymbol no longer work correctly as they rely on finding the correspondent symbol using decls of the owner.
This fixes the problem of SI-5031 for separate compilation. Why the above change matters for finding foo.bar.Foo? Because when parsing the class we needed information about the static module (and we have the correct module symbol when completing the info). It's just that 043ce6d0565c9d5d960 relied on no longer valid assumptions. So we were getting NoSymbol and sym.exist was failing.
Obviously a more complete solution would be better if we didn't rely on the scope but that's too big to change for 2.10.0.
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
# By Jason Zaugg (5) and others
# Via Josh Suereth (5) and others
* origin/2.10.0-wip:
Use Typed rather than .setType
Wider use and a new variant of typedPos.
SI-6575 Plug inference leak of AbstractPartialFun
Disabled generation of _1, _2, etc. methods.
SI-6526 Additional test case.
Fix SI-6552, regression with self types.
avoid single-art assert where harmful in duration-tck
Fix for SI-6537, inaccurate unchecked warning.
SI-6526 Tail call elimination should descend deeper.
Changes Tree and Type members from vals to defs.
Fixes SI-6170: issue with dragging scaladoc splitter over central iframe
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Usually this isn't needed, as partial functions can only be
defined with an expected type. But if that expected type is
and inherited method return type, the actual type of the partial
function literal is used, and the implementation detail of
`AbstractPartialFunction[A, B] with Serializable` leaks out.
After this change, the inferred types match those from
Scala 2.9.2.
ticket/6575 ~/code/scala scalac29 -Xprint:typer test/files/pos/t6575a.scala | grep def > 29.txt
ticket/6575 ~/code/scala squalac -Xprint:typer test/files/pos/t6575a.scala | grep def > 210.txt
ticket/6575 ~/code/scala diff -u 29.txt 210.txt
--- 29.txt 2012-10-28 13:51:07.000000000 +0100
+++ 210.txt 2012-10-28 13:51:20.000000000 +0100
@@ -1,7 +1,16 @@
def foo: PartialFunction[Int,Int]
def /*Y*/$init$(): Unit = {
- absoverride def foo: PartialFunction[Int,Int] = ((x0$1: Int) => x0$1 match {
+ absoverride def foo: PartialFunction[Int,Int] = {
+ def <init>(): anonymous class $anonfun = {
+ final override def applyOrElse[A1 >: Nothing <: Int, B1 >: Int <: Any](x$1: A1, default: A1 => B1): B1 = (x$1: A1 @unchecked) match {
+ final def isDefinedAt(x$1: Int): Boolean = (x$1: Int @unchecked) match {
def /*Z*/$init$(): Unit = {
- absoverride def foo: PartialFunction[Int,Int] = ((x0$2: Int) => x0$2 match {
+ absoverride def foo: PartialFunction[Int,Int] = {
+ def <init>(): anonymous class $anonfun = {
+ final override def applyOrElse[A1 >: Nothing <: Int, B1 >: Int <: Any](x$1: A1, default: A1 => B1): B1 = (x$1: A1 @unchecked) match {
+ final def isDefinedAt(x$1: Int): Boolean = (x$1: Int @unchecked) match {
def /*Comb*/$init$(): Unit = {
- absoverride def foo: PartialFunction[Int,Int] = ((x0$3: Int) => x0$3 match {
+ absoverride def foo: PartialFunction[Int,Int] = {
+ def <init>(): anonymous class $anonfun = {
+ final override def applyOrElse[A1 >: Nothing <: Int, B1 >: Int <: Any](x$1: A1, default: A1 => B1): B1 = (x$1: A1 @unchecked) match {
+ final def isDefinedAt(x$1: Int): Boolean = (x$1: Int @unchecked) match {
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
In 6eb55d4b7a we put in a remedy for an old issue SI-4560 which
had accumulated a number of sketchy partial remedies which carried
no tests to illustrate their necessity. Looks like at least one of
those was doing something useful. Here's to reversion-reversion.
This reverts commit c8bdf199, which itself reverted cb4fd6582.
|
| |
| |
| |
| |
| |
| |
| |
| | |
I found a more direct expression of the unchecked logic,
which should be much easier for others to verify. But the
bug being fixed here is that the unchecked checking happens
too early, and the sealed children of a symbol are not yet
visible if it is being simultaneously compiled.
|
| | |
|
|/
|
|
|
|
|
|
|
|
|
|
|
| |
Until now lazy accessors were handled somehow special because their symbol was created in typers but the corresponding tree was only added in Refchecks. This irregularity caused serious problems for value classes. Also it now looks just better when lazy value is treated in a similar way as other fields.
I needed to adapt reifier so that it handles the new implementation correctly. Previously it had to recreate lazy val only by removing defdef and renaming. Now we basically need to recreate lazy val from scratch.
There is one minor change to cps plugin but that is still fine because lazy vals were never really part of the transformation.
Some range positions needed to be fixed manually. We could do it at the creation time but that would require a lot more "if (symbol.isLazy)" conditions for MethodSyntheis and Symbol/Tree creation and would just unnecessary complicate api. If someone has a better idea, please speak up. Range positions changes were necessary because previously accessors were created at refchecks and they weren't checked by validator (even though they were wrong).
This commit removes lazy val implementation restriction introduced for 2.10.0.
(cherry-picked from 981424b)
|
|
|
|
|
|
|
|
|
|
|
|
| |
I can't do any better than a reproduced comment:
For some reason which is still a bit fuzzy, we must let Nothing
through as a lower bound despite the fact that Nothing is always
a lower bound. My current supposition is that the side-effecting
type constraint accumulation mechanism depends on these subtype
tests being performed to make forward progress when there are
mutally recursive type vars. See pos/t6367 and pos/t6499 for the
competing test cases.
|
|\
| |
| | |
SI-6215 Fix compiler crash on private method in value class
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes the problem with private defs in value classes by moving the $extension after the name proper rather than before. The previous scheme did not commute with makeNonPrivate:
I.e. if -ext-> is "generate extension name" and -mnp-> is "make not private" we did get for
method foo in value class Foo:
foo -ext-> extension$foo -mnp-> Foo$$extension$foo
but
foo -mnp-> Foo$$foo -ext-> extension$Foo$$foo
With the change both variations give the same name:
foo -ext-> foo$extension -mnp-> Foo$$foo$extension
but
foo -mnp-> Foo$$foo -ext-> Foo$$foo$extension
|
|/
|
|
|
| |
Macros don't correspond to bytecode-level methods, therefore
there's no need to undergo any transformations past typer.
|
|
|
|
|
| |
This covers the situation which broke in 5c5e8d4dcd,
reverted in the previous commit.
|
|
|
|
| |
This reverts commit 5c5e8d4dcd151a6e2bf9e7c259c618b9b4eff00f.
|
|
|
|
|
| |
When there is a test called pos/t1107.scala and also a test
called pos/t1107, it is bad.
|
| |
|
|
|
|
|
|
| |
This brings all the files into line with the .gitattributes
settings, which should henceforth be automatically maintained
by git.
|
|
|
|
|
| |
As the experience has shown, there's no need for a separate layer of reflection
in scala-library.jar. Therefore I'm putting an end to it.
|
|
|
|
|
|
|
|
| |
This reverts commit cb393fcbe35d0a871f23189d791b44be1b826ed2.
Conflicts:
src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
|
|\
| |
| | |
cleaning up reflection
|
| |
| |
| |
| |
| |
| | |
1) parseExpr => parse
2) runExpr => eval
3) Introduces compile(Tree): () => Any, since it has frequent uses
|
|\ \
| |/
|/| |
Fix for SI-6245 with workaround for SI-2296.
|
| |
| |
| |
| |
| |
| |
| | |
protected/super accessor issue: Don't subvert the creation of the
standard protected accessor with the java interop accessor. For
SI-2296, the compiler emits an error instead of causing an illegal
access error at runtime.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The new name for AbsTypeTag was a matter of a lengthy discussion:
http://groups.google.com/group/scala-internals/browse_thread/thread/fb2007e61b505c4d
I couldn't decide until having fixed SI-6323 today, which is about
trying to reflect against a local class using typeOf.
The problem with local classes is that they aren't pickled, so their metadata
isn't preserved between Scala compilation runs. Sure, we can restore some of
that metadata with Java reflection, but you get the idea.
Before today typeOf of a local class created a free type, a synthetic symbol,
with a bunch of synthetic children that remember the metadata, effectively
creating a mini symbol table. That might be useful at time, but the problem is
that this free type cannot be reflected, because the global symbol table of
Scala reflection doesn't know about its mini symbol table.
And then it struck me. It's not the presence of abs types (type parameters and
abs type members) that differentiates arbitrary type tags from good type tags.
It's the presence of types that don't map well on the runtime world - ones that
can't be used to instantiate values, ones that can't be reflected.
So we just need a name for these types. Phantom types are compile-time only
concept, whereas our types can have partial correspondence with the runtime.
"Weak types" sound more or less okish, so let's try them out.
|
|/
|
|
|
|
|
|
|
| |
This works around the issue of the inability to use classOf for top-level object classes by inventing a new
anonymous class and instantiating it just to grab its class. Since the class is a nested type of the
top-level object it'll be in the same classloader unless some kind of evil behavior is afoot.
This patch should be undone if ever SI-2453 ever gets fixed, or we wind up with a direct way to grab
the class of an object.
|
|\
| |
| | |
Fix for SI-6367, exponential time in inference.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This pathology is not new - it can be witnessed in 2.9,
where compiling the test case enclosed with this ticket with
-Yinfer-debug will print a line with (pinky to lips) one million
type parameters. 1048576 actually, aka 2^20. But in 2.9 we were
somehow getting away with creating the list, presumably by not
spending much time looking at it. Somewhere between there and M1,
that changed.
I cut it off at the knees - don't create a list of one million
upper bound constraints when 1 will suffice. It would not be too
surprising if this proves to be a boon for performance.
|
|/ |
|
|
|
|
| |
it keeps failing randomly, e.g. http://scala-webapps.epfl.ch/artifacts/e3b0c7abbf637dacce7bcd7b69d5655820e8e714/buildLog.txt
|
|\
| |
| | |
SI-6335 More precise location of the implicit class synthetic method.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
One approach would be to disallow an implicit class in a template
that already has a member with the same name.
But this commit doesn't do this; instead it uses `isSynthetic` to
find the synthesized implicit conversion method from the potentially
overloaded alternatives.
|
|/
|
|
|
|
|
|
|
| |
class
Add a case to the ad-hoc (or add-hack) addSynthetics to keep the trees close.
This relies on naming convention, so changes in naming of the implicit def
would require an update here.
|
|\
| |
| | |
SI-6274 Fix owners when eta-expanding function with byName param
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When eta-expanding a function that takes a by-name param the local definition
for the corresponding argument is a function-0
val eta$1 = () => { argument-to-by-name }
If there are any definitinos in the `argument-to-by-name`, the symbol
owner needs to be changed to the anonymous function's symbol.
To know the function symbol in eta expand, we need to type-check the
function, and therefore pass the `Typer` instance to `etaExpand`.
|
|\ \
| |/
|/| |
Fix SI-6294.
|