summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Remove scala-xml and scala-parser-combinatorsAdriaan Moors2013-08-27118-10870/+82
| | | | | | | | | | | | | | | | | | | These modules move to their own repositories: - https://github.com/scala/scala-xml (v1.0-RC3) - https://github.com/scala/scala-parser-combinators (v1.0-RC1) The modularization depends on the new partest, as the old one's classpath handling did not support a modularized scala. The compiler pom now depends on the artifacts published separately, with versions specified in versions.properties. NOTES: - The osgi tests resolve the xml and parsers jars and osgi-fy them, as they are no longer built locally. TODO: Can we move the osgification to the module builds? - Disabled local repositories: don't want to accidentally include unpublished artifacts in releases etc.
* Prepare removal of scala-xml, scala-parser-combinatorsAdriaan Moors2013-08-27131-3221/+19
| | | | | | | | | Every test deleted here has found its way to the respective repositories of scala-xml and scala-parser-combinators, where they will continue to be tested with partest. The modified tests became independent of these modules, as they should've been from the start.
* 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 #2873 from paulp/pr/partest-ackAdriaan Moors2013-08-241-79/+79
|\ \ | | | | | | Overhaul of partest-ack.
| * | Overhaul of partest-ack.Paul Phillips2013-08-241-79/+79
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seems like many/most options to partest are broken. Working around as much as I can to make this thing useful again, plus lots of improvements in robustness. Spaces and such are preserved properly now, and I added a new way of selecting tests based on time. tools/partest-ack -s 1.week.ago % tests modified since time ... 66 tools/partest-ack 'case object (Foo|Bar)' % tests with matching paths ... 0 % tests with matching code ... 7 File paths and file contents are uniformly acked now, so for instance this works as expected. tools/partest-ack -i VIRTPAT % tests with matching paths ... 41 % tests with matching code ... 11 # 43 tests to run.
* | 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
| | | |
| * | | handling AnyVal special case early on to simplify logic afterwardsMiguel Garcia2013-08-081-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | This way the contract of `transformClassTemplate()` can focus on non-AnyVal cases, which are more regular from the perspective of transforming their templates in the constructors phase.
| * | | warn about uninitialized reads (in constructors), self-contained checkMiguel Garcia2013-08-081-37/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The check in question relies on helper maps and methods that don't belong outside that check. This commit encapsulates those helpers into the newly added `checkUninitializedReads()` , thus uncluttering `transformClassTemplate()`
* | | | Merge pull request #2852 from retronym/ticket/1980-warningAdriaan Moors2013-08-214-0/+36
|\ \ \ \ | | | | | | | | | | SI-1980 A lint warning for by-name parameters in right assoc methods
| * | | | SI-1980 A lint warning for by-name parameters in right assoc methodsJason Zaugg2013-08-194-0/+36
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The desugaring of right associative calls happens in the parser. This eagerly evaluates the arguments (to preserve left-to-right evaluation order the arguments are evaluated before the qualifier). This is pretty surprising if the method being called has a by-name parameter in the first parameter section. This commit adds a warning under -Xlint when defining such a method. The relevent spec snippets: > SLS 4.6.1 says that call-by-name argument "is not evaluated at the point of function application, but instead is evaluated at each use within the function". > > But 6.12.3 offers: > "If op is right- associative, the same operation is interpreted as { val x=e1; e2.op(x ) }, where x is a fresh name."
* | | | | Merge pull request #2810 from xeno-by/topic/compile-time-onlyAdriaan Moors2013-08-2110-35/+162
|\ \ \ \ \ | | | | | | | | | | | | @compileTimeOnly: moved to scala-library.jar, got some fixes
| * | | | | @compileTimeOnly now works for symbols from the empty packageEugene Burmako2013-08-152-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | Looks like we've got the entire language covered now.
| * | | | | @compileTimeOnly now works for annotationsEugene Burmako2013-08-152-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | http://docs.scala-lang.org/overviews/macros/annotations.html say sincere "thank you!".
| * | | | | marks Expr.splice and Expr.value with @compileTimeOnlyEugene Burmako2013-08-153-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now that @compileTimeOnly is part of the standard library, why don't we use it within the standard library.
| * | | | | moves compileTimeOnly to scala-libraryEugene Burmako2013-08-146-33/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the notion that's come to be universally useful, so I suggest we promote it to be universally accessible. Note that the attached test incorrectly fails to report errors for definitions coming from the empty package and for annotations. These are bugs, and they are fixed in subsequent commits of this pull request.
* | | | | | Merge pull request #2862 from adriaanm/partest-1.0-RC4Adriaan Moors2013-08-212-1/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use scala-partest 1.0-RC4
| * | | | | | Use scala-partest 1.0-RC4Adriaan Moors2013-08-212-1/+4
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RC3 had a binary incompatibility that led to a crash in parsing options, due to: - https://github.com/scala/scala-partest/commit/9ff138ab4b - https://github.com/scala/scala/commit/2b1563fa74 Also added sonatype as a repo for resolving partest, so we don't have to wait for artifacts to synch to maven central.
* | | | | | Merge pull request #2851 from adriaanm/modularizeAdriaan Moors2013-08-20100-7385/+380
|\ \ \ \ \ \ | | | | | | | | | | | | | | Modularize partest
| * | | | | | Move partest to https://github.com/scala/scala-partestAdriaan Moors2013-08-20100-7385/+380
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As partest is now resolved from maven, `test/partest` uses `ant test.suite.init` to determine the classpath (serialized to build/pack/partest.properties) that's necessary to run `scala.tools.partest.nest.ConsoleRunner`. Thus, partest gets exactly the same classpath, whether run from the command line through `test/partest` or via `ant test`. The version of partest we're using is specified by properties defined in versions.properties (formerly `starr.number`). Currently, we're using: ``` scala.binary.version=2.11.0-M4 partest.version.number=1.0-RC3 ``` NOTES: - The version of Scala being tested must be backwards binary compatible with the version of Scala that was used to compile partest. - Once 2.11 goes final, `scala.binary.version=2.11`, and `starr.version=2.11.0`. - Need scalacheck on classpath for test/partest scalacheck tests. - Removed atrophied ant tests (haven't been run/changed for at least two years I checked 81d659141a as a "random" sample). - Removed scalacheck. It's resolved as a partest dependency. - For now, use a locally built scalap - Kept the trace macro in the main repo (partest-extras) - New targets for faster pr validation: test-core-opt, test-stab-opt - Reused partest eclipse/intellij project to partest-extras (note: the partest dependency is hard-coded)
* | | | | | Merge pull request #2824 from qerub/ticket/7740Adriaan Moors2013-08-204-4/+56
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | SI-7740 Trim stack trace before printing in REPL
| * | | | | SI-7740 Trim stack trace before printing in REPLChristoffer Sawicki2013-08-194-4/+56
| | | | | |
* | | | | | Merge pull request #2848 from paulp/patmat2Adriaan Moors2013-08-20106-1067/+2941
|\ \ \ \ \ \ | | | | | | | | | | | | | | Pattern matcher: extractors become name-based.
| * \ \ \ \ \ Merge branch 'master' into patmatPaul Phillips2013-08-2044-148/+181
| |\ \ \ \ \ \ | |/ / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala
* | | | | | | Merge pull request #2775 from paulp/pr/nosymbol-has-ownerAdriaan Moors2013-08-2027-127/+96
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | No longer crash on NoSymbol.owner.
| * | | | | | No longer crash on NoSymbol.owner.Paul Phillips2013-08-1927-127/+96
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Historically calling NoSymbol.owner has crashed the compiler. With this commit, NoSymbol owns itself. This is consistent with the way ownership chains are handled elsewhere in the compiler (e.g. NoContext.owner is NoContext, NoSymbol.enclClass is NoSymbol, and so on) and frees every call site which handles symbols from having to perform precondition tests against NoSymbol. Since calling NoSymbol.owner sometimes (not always) indicates a bug which we'd like to catch sooner than later, I have introduced a couple more methods for selected call sites. def owner: Symbol // NoSymbol.owner is self, log if -Xdev def safeOwner: Symbol // NoSymbol.owner is self, ignore def assertOwner: Symbol // NoSymbol.owner is fatal The idea is that everyone can call sym.owner without undue anxiety or paranoid null-like tests. When compiling under -Xdev calls to `owner` are logged with a stack trace, so any call sites for which that is an expected occurrence should call safeOwner instead to communicate the intention and stay out of the log. Conversely, any call site where crashing on the owner call was a desirable behavior can opt into calling assertOwner. This commit also includes all the safeOwner calls necessary to give us a silent log when compiling scala.
* | | | | | Merge pull request #2853 from retronym/ticket/6797Adriaan Moors2013-08-191-0/+4
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6797 Test case for already-fixed DelayedInit bug
| * | | | | | SI-6797 Test case for already-fixed DelayedInit bugJason Zaugg2013-08-191-0/+4
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | Progressed in b4fbb7be0e2, "translation for DelayedInit keeps more code in original class."
* | | | | | Merge pull request #2840 from retronym/ticket/7756-2.11Adriaan Moors2013-08-196-8/+57
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7756 Uncripple refchecks in case bodies
| * | | | | | SI-7756 Uncripple refchecks in case bodiesJason Zaugg2013-08-166-8/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 65340ed4ad2e, parts of RefChecks were disabled when we traversed into the results of the new pattern matcher. Similar logic existed for the old pattern matcher, but in that case the Match / CaseDef nodes still existed in the tree. The new approach was too broad: important checks no longer scrutinized the body of cases. This commit turns the checks back on when it finds the remnants of a case body, which appears as an application to a label def.
* | | | | | | Merge pull request #2854 from som-snytt/issue/7729-slashAdriaan Moors2013-08-196-11/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-7729 Fix broken windows build
| * | | | | | | SI-7729 Fix broken windows buildSom Snytt2013-08-196-11/+11
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixing #ifdiff uncovered a latent bug in partest when it detects paths to normalize in test log output. It would not normalize file separators for test names with non-word characters. This commit normalizes the test name to the ticket number as a workaround until the next partest version is picked up. It also fixes partest in this repo in case we've not yet switched over to the new repo. A separate PR will be submitted to the new repo as necessary.