summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | Merge pull request #2367 from vigdorchik/si-6387-revertAdriaan Moors2013-04-091-24/+11
| |\ \ \ \ \ | | | | | | | | | | | | | | Revert "SI-6387 Clones accessor before name expansion"
| | * | | | | Revert "SI-6387 Clones accessor before name expansion"Eugene Vigdorchik2013-04-081-24/+11
| | | |_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 4e10b2c833fa846c68b81e94a08d867e7de656aa. Add 6387 test to pending and 7341 to up-to-date.
| * | | | | Merge pull request #2365 from u-abramchuk/SI6386Adriaan Moors2013-04-091-2/+10
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6386 typed existential type tree's original now have tpe set
| | * | | | | SI-6386 typed existential type tree's original now have tpe setUladzimir Abramchuk2013-04-091-2/+10
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tree reification fails for ExistentialTypeTree. The reason is that the tree passed for reification (see reifyTree at GetTrees.scala) must have not null tpe (see reifyBoundType at GenTrees.scala), which is not true in the case of ExistentialTypeTree. Why is it so? The tree passed to reifyTree was obtained in the reshape phase of reificationusing using original TypeTrees that reporesent pre- typer representation of a type. The problem is that original's tpe for ExistentialTypeTree is not set. So the solution to the issue is to create ExistentialTypeTree's original in a such way that is has actual tpe set.
| * | | | | Merge pull request #2354 from adriaanm/ticket-7289Adriaan Moors2013-04-091-7/+10
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-7289 Less strict type application for TypeVar.
| | * | | | | SI-7289 Less strict type application for TypeVar.Adriaan Moors2013-04-081-7/+10
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a type constructor variable is applied to the wrong number of arguments, return a new type variable whose instance is `ErrorType`. Dissection of the reported test case by @retronym: Define the first implicit: scala> trait Schtroumpf[T] defined trait Schtroumpf scala> implicit def schtroumpf[T, U <: Coll[T], Coll[X] <: Traversable[X]] | (implicit minorSchtroumpf: Schtroumpf[T]): Schtroumpf[U] = ??? schtroumpf: [T, U <: Coll[T], Coll[X] <: Traversable[X]](implicit minorSchtroumpf: Schtroumpf[T])Schtroumpf[U] Call it explicitly => kind error during type inference reported. scala> schtroumpf(null): Schtroumpf[Int] <console>:10: error: inferred kinds of the type arguments (Nothing,Int,Int) do not conform to the expected kinds of the type parameters (type T,type U,type Coll). Int's type parameters do not match type Coll's expected parameters: class Int has no type parameters, but type Coll has one schtroumpf(null): Schtroumpf[Int] ^ <console>:10: error: type mismatch; found : Schtroumpf[U] required: Schtroumpf[Int] schtroumpf(null): Schtroumpf[Int] ^ Add another implicit, and let implicit search weigh them up. scala> implicitly[Schtroumpf[Int]] <console>:10: error: diverging implicit expansion for type Schtroumpf[Int] starting with method schtroumpf implicitly[Schtroumpf[Int]] ^ scala> implicit val qoo = new Schtroumpf[Int]{} qoo: Schtroumpf[Int] = $anon$1@c1b9b03 scala> implicitly[Schtroumpf[Int]] <crash> Implicit search compares the two in-scope implicits in `isStrictlyMoreSpecific`, which constructs an existential type: type ET = Schtroumpf[U] forSome { type T; type U <: Coll[T]; type Coll[_] <: Traversable[_] } A subsequent subtype check `ET <:< Schtroumpf[Int]` gets to `withTypeVars`, which replaces the quantified types with type variables, checks conformance of that substitued underlying type against `Schtroumpf[Int]`, and then tries to solve the collected type constraints. The type var trace looks like: [ create] ?T ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) [ create] ?U ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) [ create] ?Coll ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) [ setInst] Nothing ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Nothing ) [ setInst] scala.collection.immutable.Nil.type( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], U=scala.collection.immutable.Nil.type ) [ setInst] =?scala.collection.immutable.Nil.type( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], Coll==?scala.collection.immutable.Nil.type ) [ create] ?T ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) [ setInst] Int ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Int ) [ create] ?T ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) [ create] ?U ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) [ create] ?Coll ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]] ) [ setInst] Nothing ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], T=Nothing ) [ setInst] Int ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], U=Int ) [ setInst] =?Int ( In Test#schtroumpf[T,U <: Coll[T],Coll[_] <: Traversable[_]], Coll==?Int ) The problematic part is when `?Int` (the type var originated from `U`) is registered as a lower bound for `Coll`. That happens in `solveOne`: for (tparam2 <- tparams) tparam2.info.bounds.hi.dealias match { case TypeRef(_, `tparam`, _) => log(s"$tvar addLoBound $tparam2.tpeHK.instantiateTypeParams($tparams, $tvars)") tvar addLoBound tparam2.tpeHK.instantiateTypeParams(tparams, tvars) case _ => }
| * | | | | Merge pull request #2349 from scalamacros/ticket/6937Adriaan Moors2013-04-091-36/+2
| |\ \ \ \ \ | | |/ / / / | |/| | | | SI-6937 core type tags are no longer referentially unique
| | * | | | SI-6937 core type tags are no longer referentially uniqueEugene Burmako2013-04-031-36/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type tag factory used to evaluate the provided type creator in the context of the initial mirror in order to maintain referential equality of instances of standard tags. Unfortunately this evaluation might fail if the mirror provided doesn't contain the classes being referred to. Therefore I think we should avoid evaluating type creators there. Note that failure of evaluation doesn't mean that there's something bad going on. When one creates a type tag, the correct mirror / classloader to interpret that tag in might be unknown (like it happens here). This is okay, and this is exactly what the 2.10.0-M4 refactoring has addressed. Something like `res2.typeTag[A].in(currentMirror)` should be okay.
* | | | | | Merge pull request #2335 from retronym/topic/opt-file-accessJames Iry2013-04-105-12/+86
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | Optimize file metadata access
| * | | | | Optimization: avoid call to exists in PlainFile#iteratorJason Zaugg2013-03-291-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we just established that the given path is a File or a Directory, we can assume it continues to exist. Before ---------------------------------- File.isFile calls : 7620 File.isDirectory calls : 2319 File.exists calls : 5770 After ---------------------------------- File.isFile calls : 7620 File.isDirectory calls : 2319 File.exists calls : 345
| * | | | | Optimization: avoid isDirectory call in DirectoryClassPath traversalJason Zaugg2013-03-291-5/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we just established that the given path is a File or a Directory, we don't need to go straight back to disk to re-check. Background: When profiling an application that was using the interpreter to compile a script, a lot of time was reported in exists / isDirectory / isFile. For the record, I happened to be profiling on Windows. Turns out some of these calls are redundant, this commit and the subsequent eliminate two sources thereof. Here's an example of how it helps: Taking a Hello, Akka! application, and compiling it with the compiler and library on a directory classpath (ie, using build/quick): class HelloActor extends Actor { def receive = { case "hello" => println("hello back at you") case _ => println("huh?") } } object Main extends App { val system = ActorSystem("HelloSystem") // default Actor constructor val helloActor = system.actorOf(Props[HelloActor], name = "helloactor") helloActor ! "hello" helloActor ! "buenos dias" } % qbin/scalac -Ystatistics -classpath ~/.ivy2/cache/com.typesafe.akka/akka-actor_2.10/jars/akka-actor_2.10-2.1.1.jar:/Users/jason/.ivy2/cache/com.typesafe/config/bundles/config-1.0.0.jar sandbox/test.scala 2>&1 | grep File Before ---------------------------------- File.isFile calls : 7620 File.isDirectory calls : 8348 File.exists calls : 5770 After ---------------------------------- File.isFile calls : 7620 File.isDirectory calls : 2319 File.exists calls : 5770
| * | | | | Add counters to File#{exists, isFile, isDirectory}.Jason Zaugg2013-03-293-6/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Due to limitations in the Statistics machinery, these are only reported if this patch is applied. --- a/src/reflect/scala/reflect/internal/util/Statistics.scala +++ b/src/reflect/scala/reflect/internal/util/Statistics.scala @@ -109,7 +109,7 @@ quant) * Quantities with non-empty prefix are printed in the statistics info. */ trait Quantity { - if (enabled && prefix.nonEmpty) { + if (prefix.nonEmpty) { val key = s"${if (underlying != this) underlying.prefix else ""}/$prefix" qs(key) = this } @@ -243,7 +243,7 @@ quant) * * to remove all Statistics code from build */ - final val canEnable = _enabled + final val canEnable = true // _enabled
* | | | | | Merge pull request #2373 from paulp/pr/implicit-tagsPaul Phillips2013-04-0911-550/+109
|\ \ \ \ \ \ | | | | | | | | | | | | | | Reduce visibility of implicit class tags.
| * | | | | | Reduce visibility of implicit class tags.Paul Phillips2013-04-0811-550/+109
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 500 lines of generated boilerplate is *impossible to maintain*. Generated code of this kind should never be allowed. Three lines of documentation, duplicated 100 times, cannot masquerade as three hundred lines of documentation. If someone knows to look at the documentation of implicit ClassTags, they *already know* about implicit ClassTags. It is wherever "match" is documented which needs this information (and I am sure we can express it more clearly, given the luxury of only saying it once.) Documenting each ClassTag with the same boilerplate is comparable in utility to attaching such text to every Int. "An Int is a whole number within the range -2147483648 to 2147483647 inclusive. It's usually used to represent how many of something there are, such as '5 bunnies' or '3 witty commit messages', but you can store about anything in an Int if you can fit it into 32 bits." We don't do that, because you're expected to discover what an Int is in a manner which generalizes to all the Ints you may encounter. The situation with implicit ClassTags is immediately analogous.
* | | | | | Merge remote-tracking branch 'origin/2.10.x' into merge-2.10.xPaul Phillips2013-04-0811-116/+160
|\ \ \ \ \ \ | | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: if starr.use.released fetch Scala ${starr.version} for STARR assume build.release when maven.version.suffix is set make quick.done depend on quick.bin again SI-7321 Memory leak in specialize on multiple compiler runs. Take the N^2 out of the compiler's TreeSet. SI-6900 Fix tailrec for dependent method types Simplify interplay between Uncurry Info- and Tree-Transformers Refactor existential related code out of types. Add a cautionary comment to TreeSymSubstitutor. SI-6715 Shouldn't return "" from TermNames.originalName Backport #2289's TermNames.unexpandedName as TermNames.originalName SI-7147 Diagnostic for unexplained assertion in presentation compiler. SI-6793 Don't use super param accessors if inaccessible. Correct sorting example for Ordering in scaladoc Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf build.xml src/compiler/scala/tools/nsc/transform/UnCurry.scala src/reflect/scala/reflect/internal/StdNames.scala
| * | | | | SI-7321 Memory leak in specialize on multiple compiler runs.Eugene Vigdorchik2013-04-041-16/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently the map is declared LinkedHashMap, which doesn't align with other caching maps that are cleared on every run. Linkedness is only needed to ensure deterministic order on the generated specialized classes. The same can be accomplished by sorting generated classes a-posteriori.
| * | | | | Merge pull request #2298 from retronym/ticket/6900-3Paul Phillips2013-04-036-90/+114
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6900 Tail call elimination + dependent method type crasher
| | * | | | | SI-6900 Fix tailrec for dependent method typesJason Zaugg2013-04-021-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Uncurry's info transformer could generate a MethodType with cloned parameter symbols. This type was used for the LabelDef generated in the TailCalls phase. But, the RHS of the method still contains types that refer to the original parmameter symbol. Spurious type errors ensued. I've spent a good chunk of time pursuing a more principled fix, in which we keep the symbols in the tree in sync with those in the MethodType. You can relive the procession of false dawns: https://github.com/scala/scala/pull/2248 Ultimately that scheme was derailed by a mismatch between the type parameter `T` and the skolem `T&` in the example below. trait Endo[A] { def apply(a: => A): A } class Test { def foo[T] = new Endo[(T, Unit)] { def apply(v1: => (T, Unit)) = v1 // no bridge created } } Interestingly, by removing the caching in SingleType, I got past that problem. But I didn't characterize it further. This commit sets asides the noble goal of operating in the world of types, and sledgehammers past the crash by casting the arguments to and the result of the label jump generated in TailCalls.
| | * | | | | Simplify interplay between Uncurry Info- and Tree-TransformersJason Zaugg2013-04-022-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now, the InfoTransformer is responsible for erasing the path dependent types of formal parameters, at the same place where it flattens nested method types. This is preferable to having the tree transformer overwrite the result of the info transformer, as used to be the case after my previous work on SI-6135 / 493197fc.
| | * | | | | Refactor existential related code out of types.Jason Zaugg2013-04-022-69/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For imminent reuse in the subsequent commit. The binary compatibility whitelist is updated to ignore these, as they live in reflect.internal.
| | * | | | | Add a cautionary comment to TreeSymSubstitutor.Jason Zaugg2013-04-021-0/+5
| | | | | | |
| * | | | | | Take the N^2 out of the compiler's TreeSet.Paul Phillips2013-04-031-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code responsible for this performance bug lives on somewhere in the combination of Iterator.single and Iterator.++ and is tracked by SI-7316. What this commit does is bypass the creation and composition of iterators entirely in favor of applying foreach to walking the tree. The important lesson of a bug like this: the occurrence depends on the existence of multiple implementations of basic structures like Trees. For each redundant implementation, scrutiny and testing are divided and "bug diversity" is increased. We should labor hard to structure collections in such a way that people have no good reason not to take advantage of the basic and hopefully battle-tested logic - especially when those people are us. I hope to remove util.TreeSet entirely. Until then, here is the impact of this commit on the time to compile a piece of generated test code. % time scalac3 ./target/generated/src.scala Mar 28 13:20:31 [running phase parser on src.scala] ... Mar 28 13:21:28 [running phase lazyvals on src.scala] Mar 28 13:21:28 [running phase lambdalift on src.scala] <-- WHOA Mar 28 13:25:05 [running phase constructors on src.scala] ... Mar 28 13:25:19 [running phase jvm on icode] 316.387 real, 438.182 user, 8.163 sys To this: 97.927 real, 211.015 user, 8.043 sys % time pscalac ./target/generated/src.scala Mar 28 13:18:47 [running phase parser on src.scala] ... Mar 28 13:19:44 [running phase lazyvals on src.scala] Mar 28 13:19:44 [running phase lambdalift on src.scala] Mar 28 13:19:46 [running phase constructors on src.scala] ... Mar 28 13:19:57 [running phase jvm on icode] 99.909 real, 223.605 user, 7.847 sys That's lambdalift dropping from 217 seconds to 2 seconds.
| * | | | | | Merge pull request #2344 from retronym/ticket/7147Jason Zaugg2013-04-031-2/+9
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | | SI-7147 Diagnostic for unexplained assertion in presentation compiler.
| | * | | | | SI-7147 Diagnostic for unexplained assertion in presentation compiler.Jason Zaugg2013-04-021-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We don't have a reproducible test for this, so the best we can do is beef up the assertion to shine a little light on the problem.
| * | | | | | Merge pull request #2319 from retronym/ticket/6793Paul Phillips2013-04-021-2/+9
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6793 Don't use super param accessors if inaccessible.
| | * | | | | | SI-6793 Don't use super param accessors if inaccessible.Jason Zaugg2013-03-261-2/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Alias replacement" has been with us since 2005 (13c59adf9). Given: package a { class C1(val v0: String) class C2(v1: String) extends a.C1(v1) { v1 } } The reference to `v1` is rewritten as `C2.super.v0()`, and no field is generated in `C2`. (Oddly, this optimization doesn't seem to kick in if these classes are in the empty package. That's probably a distinct bug.) However, this rewriting is done without consideration of the accessibility of `v0` from `C2`. This commit disables this optimization if there if `v0` is not accessible.
| * | | | | | | SI-6715 Shouldn't return "" from TermNames.originalNameKato Kazuyoshi2013-04-031-1/+1
| | | | | | | |
| * | | | | | | Backport #2289's TermNames.unexpandedName as TermNames.originalNameKato Kazuyoshi2013-04-031-7/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because this implementation is more clear than 2.10.x's and it will simplify a further commit to fix SI-6715.
| * | | | | | | Merge pull request #2303 from starblood/gyuhang/libdocAdriaan Moors2013-04-021-1/+1
| |\ \ \ \ \ \ \ | | |_|/ / / / / | |/| | | | | | Correct sorting example for Ordering in scaladoc
| | * | | | | | Correct sorting example for Ordering in scaladocGyuhang Shim2013-03-251-1/+1
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Below code snippet, Sorting.quickSort(pairs)(Ordering.by[(String, Int, Int), Int](_._2) should be Sorting.quickSort(pairs)(Ordering.by[(String, Int, Int), Int](_._2))
* | | | | | | Transcendent rewrite of isSameType.Paul Phillips2013-04-051-158/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A highly satisfying rewrite of isSameType. It's faster, clearer, shorter, better commented, and closer to correct. I am especially pleased that t5580b stopped compiling, given that nobody seemed to have much idea why it compiled in the first place.
* | | | | | | Centrally unify module class representations.Paul Phillips2013-04-051-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are these two representations of a type we wish to treat as the same: TypeRef(pre, sym1, Nil) // sym1.isModuleClass, sym1.sourceModule == sym2 SingleType(pre, sym2) // sym2.isModule, sym2.moduleClass == sym1 I rolled the recognition of this into normalizePlus where it won't bother anyone. normalizePlus is the last effort undertaken by isSameType before it gives up. This allowed significant simplification of logic elsewhere, since there is a great deal of logic working around the fact that a TypeRef might be equivalent to a SingleType even after dealiasing.
* | | | | | | Optimization/logic improvement in Scopes.Paul Phillips2013-04-051-4/+44
| |_|/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I rescued "isSubScope" from the innards of isSameType and placed it on Scope. To write a more efficient "isSameScope", I needed a size method which wasn't O(n). I now cache the size whenever the elemsCache is regenerated.
* | | | | | SI-6289 Paulptest demonstrating javac errorsSom Snytt2013-04-041-3/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is Paul's test demonstrating that Javac errors are correctly transcribed in the test transcript. A gratuitous Scala class is added to a later round to show that the test halts after the first error. The runner must supply absolute paths to javac so that absolute paths are reported in errors and stripped away by partest. The check file is differentiated for Java 6 and 7, and partest's runner will now post-process the `diff log check` to strip the diff which does not apply.
* | | | | | SI-6289 Partest in technicolor and showing javac errorsSom Snytt2013-04-0420-1530/+1412
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Paulptest includes color and simplified test scarfing. Scalap tests are moved to the conventional name and location. Testicolor missed out on Josh Suereth's tweak to sort the files in a compilation round. Restore sortiness to test sources. Testicolor is due to one of Paul's branches on a timeline that apparently did not include the destruction of planet Earth and its colonies by the Xindi. Thanks also to Szabolcs Berecz for his merge effort. Merging is thankless work, but not as thankless as merging in a timeline that actually does terminate in the destruction of your home world and Enterprise. Archer had a supremely difficult choice: rescue humanity or live out his retirement with T'Pol waiting on him hand and foot? I'm sure I don't know how I'd choose.
* | | | | | Merge pull request #2320 from mighdoll/masterPaul Phillips2013-04-031-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | doc for Types.baseClasses has Linearization definition reversed from spec 5.1.2
| * | | | | | doc fix for Types.baseClasses to match spec definition of Linearization 5.1.2Lee Mighdoll2013-03-261-1/+1
| | | | | | |
* | | | | | | Merge pull request #2337 from retronym/ticket/7110-2Paul Phillips2013-04-031-0/+7
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7110 Warn about naked try without catch/finally
| * | | | | | | SI-7110 Warn about naked try without catch/finallyJason Zaugg2013-03-291-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, this was allowed: scala> try ( 1 / 0 ) java.lang.ArithmeticException: / by zero But since the advent of util.Try, the subtle difference to the following seems dangerous: scala> import util.Try import util.Try scala> Try ( 1 / 0 ) res4: scala.util.Try[Int] = Failure(java.lang.ArithmeticException: / by zero) Discussion: https://groups.google.com/d/topic/scala-language/fy2vXD_3fF8/discussion There was some concern that this curtails a handy, temporary way to remove the exception handlers from some code. But after thinking about this, I contend that: a) those people can easily stomach the warning temporarily (modulo, of course, those with -Xfatal-warnings.) b) putting this warning behind Xlint will disable it for those who need it most: beginners. I also chose not to refer to 'scala.util.Try' in the error message as I think that has as much potential to confuse as it does to clarify.
* | | | | | | | Add () to side-effecting u1/u2/u4.Paul Phillips2013-04-031-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On good advice of reviewer.
* | | | | | | | Reduce duplication in JavaMirrors.Paul Phillips2013-04-032-111/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Applying some of the abstractions from the prior commits, though I would like to emphasize that such infrastructure was not a prerequisite for de-duplicating this file.
* | | | | | | | Brought some structure to the classfileparser.Paul Phillips2013-04-033-366/+356
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I run out of ways to describe this sort of work: removes code which does too much, too verbosely and too explicitly, using too much indirection and too much duplication. Replace it with code which offers less of these things.
* | | | | | | | Cleaning up error handling.Paul Phillips2013-04-031-13/+6
| | | | | | | |
* | | | | | | | Fleshing out comments on JavaAccFlags.Paul Phillips2013-04-031-9/+6
| | | | | | | |
* | | | | | | | Abstract over java.lang.reflect.{ Method, Constructor }.Paul Phillips2013-04-031-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No doubt there's some plausible explanation for this design: % java/lang/reflect/Method.java public Annotation[][] getParameterAnnotations() public Class<?>[] getExceptionTypes() public Class<?>[] getParameterTypes() public Type[] getGenericExceptionTypes() public Type[] getGenericParameterTypes() public boolean isVarArgs() % java/lang/reflect/Constructor.java public Annotation[][] getParameterAnnotations() public Class<?>[] getExceptionTypes() public Class<?>[] getParameterTypes() public Type[] getGenericExceptionTypes() public Type[] getGenericParameterTypes() public boolean isVarArgs() Sun must have really been losing their grip there as the end approached. This class fakes some of the missing common parent.
* | | | | | | | Value class to represent jvm flags.Paul Phillips2013-04-031-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That clenching you feel in your gut when you watch the Ints hurtling in all directions is your signal that a little type safety is good for the soul. With this value class it is now somewhat harder to confuse java bits with scala bits, although not nearly hard enough.
* | | | | | | | Added ensureAccessible to reflection library.Paul Phillips2013-04-032-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method comes up with some frequency and there are a lot of ways to write it either unsafely (failing to catch a likely exception) or with inadequate generality (as was done in the pre-existing version of this method in ScalaRunTime) so I thought it warranted a place in the standard library.
* | | | | | | | Merge pull request #2348 from paulp/pr/2324-editPaul Phillips2013-04-021-3/+1
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7237 Always choose ForkJoinTaskSupport
| * | | | | | | | SI-7237 Always choose ForkJoinTaskSupportSimon Ochsenreither2013-04-021-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ForkJoinTaskSupport works on Hotspot, Avian and J9, while ThreadPoolTaskSupport causes the test test/files/scalacheck/parallel-collections to reliably hang on all three.
* | | | | | | | | Merge pull request #2327 from paulp/pr/2315-rebasedPaul Phillips2013-04-0295-244/+251
|\ \ \ \ \ \ \ \ \ | |/ / / / / / / / |/| | | | | | | | SI-7261 Implicit conversion of BooleanSetting to Boolean and BooleanFlag