Did a tour of the compiler adding a few longer-lived mutable structures
to the per-run cache clearing mechanism. Some of these were not a big
threat, but there is (almost) literally no cost to tracking them and the
fewer mutable structures which are created "lone wolf style" the easier
it is to spot the one playing by his own rules.
While I was at it I followed through on long held ambition to eliminate
the importing of highly ambiguous names like "Map" and "HashSet" from
the mutable and immutable packages. I didn't quite manage elimination
but it's pretty close. Something potentially as pernicious which I
didn't do much about is this import:
import scala.collection._
Imagine coming across that one on lines 407 and 474 of a 1271 file.
That's not cool. Some poor future programmer will be on line 1100 and
use "Map[A, B]" in some function and only after the product has shipped
will it be discovered that the signature is wrong and the rocket will
now be crashing into the mountainside straightaway. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25286 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
Implementation of Iterator.scala defined a structural type
by mistake. By naming a class we get rid of that structural
type.
Fixes#4791. No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25283 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
pretty printing variety. Non-invasive surgery, don't worry martin.
Simplified the input to lublist a bit. Includes illustrative
test case for current brand of lub failures. Review by moors.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25275 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
type mismatches, for real this time. :power mode goes to
phase typer automatically.
You can get the symbols for repl-defined names more directly:
scala> case class Bippy(x: Int)
defined class Bippy
scala> intp.terms("Bippy")
res1: intp.global.Symbol = object Bippy
scala> intp.types("Bippy")
res2: intp.global.Symbol = class Bippy
scala> intp("Bippy") // tries type first
res3: intp.global.Symbol = class Bippy
scala> intp("scala.collection.Map") // falls back to fully qualified
res4: intp.global.Symbol = trait Map
I changed the implicit which used to install "tpe" and "symbol"
to install "tpe_" and "symbol_" because it was too easy to do something
you didn't mean to, like calling x.tpe where x is a Manifest.
Said implicit now handles manifest type arguments, so you can get
the full translation from a manifest representation to a compiler type,
at least for simple types and only as much as manifests work, which is
not that much. Fortunately that situation is all changing soon.
scala> List(List(1, 2, 3)).tpe_
res5: power.Type = List[List[Int]]
scala> res5.typeArgs
res6: List[power.global.Type] = List(List[Int])
Review by moors.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25272 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This changes the signature of flatten - I do not see how to use a @bridge annotation here, since after erasure both the bridge and the original method have the same signature.
Review by extempore.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25258 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
thousands without them. This kind of thing makes for unnecessary
difficulties. I fixed everything to use unix line endings.
At some point we can enforce that with a git post-commit hook,
but until then we're on the honor system.
There are useful elaborations for users of all platforms here:
http://help.github.com/line-endings/
No review.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25249 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
are automatically cleared after each compilation run. Since I am not too
familiar with the mechanics of the presentation compiler I'm not sure
this addresses the problem, or that it doesn't clear something which
shouldn't be cleared. Also, this is only a sampling of possible mutable
sets and maps: let me know if it does the job and I can expand it.
Review by dragos.
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@25248 5e8d7ff9-d8ef-0310-90f0-a4852d11357a