| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
| |
- Language imports are preceding other imports
- Deleted empty file: InlineErasure
- Removed some unused private[parallel] methods in
scala/collection/parallel/package.scala
This removes hundreds of warnings when compiling with
"-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
|
|
|
|
|
|
| |
Previously tuple tree generation code has been implemented in
three place: tree builder, tree gen, build utils. Now it's just
defined once in tree gen.
|
|
|
|
|
|
|
| |
Most of this was revealed via -Xlint with a flag which assumes
closed world. I can't see how to check the assumes-closed-world
code in without it being an ordeal. I'll leave it in a branch in
case anyone wants to finish the long slog to the merge.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TreeDSL has no future - it was always a temporary measure
waiting for something like quasiquotes to come along. In this
commit I cull as much of it as I can, especially the delicate
matter of creating new DefDefs and ValDefs, which I completely
turn over to the old style creators.
I unified all the symbol-based DefDef and ValDef creators under
a single method, since it was yet another place where ctrl-C and
ctrl-V were being punched with glee. Was beaten to the punch on
adding copyTypeDef to fill out the *Def creators.
Eliminated as many redundant positioning calls as I could find.
If you are creating a DefTree tree based on a symbol, it will
always have an atPos(sym.pos) { ... } wrapped around it. You
don't need another one.
All of this is motivated by positions work: positions are
assigned in so many places and in such an ad hoc fashion that
it is impossible to bring consistency to that without first
bringing some consistency to tree creation.
|
|
|
|
|
|
|
|
|
|
|
|
| |
The implementation had come to depend on finalResultType
accidentally doing things beyond its charter - in particular,
widening types. After hunting down and fixing the call sites
depending on the bugs, I was able to rewrite the method to do
only what it's supposed to do.
I threw in a different way of writing it entirely to suggest how
some correctness might be obtained in the future. It's a lot
harder for a method written like this to break.
|
|
|
|
| |
Motivated by pattern matcher work, also useful elsewhere.
|
|
|
|
|
| |
Now when there's no hope left for type macros, it's reasonable to provide
a more specific type for DefDef.name.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have lots of core classes for which we need not go through
the symbol to get the type:
ObjectClass.tpe -> ObjectTpe
AnyClass.tpe -> AnyTpe
I updated everything to use the concise/direct version,
and eliminated a bunch of noise where places were calling
typeConstructor, erasedTypeRef, and other different-seeming methods
only to always wind up with the same type they would have received
from sym.tpe. There's only one Object type, before or after erasure,
with or without type arguments.
Calls to typeConstructor were especially damaging because (see
previous commit) it had a tendency to cache a different type than
the type one would find via other means. The two types would
compare =:=, but possibly not == and definitely not eq. (I still
don't understand what == is expected to do with types.)
|
|
|
|
|
|
|
|
|
|
| |
What would you prefer?
adaptToMemberWithArgs(tree, qual, name, mode, false, false)
Or:
adaptToMemberWithArgs(tree, qual, name, mode, reportAmbiguous = false, saveErrors = false)
|
|
|
|
|
|
| |
There's no longer any need to maintain a distinction, as
the tree sharing among literals which it is trying to avoid
no longer takes place.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Tracking shared trees led to various perpetrators, the simplest of
which are addressed herein. More consideration will be required:
we need to approach the problem with sufficient command to assure
both that trees are only shared when safe (which might without
architectural changes be "never") but also that we do not
duplicate definition trees unless it is appropriate.
Why do we care about tree sharing? Sometimes, a lot of the time
even, you can get away with sharing trees - but that's also why
it's responsible for all kinds of trouble. If the compiler would
break obviously and immediately then we wouldn't be doing it.
The danger of sharing is that one piece of an AST may undergo a
transformation or mutation and an unrelated piece of the AST will
be partially dragged into the change. The danger has become more
urgent with the arrival of macros. The first step in preventing
tree sharing mishaps is to reduce the amount the compiler does so
whatever is left is a lot easier to see. As a happy accident, it
will also fix bugs.
|
|
|
|
| |
And simplify the name implicits.
|
|
|
|
|
| |
All those old-timey methods whose melodies have become
unfashionable.
|
|
|
|
| |
This reverts commit 951fc3a486.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
I want to get this commit into the history because
the tests pass here, which demonstrates that every commented
out method is not only unnecessary internally but has zero
test coverage. Since I know (based on the occasional source
code comment, or more often based on knowing something about
other source bases) that some of these can't be removed
without breaking other things, I want to at least record
a snapshot of the identities of all these unused and
untested methods.
This commit will be reverted; then there will be another
commit which removes the subset of these methods which I
believe to be removable. The remainder are in great need of
tests which exercise the interfaces upon which other
repositories depend.
|
|
|
|
|
|
|
|
|
| |
A dizzying number of unused imports, limited to files
in src/compiler. I especially like that the unused import
option (not quite ready for checkin itself) finds places
where feature implicits have been imported which are no
longer necessary, e.g. this commit includes half a dozen
removals of "import scala.language.implicitConversions".
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These things are killing me. Constructions like
package scala.foo.bar.baz
import foo.Other
DO NOT WORK in general. Such files are not really in the
"scala" package, because it is not declared
package scala
package foo.bar.baz
And there is a second problem: using a relative path name means
compilation will fail in the presence of a directory of the same
name, e.g.
% mkdir reflect
% scalac src/reflect/scala/reflect/internal/util/Position.scala
src/reflect/scala/reflect/internal/util/Position.scala:9: error:
object ClassTag is not a member of package reflect
import reflect.ClassTag
^
src/reflect/scala/reflect/internal/util/Position.scala:10: error:
object base is not a member of package reflect
import reflect.base.Attachments
^
As a rule, do not use relative package paths unless you have
explicitly imported the path to which you think you are relative.
Better yet, don't use them at all. Unfortunately they mostly work
because scala variously thinks everything scala.* is in the scala
package and/or because you usually aren't bootstrapping and it
falls through to an existing version of the class already on the
classpath.
Making the paths explicit is not a complete solution -
in particular, we remain enormously vulnerable to any directory
or package called "scala" which isn't ours - but it greatly
limts the severity of the problem.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With this commit, the number of :: allocations logged in total
after individually compiling each scala file in src/compiler
drops from 190,766,642 to 170,679,925. Twenty million fewer
colon-colons in the world, it's a start.
For some heavily used lists like List(List()) I made vals so
we can reuse the same one every time, e.g.
val ListOfNil = List(Nil)
The modifications in this patch were informed by logging call
frequency to List.apply and examining the heaviest users.
>> Origins tag 'listApply' logged 3041128 calls from 318 distinguished sources.
1497759 scala.reflect.internal.Definitions$ValueClassDefinitions$class.ScalaValueClasses(Definitions.scala:149)
173737 scala.reflect.internal.Symbols$Symbol.alternatives(Symbols.scala:1525)
148642 scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.transform(SuperAccessors.scala:306)
141676 scala.tools.nsc.transform.SpecializeTypes$$anonfun$scala$tools$nsc$transform$SpecializeTypes$$specializedOn$3.apply(SpecializeTypes.scala:114)
69049 scala.tools.nsc.transform.LazyVals$LazyValues$$anonfun$1.apply(LazyVals.scala:79)
62854 scala.tools.nsc.transform.SpecializeTypes.specializedTypeVars(SpecializeTypes.scala:427)
54781 scala.tools.nsc.typechecker.SuperAccessors$SuperAccTransformer.transform(SuperAccessors.scala:293)
54486 scala.reflect.internal.Symbols$Symbol.newSyntheticValueParams(Symbols.scala:334)
53843 scala.tools.nsc.backend.icode.Opcodes$opcodes$CZJUMP.<init>(Opcodes.scala:562)
... etc.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
These are the regexp replacements performed:
Sxcala
-> Scala
Copyright (\d*) LAMP/EPFL
-> Copyright $1-2012 LAMP/EPFL
Copyright (\d*)-(\d*)(,?) LAMP/EPFL
-> Copyright $1-2012 LAMP/EPFL
Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL
-> Copyright $1-2012 Scala Solutions and LAMP/EPFL
\(C\) (\d*)-(\d*) LAMP/EPFL
-> (C) $1-2012 LAMP/EPFL
Copyright \(c\) (\d*)-(\d*)(.*?)EPFL
-> Copyright (c) $1-2012$3EPFL
The last one was needed for two HTML-ified copyright notices.
Here's the summarized diff:
Created using
```
git diff -w | grep ^- | sort | uniq | mate
git diff -w | grep ^+ | sort | uniq | mate
```
```
- <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div>
- copyright.string=Copyright 2002-2011, LAMP/EPFL
- <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/>
- * Copyright 2002-2011 LAMP/EPFL
- * Copyright 2004-2011 LAMP/EPFL
- * Copyright 2005 LAMP/EPFL
- * Copyright 2005-2011 LAMP/EPFL
- * Copyright 2006-2011 LAMP/EPFL
- * Copyright 2007 LAMP/EPFL
- * Copyright 2007-2011 LAMP/EPFL
- * Copyright 2009-2011 Scala Solutions and LAMP/EPFL
- * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL
- * Copyright 2010-2011 LAMP/EPFL
- * Copyright 2012 LAMP/EPFL
-# Copyright 2002-2011, LAMP/EPFL
-* Copyright 2005-2011 LAMP/EPFL
-/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */
-rem # Copyright 2002-2011, LAMP/EPFL
```
```
+ <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div>
+ copyright.string=Copyright 2002-2012 LAMP/EPFL
+ <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/>
+ * Copyright 2002-2012 LAMP/EPFL
+ * Copyright 2004-2012 LAMP/EPFL
+ * Copyright 2005-2012 LAMP/EPFL
+ * Copyright 2006-2012 LAMP/EPFL
+ * Copyright 2007-2012 LAMP/EPFL
+ * Copyright 2009-2012 Scala Solutions and LAMP/EPFL
+ * Copyright 2010-2012 LAMP/EPFL
+ * Copyright 2011-2012 LAMP/EPFL
+# Copyright 2002-2012 LAMP/EPFL
+* Copyright 2005-2012 LAMP/EPFL
+/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */
+rem # Copyright 2002-2012 LAMP/EPFL
```
|
|
|
|
| |
Int and Long. And Boolean (hey, he also deserves some credit!).
|
|
|
|
| |
feature clean.
|
|
|
|
|
| |
And eliminating redundancy. Reduced gratuitous usage of typeConstructor
on symbols which don't have type parameters.
|
|
|
|
|
| |
sharing trees is bad
also, substing in untyped trees into typed outer trees is not good for your health
|
|
|
|
| |
From the extempore archive of already implemented things.
|
|
|
|
| |
More trees created more uniformly.
|
|
|
|
| |
Streamlining some of our more common operations.
|
|
|
|
|
|
|
|
|
| |
There's every hint that it's a requirement that a TypeApply have
non-empty typeArgs, but testing for and handling the empty condition
is done irregularly. Made a mkTypeApply which handles the isEmpty case
(returning "fun" unchanged.) Also unified most of the variations of
casts under one umbrella. Review by moors.
|
|
|
|
|
|
|
|
| |
misc fixes while working on virtualizing pattern matching not directly
related to pattern matching, though
review by extempore
|
| |
|
|
|
|
|
|
|
| |
Triumph over various unsolved mysteries of the pattern matcher. More
elimination of redundant ways of doing things. More allowing the typer
to do its typing thing. No review.
|
|
|
|
|
|
| |
A few minor hashcode tidbits I had stored away from previous hashcoding,
and some fixups in treedsl. No review.
|
| |
|
|
|
|
|
|
| |
Integrating feedback from martin and iulian into recent patches and
prettifying checker output. No review.
|
|
|
|
|
|
| |
Fixed an ancient crasher in explicitouter involving singleton
self-types. Closes #266, review by odersky.
|
|
|
|
|
|
|
|
| |
Some progress on reviving TreeCheckers, plus a couple bugfixes and
better error messages revealed by that progress. Also applied tiny
increment in understanding to fixing up TreeDSL some more. The hand of
martin guides from above, so no review.
|
|
|
|
|
|
|
| |
impressively tedious it is to work directly with the AST, so I picked up
TreeDSL again and fleshed it out some more. And then I did a once over
on SyntheticMethods beating out bits of duplication. No review.
|
|
|
|
|
|
| |
A crasher in the pattern matcher revealed a flaw in how equality
comparisons were constructed. Closes #3570, no review.
|
|
|
|
|
|
|
|
| |
Changed the script runner mechanism to alchemize from AST atoms rather
than generating wrapper source, and fixed script position reporting.
This patch does not include a discussed change to mark some positions as
synthetic. Closes #3119, #3121. Review by milessabin.
|
|
|
|
|
|
|
|
|
|
|
| |
Swapped the order of the arguments to returning to make it consistent
with the way I've been using it for a long time. No review, how about
a question for nobody in particular instead: can we put this in the
library somewhere so I can stop looking around for it everywhere I go?
It's really handy.
def returning[T](x: T)(f: T => Unit): T = { f(x) ; x }
|
|
|
|
|
|
|
|
| |
Overhauled sequence length logic in the pattern matcher. Removes
unnecessary boxing and a few varieties of wrongness.
Closes #3395, #3150, #2958, #2945, #2187. No review.
|
|
|
|
|
|
| |
null, and thrown MatchErrors don't NPE trying to stringify null. No
review.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
a soft reference around cached classes so they do not interfere with
garbage collection. There is a test case, but it is in pending because I
spent longer trying to get it to fail under partest than I did writing
the actual patch. If you would like to see the behavior which was
corrected, go to
test/pending/run/bug2365
and run that script with scalac built before and after this commit.
Review by dubochet.
|
| |
|
|
|
|
|
| |
duplicated boxing code in the right location.
|
| |
|
|
|
|
|
|
| |
Breaking down the matcher's various Mix* classes into direct expressions
of condition/success/failure.
|
|
|
|
|
|
|
| |
1) Removed a bunch of unnecessary calls to the typer. 2) Reworked
exhaustiveness checking so I can tell what it's doing. 3) Cruft falls
away left, right, and center.
|
|
|
|
|
| |
Added -Ypmat-debug setting.
|
|
|
|
|
|
| |
Equality tests emerging from the pattern matcher should no longer
involve unnecessary boxing.
|