| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
| |
|
|
|
|
|
| |
No review.
|
|
|
|
|
|
|
|
|
|
|
| |
During the generation of the specialized method implementation, local
lazy vals in specialized classes were getting duplicated and assigned
new (different) names. Also, the identifiers referring to them were not
getting updated. This is fixed now. Further, the mutable flag is no
longer getting set for a lazy val during method body duplication.
Review by Dragos.
|
|
|
|
|
| |
Correcting resolution of top-level objects in reflection.
|
|
|
|
|
|
| |
Added new test file for reification/relfection, which does not work yet
under partest, but works when run individually.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Finished giving case classes a ProductN parent, and flipped it on. The
"finish" part involved not breaking existing code where case classes
manually extend the appropriate ProductN. (Like, Tuple 1-22.)
- Generalized most of SyntheticMethods to ease method creation and class
manipulation in general.
- Fixed bugs related to the above, like the fact that this used to be a
compile error:
scala> case class Foo() extends Serializable
<console>:28: error: trait Serializable is inherited twice
case class Foo() extends Serializable
^
It feels like there's a better way to eliminate the duplicate parents,
but after spending a lot of time chasing my tail in that peril-fraught
zone between namer and typer, I don't see an easy path to improve on
it. Closes SI-1799. For that modification to Typers, review by odersky.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added an "Abstract" method info to the specialized phase, which denotes
that no implementation should be generated.
Previously:
trait A[@specialized(Boolean) T] {
def foo: T
}
used to generate:
trait A$mcZ$sp extends A[Boolean] {
def foo$mcZ$sp = this.foo
}
which caused cyclic calls because of linearization rules when several
traits are mixed together. Now, the following is generated:
trait A$mcZ$sp extends A[Boolean] {
def foo$mcZ$sp: Boolean
}
Review by dragos.
|
|
|
|
|
|
| |
Added test for the completion problem in the presentation compiler
reported in the scala-ide ticket 1000620.
|
| |
|
|
|
|
|
|
| |
Handling Freevars in Importers and discovering whole new classes of
errors in Liftcode.
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Current design of error trees complicates the design of reflection
library, and introduces sometimes unnecessary boilerplate and since I
do not want to stall that work I am reverting all the changes related
to error trees. A different design is currently under consideration but
work will be done on separate branch on github.
Revisions that got reverted:
r25705, r25704 (partially), r25673, r25669, r25649, r25644, r25621, r25620, r25619
Review by odersky and extempore.
|
|
|
|
|
|
|
| |
It was time. Removed unused flags and devirtualize detritus. Cleaned up
flags a bit further. Fixed the contents of phaseNewFlags in those places
where it was inaccurate. No review.
|
| |
|
|
|
|
|
|
| |
Started work on compiler toolbox that can compile reflect trees at
runtime.
|
|
|
|
|
|
| |
Changes to Liftcode to use new reflection semantics, where a compiler
uses type checking.
|
|
|
|
|
| |
Review by Dragos.
|
|
|
|
|
|
|
| |
Added new disabled test for eclipse scala-ide ticket1000609. Corrected
test framework to fail nicely when the tree retrieved after an has no
associated symbol.
|
|
|
|
|
|
|
| |
When a reasonable lub cannot be arrived at by direct means, use the
bounds of the lub inputs to derive bounds for the lub rather than giving
up. Closes SI-4938, review by moors.
|
|
|
|
|
| |
Fix for bumpy proxy equals. Closes SI-4807, no review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This commit fixes two major problems:
1. InnerClasses table missed entries
that would close the chain between
nested and top-level class.
2. In some situations, classes
corresponding to objects would be
not be reported in the InnerClasses
table.
For details it's the best to check SI-4819, SI-4820 and SI-4983.
First problem mentioned above was straightforward to fix so I won't be
going into details.
The second one deserves more attention. From now, classes corresponding
to objects are properly reported as inner classes. Also, members
(classes, objects) of objects are reported as inner classes of classes
corresponding to objects.
There's one caveat though: top level objects get two classes (regular
and mirror). Members of top-level objects are declared as inner classes
of *mirror* class and not regular one. The reason for that is to allow
importing them from Java. For example:
object A { class B }
will be compiled into following classes: A, A$, A$B. If we declared
A$B as inner class of A$ (regular class for objects) then it would be
impossible to import B using "import A.B" or "import A$.B" constructs.
The reason for that is that Java compiler seems to blindly put dollars
instead of looking at InnerClasses attribute.
Since non-top-level objects don't have a mirror class it's impossible to
use the same solution. Thus, in case like this:
object A { object B { class C } }
it's impossible to import C from Java. That's the tradeoff for fixing
other (more serious) problems. It's never been possible to do that in a
clean way so we are not making situation worse.
As a nice consequence of this change, we get better way to refer to
inner members of top-level objects. It's been reflected in one of
test-cases that is updated by this change.
Fixes SI-4789 SI-4819 SI-4820 SI-4983 and possibly some other tickets
related to reflection.
Review by extempore, dragos.
|
|
|
|
|
|
| |
Figured out how to turn it on by default, even.
Closes SI-4979, no review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Various and sundry manipulations to allow for objects to be overridden
when the mood is right. It is not enabled by default.
The major contributor of change turned out to be the decoupling of
the FINAL flag (and the "isFinal" test which examines only that flag)
and the many semantics which were attributed to this interpretation
of finality in different circumstances. Since objects no longer have
the FINAL flag automatically applied (only top-level objects and those
marked final in source code do) we need apply a more nuanced test.
Fortunately there is such a nuanced test: isEffectivelyFinal,
which is always true if the FINAL flag is set but also in various
other circumstances. In almost every case, you should be testing
"isEffectivelyFinal", not "isFinal".
To enable overridable objects, use:
-Yoverride-objects
-Xexperimental // includes the above and others
Remain to be done: working out transition logistics. Most likely this
would involve bumping the scala signature version, and all objects in
versions before that would be assumed final.
Review by moors.
|
|
|
|
|
|
| |
Integrates recent speed improvements to algorithm.
Contributed by Ruediger Keller, no review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are no more direct calls to context.error from Typers and Infer,
so more work needs to be done to finish it for Implicits and Namers.
I am pushing it to trunk so that all of you can share my pain (and
complain). Please do not add any more context.error randomly in that
code, instead deal with it appropriately (by creating specific error
tree).
I was trying to be as informative when it comes to error tree names
as possible, but if you feel like changing names to something more
appropriate then feel free to do so. When it comes to printing error
messages I tried to follow test suite as closily as possible but
obviously there were few changes to some tests (mostly positive, I
believe).
On my machine performance drawback was neglible but I am working on more
aggressive caching to reduce the penalty of containsError() calls even
more. Any suggestions welcome.
At the moment the code supports both styles i.e. throwing type errors
for the cases that are not yet handled and generating error trees. But
in the future we will drop the former completely (apart from cyclic
errors which can pop up almost everywhere).
Review by odersky, extempore and anyone who feels like it.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Formerly a specializable type parameter would be missed if in an
intersection.
trait Trait[@specialized T] {
def f[T](x: Foo[T] with Bar) = x
}
Now that is specialized, as it already was in the "Foo[T]" case. Closes
SI-4794, no review.
|
|
|
|
|
|
|
|
| |
Moved test for scala-ide ticket-1000508 under /disabled/presentation/
directory, as the current test's result is wrong (the ticket is still
opened). It will be moved back only once the ticket is closed. No
review.
|
|
|
|
|
|
|
| |
Created test cases for tickets that need to be fixed in the presentation
compiler. These tests should eventually be moved under folder
/files/presentation/ once they are working.
|
|
|
|
|
|
|
|
| |
Offer warning when demonstrably non-side-effecting expressions appear in
statement position, which should be unintentional by definition. Threw
in removal of six places with useless discarded expressions which the
warning informed me about. No review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Made it possible to supply a custom Global to the core scala runners.
The absence of "Global pluggability", combined with the fact that most
of the functionality in Global is unnecessarily rigid due to the phases
being implemented as objects, means that it has been close to impossible
to do interesting compiler development in a way which doesn't require
modifying the scalac source tree. This then leaves you continually
subject to punishment by code drift as the various places you were
forced to modify change out from under you.
This is somewhat less true now, thanks to new option: -Yglobal-class
The primary wielders of Global (fsc/scala/scalac) now instantiate
the compiler via a (Settings, Reporter) => Global factory method in
the Global companion. If -Yglobal-class was given, that class (which
must have a (Settings, Reporter) constructor) will be instantiated if
possible, falling back on the standard one. See
test/files/pos/CustomGlobal.scala
for a working example. (It's not in run because I would have to be able
to give partest a different set of flags for successive compiles in the
same test.) Review by odersky.
|
|
|
|
|
|
| |
Added package object support to reflection framework. Removed debug
output and made some speed improvements.
|
| |
|
| |
|
| |
|
|
|
|
|
| |
Sorting test output so it passes on java7, no review.
|
| |
|
|
|
|
|
|
| |
Removed and consolidated several redundant tests which had filenames
"bugXXX" and "tXXX" where XXX == XXX. No review.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Created infrastructure for testing icode + settings/partest yak shaving.
See enclosed test files/run/inline-ex-handlers.scala. To compare
optimized and unoptimized icode after a given phase, all you need in a
partest source file is this:
import scala.tools.partest.IcodeTest
object Test extends IcodeTest {
override def printIcodeAfterPhase = "inlineExceptionHandlers"
}
Other things can be done, see IcodeTest.scala. Review by ureche.
|
|
|
|
|
|
| |
Bug in optimizer eliminated potentially exceptional not-dead code.
Streamlined isSideEffecting logic. Review by ureche.
|
|
|
|
|
|
| |
[recommit] Backend optimization: Inline exception handlers. Review by
dragos.
|
| |
|
|
|
|
|
|
|
|
|
| |
Major rewrite of the testing infrastructure for the presentation
compiler. Added several new tests that will be part of the nightly
build. Once the move to SBT is completed I will look into how to extract
the test infrastructure (as it should really not be living in the
compiler codebase). Review by dragos
|
|
|
|
|
|
| |
Improved the error message given when a concrete method implementation
doesn't match the abstract one. No review.
|
|
|
|
|
|
|
| |
Removing the code which has been deprecated since 2.8.0. Contributed by
Simon Ochsenreither, although deleting code is such fun one hesitates to
call it a contribution. Still, we will. Closes SI-4860, no review.
|
| |
|