summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| | | * | | | | | | SI-7694 Add @uncheckedBounds to the libraryJason Zaugg2013-08-131-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Followup to the previous commit that added the compiler support for opting out of bounds checking. With both pieces, we can test that the temporaries introduced by the named/default arguments transform don't trigger bounds violations.
| | | * | | | | | | SI-7694 @uncheckedBounds, an opt-out from type bounds checkingJason Zaugg2013-08-134-13/+54
| | | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Synthetic defs introduced by transforms like named/default arguments, ANF (in scala-async) often introduce a type tree (the tpt of the temporary) that are based on the types of expressions. These types are scrutinized in RefChecks to check that type parameter bounds are satisfied. However, the type of the expression might be based on slack a LUB that fails to capture constraints between type parameters. This slackness is noted in `mergePrefixAndArgs`: // Martin: I removed this, because incomplete. Not sure there is a // good way to fix it. For the moment we just err on the conservative // side, i.e. with a bound that is too high. The synthesizer can now opt out of bounds by annotating the type as follows: val temp: (<expr.tpe> @uncheckedBounds) = expr This facility is now used in named/default arguments for the temporaries used for the reciever and arguments. The annotation is hidden under scala.reflect.internal, rather than in the more prominent scala.annotation.unchecked, to reflect the intention that it should only be used in tree transformers. The library component of this change and test case will be included in the next commit. Why split like this? It shows that the 2.10.3 compiler will work with 2.10.2 scala-reflect.jar.
| | * | | | | | | Merge pull request #2826 from retronym/ticket/7020-2.10.xAdriaan Moors2013-08-131-4/+5
| | |\ \ \ \ \ \ \ | | | |/ / / / / / | | |/| | | | | | SI-7020 Determinism for pattern matcher warnings
| | | * | | | | | SI-7020 Determinism for pattern matcher warningsJason Zaugg2013-08-131-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use LinkedHashSet for the DPLL algorithm for determistic counter example generation. Before, the test compiled with: [info] v2.10.2 => /Users/jason/usr/scala-v2.10.2-0-g60d462e test/files/neg/t7020.scala:3: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List(_, _) List(5) match { ^ test/files/neg/t7020.scala:10: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 5, 6, 7))), List(_, _) List(5) match { ^ test/files/neg/t7020.scala:17: warning: match may not be exhaustive. It would fail on the following inputs: List((x: Int forSome x not in (1, 2, 4, 6, 7)), _), List(1, _), List(2, _), List(4, _), List(5, _), List(6, _), List(7, _), List(??, _) List(5) match { ^ test/files/neg/t7020.scala:24: warning: match may not be exhaustive. It would fail on the following input: List(_, _) List(5) match { ^
| | * | | | | | | Merge pull request #2809 from xeno-by/ticket/7733James Iry2013-08-135-14/+15
| | |\ \ \ \ \ \ \ | | | |/ / / / / / | | |/| | | | | | SI-7733 reflective packages now more consistent with scalac
| | | * | | | | | [nomaster] SI-7733 reflective packages now more consistent with scalacEugene Burmako2013-08-135-14/+15
| | | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously PackageScopes from scala.reflect ignored all classes that had $'s in non-rightmost positions in their names. Unfortunately this behaviour is inconsistent with how scalac does things, and I reconciled this as usual, by pulling corresponding logic into scala-reflect.jar and sharing it between runtime reflection and compiler. This change has seprate pull requests for 2.10.x and 2.11.0. The latter deprecates `scala.tools.nsc.util.ClassPath.isTraitImplementation` whereas the former (which you're looking at right now) does not, because we can't deprecated members in minor releases.
| | * | | | | | Merge pull request #2813 from xeno-by/topic/showrawGrzegorz Kossakowski2013-08-121-0/+2
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | showRaw now prints symbols of def trees
| | | * | | | | | showRaw now prints symbols of def treesEugene Burmako2013-08-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A very useful addition that came in handy when hacking macro annotations
| | * | | | | | | Merge pull request #2817 from xeno-by/topic/toolbox-current-run-compilesJason Zaugg2013-08-121-1/+4
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | currentRun.compiles now correctly works in toolboxes
| | | * | | | | | | currentRun.compiles now correctly works in toolboxesEugene Burmako2013-08-101-1/+4
| | | | |/ / / / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | Another random bug uncovered and extinguished when hacking macro annots.
| | * / | | | | | [nomaster] macro errors now always have positionsEugene Burmako2013-08-101-1/+1
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back then when I implemented macros for inclusion in trunk (Spring 2012), partest didn't support the _1, _2, ... convention for neg tests, so I had to use toolboxes to test macro-generated exceptions. Unfortunately toolboxes aren't very good with positions (mostly because their inputs are almost always constructed without corresponding sources) so I didn't notice that errors signalizing about macro-generated exceptions actually don't carry positions with them because of a typo. This patch fixes the oversight, but it doesn't need to be ported to master, because over there everything's already fixed by one of the backports from macro paradise.
| | * | | | | | SI-7331 tb.parse returns unpositioned treesDen Shabalin2013-08-082-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit gets rid off code wrapping that was previously used by toolbox to get into correct parsing mode. Instead combination of templateStats/accept(EOF) is used. This is the same solution as the one used in repl and built-in scriptRunner This pull request doesn't attempt to generalize this approach in any way and re-use it all over the place due to the caution of possible accidental compatibility breakage. I plan to do it separately against master. Additionally there are a few more changes that make importers be aware of positions and a test for that (via @jedesah).
| | * | | | | | Merge pull request #2767 from gourlaysama/t4907Adriaan Moors2013-08-051-2/+66
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-4907 SI-4615 scala.bat now honors -J and -D options.
| | | * | | | | | SI-4907 SI-4615 scala.bat honors -J and -D options.Antoine Gourlay2013-07-281-2/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This makes scala.bat parse and use -J and -D arguments. Specifically: - Parameters starting with -J are stripped of the prefix, unquoted if necessary and appended to %JAVA_OPTS% or default values. - Parameters starting with -D are unquoted if necessary and then appended to the others. The right-hand side of a property can be quoted or not. - All of those are given to `java` before any other parameters. - The above only happens on parameter preceding the first parameter that does not start with "-" (usually a class name). - The exact arguments passed to scala.bat are also given as-is to the scala launcher (including -J and -D arguments). set JAVA_OPTS=-Xmx512m scala -J-Xmx128m -Dprop1=42 -Dprop2="hello world" "-Dprop3=bar" "-J-Xms64m" Test foo will result in java -Xmx512m -Xmx128m -Dprop1=42 -Dprop2="hello world" -Dprop3=bar -Xms64m [cp, scala main] -J-Xmx128m -Dprop1=42 -Dprop2="hello world" "-Dprop3=bar" "-J-Xms64m" Test foo
| | * | | | | | | Merge pull request #2761 from scalamacros/ticket/7510Jason Zaugg2013-08-011-2/+11
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Assorted toolbox fixes
| | | * | | | | | | brings JavaMirrors up to speed with ClassfileParserEugene Burmako2013-07-231-2/+11
| | | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently there are still discrepancies between how the vanilla compiler turns class files into symbols and how the reflective compiler does it. Working on bringing these guys in sync, one bug at a time.
* | | | | | | | | Merge pull request #2849 from retronym/ticket/7763Jason Zaugg2013-08-292-3/+3
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7763 Avoid dropping casts in erasure
| * | | | | | | | | SI-7763 Don't eliminate CHECK_CAST in dead code elimination.Jason Zaugg2013-08-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even if the result isn't used, the potential ClassCastException is observable, so we must retain them.
| * | | | | | | | | SI-7763 Avoid dropping casts in erasureJason Zaugg2013-08-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 466b7d29f avoided quadratic complexity in Erasure's treatment of chained `asInstanceOf` calls. It did so by using the typechecked qualifier, rather than discarding it. However, that also dropped the cast altogether! In many cases this was masked by later inclusion of a cast to the expected type by `adaptToType`: at scala.tools.nsc.transform.Erasure$Eraser.cast(Erasure.scala:636) at scala.tools.nsc.transform.Erasure$Eraser.scala$tools$nsc$transform$Erasure$Eraser$$adaptToType(Erasure.scala:665) at scala.tools.nsc.transform.Erasure$Eraser.adapt(Erasure.scala:766) at scala.tools.nsc.typechecker.Typers$Typer.runTyper$1(Typers.scala:5352) This commit re-wraps the typechecked `qual` in its original `<qual>.asInstanceOf[T]` to preserve semantics while avoiding the big-O blowup. The test includes the compiler option `-Ynooptimize` because dead code elimination *also* thinks that this cast is superfluous. I'll follow up on that problem seprately.
* | | | | | | | | | Merge pull request #2879 from retronym/ticket/7785Jason Zaugg2013-08-291-1/+14
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7785 Preserve TypeVar suspension through TypeMaps
| * | | | | | | | | | SI-7785 Preserve TypeVar suspension through TypeMapsJason Zaugg2013-08-271-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During `findMember`, TypeVars in `this` are placed into suspended animation. This is to avoid running into recursive types when matching members to those in base classes. However, the mechanism used to do this is superficial, and doesn't work when TypeVars are copied by TypeMaps. This seems to crop up when using `AppliedTypeVar` with higher-kinded type vars. In the enclosed test case, the cyclic type led to a SOE in CommonOwnerMap. This commit allows a TypeVar to delegate its `suspended` attribute to the TypeVar from which it was copied. This is done in `TypeVar#applyArgs`, which is called by: // TypeMap#mapOver case tv@TypeVar(_, constr) => if (constr.instValid) this(constr.inst) else tv.applyArgs(mapOverArgs(tv.typeArgs, tv.params)) We should review the other places this is called to make sure that it make sense to link in this way: Types#appliedType TypeVar#normalize
* | | | | | | | | | | Merge pull request #2847 from retronym/ticket/7501Grzegorz Kossakowski2013-08-281-1/+6
|\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | SI-7501 Pickler: owner adjustment for param syms in annotation args
| * | | | | | | | | | | SI-7501 Pickler: owner adjustment for param syms in annotation argsJason Zaugg2013-08-171-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pickling of trees within annotation arguments led to an unfortunate situation: the MethodType of a symbol contained a value parameter symbol that was pickled as though it were owned by the enclosing class (the root symbol of the pickle.) Under separate compilation, this would appear as a member of that class. Anyone using `@deprecatedName('oldName)` was exposed to this problem, as the argument expands to `Symbol.apply("oldName")`. This commit extends some similar treatment of local type parameters to also consider value parameters.
* | | | | | | | | | | | Merge pull request #2863 from magarciaEPFL/backendish40Grzegorz Kossakowski2013-08-281-75/+253
|\ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|_|_|_|_|/ / / |/| | | | | | | | | | | (1 of 2) of the rest of the new bytecode emitter + feedback
| * | | | | | | | | | | GenBCode: decouple ClassDef traversing from ClassNode buildingMiguel Garcia2013-08-211-68/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In keeping with the baby steps towards pipelining of class building and class writing, this commit gets one step closer to that. Only thing missing: the actual thread-pool. That will be the focus of an upcoming commit.
| * | | | | | | | | | | GenBCode: decouple ClassNode building from encoding as byte arrayMiguel Garcia2013-08-211-19/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To recap from the previous commit, another baby step towards pipelining of class building and class writing. Implementing similar functionality in GenASM is up for grabs, see https://issues.scala-lang.org/browse/SI-6164
| * | | | | | | | | | | GenBCode: decouple ClassNode building from classfile writingMiguel Garcia2013-08-211-18/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit and two follow-up commits (recognizable because of the starting words "decouple this from that" in the commit message) are baby steps towards pipelining of class building and class writing, ie allowing class building (which requires typer) and "the rest" which doesn't) to run in parallel. The commits have been broken up following a previous review comment.
* | | | | | | | | | | | Merge pull request #2883 from retronym/topic/junit-zip-archiveGrzegorz Kossakowski2013-08-271-1/+5
|\ \ \ \ \ \ \ \ \ \ \ \ | |_|_|_|_|/ / / / / / / |/| | | | | | | | | | | A better diagnostic error for corrupt or missing JARs.
| * | | | | | | | | | | A better diagnostic error for corrupt or missing JARs.Jason Zaugg2013-08-271-1/+5
| | |_|_|/ / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Augment the IOException with the name of the file we're trying to open. Motivated by a troubleshooting session with partial downloads of JARs from Maven central breaking the Scala build on Martin's laptop. The test case only tests our part of the error message, so as not to be platform / JDK specific. Otherwise, it would check that the correct cause exception was present and accounted for.
* | | | | | | | | | | Merge pull request #2874 from paulp/pr/depthAdriaan Moors2013-08-2726-226/+254
|\ \ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / / |/| | | | | | | | | | Value class Depth.
| * | | | | | | | | | Logging cleanup.Paul Phillips2013-08-2518-65/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduced the amount of extraneous logging noise at the default logging level. Was brought to my usual crashing halt by the discovery of identical logging statements throughout GenASM and elsewhere. I'm supposing the reason people so grossly underestimate the cost of such duplication is that most of the effects are in things which don't happen, aka "silent evidence". An example of a thing which isn't happening is the remainder of this commit, which exists only in parallel universes.
| * | | | | | | | | | Value class Depth.Paul Phillips2013-08-2511-161/+166
| | |_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's the obvious translation from a raw Int into a value class. It wasn't that long ago one could find a signature like this: def merge(tps: List[Type], variance: Int, depth: Int): Type Do you feel lucky, method caller? Well, do ya? Anyway, now it is: def merge(tps: List[Type], variance: Variance, depth: Depth): Type Forget for a moment the fact that you'd probably rather not pass variance for depth and depth for variance and look at the type signatures: (List[Type], Variance, Depth) => Type (List[Type], Int, Int) => Type
* | | | | | | | | | Merge pull request #2850 from gourlaysama/wip/t6507-2Adriaan Moors2013-08-252-6/+5
|\ \ \ \ \ \ \ \ \ \ | |/ / / / / / / / / |/| | | | | | | | | SI-6507 completely sidestep handlers in REPL when :silent in on
| * | | | | | | | | SI-6507 completely sidestep handlers in REPL when :silent in onAntoine Gourlay2013-08-182-6/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a cleanup of 6db8a52, the original fix for SI-6507. When the REPL is :silent, all handlers are ignored when it comes to generating the printed result. The result extraction code (`lazy val resN = ...`) is still generated, but now it isn't called until the user calls it.
* | | | | | | | | | Merge pull request #2867 from mmorearty/patch-1Adriaan Moors2013-08-231-1/+1
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Fix typo in sample code in scaladoc for package scala.sys.process
| * | | | | | | | | | Fix typo in sample code in scaladoc for package scala.sys.processMike Morearty2013-08-231-1/+1
| | |_|_|/ / / / / / | |/| | | | | | | |
* | | | | | | | | | Merge pull request #2858 from Debilski/docstring-fixAdriaan Moors2013-08-231-1/+1
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | ProcessBuilder.lines(log) *does* throw an exception.
| * | | | | | | | | | ProcessBuilder.lines(log) *does* throw an exception.Rike-Benjamin Schuppner2013-08-201-1/+1
| | | | | | | | | | |
* | | | | | | | | | | Merge pull request #2805 from adriaanm/rebase-2715James Iry2013-08-231-471/+593
|\ \ \ \ \ \ \ \ \ \ \ | |_|/ / / / / / / / / |/| | | | | | | | | | Constructors refactoring [Rebase of #2715]
| * | | | | | | | | | Golfed about 20 lines into the sand trap.Paul Phillips2013-08-081-37/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | And it's a nice golf clinic and all, but let's remove our golf gloves and take in some film. for (stat <- defBuf.iterator ++ auxConstructorBuf.iterator) A quick count: - defBuf is a ListBuffer (1 mutant) - auxConstructorBuf is a ListBuffer (2 mutants) - two mutable iterators over mutable sequences (3, 4 mutants) - Iterator.++ joins them and is BY-NAME (4 mutants, 1 tragedy in waiting) - the joined Iterator is a new mutable structure (5 mutants, now 3 deep) - omittables is a mutable Set (6 mutants) - the 5-layer-3-deep iterator mutates omittables as it walks [The following is a public service breakdown. The letter sequence y-o-u is a local variable which should be replaced with your name, whoever "you" are, if you commit any code in these parts.] Hear my plea! YOU DON'T HAVE TO DO IT THIS WAY! It isn't simpler, faster, easier, more satisfying, shorter, more pixelated, there just isn't any advantage to it, even if you're lazy! Especially if you're lazy! Whatever combination of virtues and vices exist in your personal petri dish, this will never be a hilltop! PLEASE COME ENJOY A DRINK WITH ME AND MY FRIEND 'VAL' !! I'LL INTRODUCE YOU! I THINK YOU WILL REALLY LIKE HER! I HOPE YOU WILL SEE A LOT OF ONE ANOTHER! REMEMBER THAT NAME, 'VAL' !! SHE'LL HAVE HER EYE OUT FOR YOU!
| * | | | | | | | | | skipping trips to specializeTypes when not necessary in constructorsMiguel Garcia2013-08-081-3/+13
| | | | | | | | | | |
| * | | | | | | | | | separation of concerns: guard non-specialized ctor-stats in constructorsMiguel Garcia2013-08-081-115/+120
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit modularizes TemplateTransformer by moving two methods from TemplateTransformer into the newly added OmittablesHelper. The methods in question are: - mergeConstructors(genericClazz, originalStats, specializedStats) - guardSpecializedInitializer(stats) That way, the rewriting that introduces a guard for the execution of non-specialized ctor-statements is encapsulated in trait GuardianOfCtorStmts.
| * | | | | | | | | | better encapsulation in constructors phaseMiguel Garcia2013-08-081-3/+3
| | | | | | | | | | |
| * | | | | | | | | | readability for intoConstructors transformerMiguel Garcia2013-08-081-10/+32
| | | | | | | | | | |
| * | | | | | | | | | separation of concerns: eliding param-accessor fields in constructorsMiguel Garcia2013-08-081-115/+135
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit modularizes TemplateTransformer by moving a few members from TemplateTransformer into the newly added OmittablesHelper. The members in question include - a few methods: # isParamCandidateForElision(Symbol) # isOuterCandidateForElision(Symbol) # mustbeKept(Symbol) - a few vals: # paramCandidatesForElision # outerCandidatesForElision # bodyOfOuterAccessor - class UsagesDetector That way, all trace of rewriting to elide param-accessor fields has vanished from TemplateTransformer and is encapsulated in OmittablesHelper.
| * | | | | | | | | | separation of concerns: delayed-init in constructorsMiguel Garcia2013-08-081-134/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit modularizes TemplateTransformer by moving a few methods from TemplateTransformer into the newly added DelayedInitHelper. The methods in question - delayedInitCall() - delayedInitClosure() - delayedEndpointDef() build trees that rewriteDelayedInit() puts together. That way, all trace of rewriting related to delayed-init have vanished from TemplateTransformer and are encapsulated in DelayedInitHelper.
| * | | | | | | | | | method transformClassTemplate() turned into class TemplateTransformerMiguel Garcia2013-08-081-575/+579
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before this commit, each activation of transformClassTemplate() performed the rewriting that the constructors phase is well-known for. Lots of auxialiary objects were created in the process, with lifetime confined to said activation. The same auxiliary objects (having same lifetimes as before) also are in effect starting with this commit, but now it's an instance of TemplateTransformer that holds them together. In other words, there's a one-to-one correspondence between: - (what used to be) transformClassTemplate() activation - TemplateTransformer initialization After initialization, the result of TemplateTransformer can be found in its `transformed` member val. In fact, the refactoring to get here from the previous commit basically involves taking the body of method transformClassTemplate() as-is to become the template of TemplateTransformer. The TemplateTransformer in question will allow modularizing sub-transformations (e.g., DelayedInit) into dedicated traits (see upcoming commits).
| * | | | | | | | | | eliding what the constructor phase elides but with less effort (2 of 2)Miguel Garcia2013-08-081-63/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removing the old implementation of elision in constructors in favor of the new one which is both faster, more readable.
| * | | | | | | | | | eliding what the constructor phase elides but with less effort (1 of 2)Miguel Garcia2013-08-081-2/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For now both old and new implementations of elision coexist, allowing cross-checking their results. In the next commit only the new one will remain.
| * | | | | | | | | | how stuff works: elision of param-accessor-fields and outer-accessorsMiguel Garcia2013-08-081-6/+64
| | | | | | | | | | |