summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-7781 REPL stack trunc shows causeSom Snytt2013-09-025-9/+256
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The handy stack trace truncation in REPL doesn't show cause like a regular trace. This commit fixes that and also adds the usual indicator for truncation, viz, "... 33 more". The example from the ticket produces: ``` scala> rewrapperer java.lang.RuntimeException: java.lang.RuntimeException: java.lang.RuntimeException: Point of failure at .rewrapper(<console>:9) at .rewrapperer(<console>:10) ... 32 elided Caused by: java.lang.RuntimeException: java.lang.RuntimeException: Point of failure at .wrapper(<console>:8) ... 34 more Caused by: java.lang.RuntimeException: Point of failure at .sample(<console>:7) ... 35 more ``` Suppressed exceptions on Java 7 are handled reflectively. ``` java.lang.RuntimeException: My problem at scala.tools.nsc.util.StackTraceTest.repressed(StackTraceTest.scala:56) ... 27 elided Suppressed: java.lang.RuntimeException: Point of failure at scala.tools.nsc.util.StackTraceTest.sample(StackTraceTest.scala:29) at scala.tools.nsc.util.StackTraceTest.repressed(StackTraceTest.scala:54) ... 27 more ```
* Merge pull request #2864 from retronym/ticket/6240-namesJason Zaugg2013-09-023-43/+71
|\ | | | | SI-6240 Synchronizes Names
| * Lock down methods in NamesJason Zaugg2013-08-311-11/+14
| | | | | | | | | | | | | | | | Marking some methods as final. Once known to be overriden in scala-ide are instead marked with @deprecatedOveriding. This is to signal the new means of synchronization to subclasses.
| * SI-6240 Synchronizes NamesJason Zaugg2013-08-223-33/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously we didn't have all possible name creation facilities covered with locks, so some of them silently misbehaved and caused much grief: http://groups.google.com/group/scala-internals/browse_thread/thread/ec1d3e2c4bcb000a. This patch gets all the name factories under control. Rather than relying on subclasses to override mutating methods and add synchronization, they should instead override `synchronizeNames` to return true and leave the placement of the locks up to `reflect.internal.Names`. These locks are placed around sections that mutate `typeHashtable` and `termHashtable`. This is done in the reflection universe, and in the interactive compiler. The latter change will obviate an incomplete attempt do to the same in `ScalaPresentationCompiler` in the scala-ide project.
* | Merge pull request #2880 from huitseeker/update-artifactoryGrzegorz Kossakowski2013-08-302-3/+3
|\ \ | | | | | | update typesafe.artifactory-online.com to private-repo.typesafe.com
| * | update typesafe.artifactory-online.com to private-repoFrançois Garillot2013-08-272-3/+3
| | |
* | | Merge pull request #2861 from densh/topic/deprecate-early-type-defsGrzegorz Kossakowski2013-08-309-8/+18
|\ \ \ | | | | | | | | Deprecate early type defs
| * | | deprecate early type defsDen Shabalin2013-08-289-8/+18
| | | | | | | | | | | | | | | | | | | | | | | | This feature is neither properly supported by Scala compiler nor a part of the language spec and therefore should be removed. Due to source compatiblity with 2.10 we need to deprecate it first.
* | | | Merge pull request #2890 from retronym/topic/one-mans-blissJason Zaugg2013-08-301-10/+15
|\ \ \ \ | | | | | | | | | | Paring back the scope of our shared .gitignore
| * | | | Paring back the scope of our shared .gitignoreJason Zaugg2013-08-301-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Importantly, limit the exclusion of build.properties to the file in the root directory, paving the way for the return of an SBT build. - Unignores .bak, .jar, and ~ - limit ignorance of qbin to the root directory .log files, generated by partest, are still ignored. To see ignored files in your workspace, try: git ls-files --others --ignored --exclude-standard -- test | grep log git status --ignored -- test
* | | | | Merge pull request #2886 from gkossakowski/merge-2.10.xJason Zaugg2013-08-3056-76/+558
|\ \ \ \ \ | | | | | | | | | | | | Merge 2.10.x into master
| * \ \ \ \ Merge remote-tracking branch 'scala/2.10.x'Grzegorz Kossakowski2013-08-2956-76/+558
| |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After the merge, the test/run/t7733 started to fail on Jenkins. I tried to reproduce it locally but I couldn't so I think it's system dependent failure. Per @retronym's suggestion I moved it to pending to not block the whole merge. Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/typechecker/ContextErrors.scala src/compiler/scala/tools/nsc/typechecker/Macros.scala src/compiler/scala/tools/nsc/typechecker/Namers.scala src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/util/MsilClassPath.scala src/compiler/scala/tools/reflect/ToolBoxFactory.scala src/reflect/scala/reflect/internal/ClassfileConstants.scala src/reflect/scala/reflect/internal/Importers.scala src/reflect/scala/reflect/internal/Trees.scala src/reflect/scala/reflect/runtime/JavaMirrors.scala test/files/run/macro-duplicate/Impls_Macros_1.scala test/files/run/t6392b.check test/files/run/t7331c.check
| | * \ \ \ \ Merge pull request #2860 from retronym/merge/2.10.2-to-2.10.xJames Iry2013-08-2618-30/+108
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Merge/2.10.2 to 2.10.x
| | | * | | | | SI-7486 More tests for cycles triggered by implicit searchJason Zaugg2013-08-212-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Moved an existing test from `pending` to `pos`. Not sure why it was moved to `pending` in the first place. Adds a new test distilled from building Scalaz with 2.10.3-RC1.
| | | * | | | | Merge remote-tracking branch 'origin/2.10.2' into merge/2.10.2-to-2.10.xJason Zaugg2013-08-2118-30/+100
| | | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Better late than never. Conflicts: src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
| | * | \ \ \ \ \ Merge pull request #2870 from retronym/ticket/7778Adriaan Moors2013-08-234-0/+17
| | |\ \ \ \ \ \ \ | | | |/ / / / / / | | |/| | | | | | SI-942 A test case, five years adrift.
| | | * | | | | | SI-942 A test case, five years adrift.Jason Zaugg2013-08-234-0/+17
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I'm looking at the changes made in 47f35b587, which prevented cyclic errors in class file parsing. That fix is insufficient for, or otherwise complicit in, SI-7778, for which I've enclosed a pending test.
| | * | | | | | Merge pull request #2838 from retronym/ticket/7716v2.10.3-RC1James Iry2013-08-162-1/+19
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7716 Exclude patmat synthetics from bounds checking
| | | * | | | | | SI-7716 Exclude patmat synthetics from bounds checkingJason Zaugg2013-08-162-1/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consider this pattern match translation, that occurs *before* refchecks: scala> val e: java.lang.Enum[_] = java.util.concurrent.TimeUnit.SECONDS scala> e match { case x => x } <console>:9: error: type arguments [_$1] do not conform to class Enum's type parameter bounds [E <: Enum[E]] e match { case x => x } ^ [[syntax trees at end of refchecks]] // <console> package $line5 { case <synthetic> val x1: Enum[_$1] = $line3.$read.$iw.$iw.e; case4(){ matchEnd3(x1) }; matchEnd3(x: Enum[_$1]){ x } RefChecks turns a blind eye to the non-conformant type `Enum[_$1]` in the label defs because of `65340ed4ad2e`. (Incidentally, that is far too broad, as I've noted in SI-7756.) This commit extends this exception to cover the synthetic ValDef `x1`. Commit log watchers might notice the similarities to SI-7694.
| | * | | | | | | Merge pull request #2842 from retronym/ticket/7603-2James Iry2013-08-162-30/+14
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7603 Fix thread safety of FlagTranslation
| | | * | | | | | | SI-7603 Remove diagnostic code for annotation errorJason Zaugg2013-08-161-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We've fingered the true culprit in the previous commit.
| | | * | | | | | | SI-7603 Fix thread safety of FlagTranslationJason Zaugg2013-08-161-22/+14
| | | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is outside of the Global cake, so we can't assume single threaded access. A var was introduced in af3daf6fdb that can lead to incorrect flag interpretation. The reported bug was triggered in a multi-project SBT build. Java Annotations read from classfiles were occasionally conferred the TRAIT|INFERFACE|ABSTRACT flag set, leading to "@Foo is abstract, cannot be instatiated" later down the line.
| | * | | | | | | Merge pull request #2814 from xeno-by/topic/auto-duplicate-expansionsJames Iry2013-08-1611-5/+107
| | |\ \ \ \ \ \ \ | | | |/ / / / / / | | |/| | | | | | [nomaster] macro expansions are now auto-duplicated
| | | * | | | | | [nomaster] macro expansions are now auto-duplicatedEugene Burmako2013-08-1411-5/+107
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix still requires macro developers to be careful about sharing trees by references, because attributed DefTrees will still bring trouble. However this is an improvement, because it doesn't make matters worse and automatically fixes situations similar to one in the test. A much more thorough discussion with a number of open questions left: http://groups.google.com/group/scala-internals/browse_thread/thread/492560d941b315cc Was fixed ages ago in master in one of the paradise backports. Never got to 2.10.x, but it's very useful, so I'm backporting it now.
| | * | | | | | | Merge pull request #2834 from retronym/ticket/7752James Iry2013-08-153-4/+60
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7752 Don't disambiguate type parameters of overloaded alts
| | | * | | | | | | SI-7752 Don't disambiguate type parameters of overloaded altsJason Zaugg2013-08-153-4/+60
| | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are passed through from `InferencerContextErrors#applyErrorMsg` to `withDisambiguation` as the `locals` parameter, which is promptly ignored. This looks to be an unintended change in 39938bcc299. Without this patch, the enclosed test case enters a pathalogical disambiguation session, that not only flirts with unpleasant big-O complexities, but also flails about appending "(in method foo)" only to find that *all* occurences of the same-named type parameter come from some method named "foo". [snipping error message 40 seconds in the making] method foo), O(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), P(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), Q(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), R(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), S(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), T, U(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo)(in method foo), V) cannot be applied to (Int) foo((1))
| | * | | | | | | Merge pull request #2829 from adriaanm/ticket-7014James Iry2013-08-144-3/+29
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7014 Annot arg may refer to annotated class's member
| | | * | | | | | | SI-7014 Annot arg may refer to annotated class's memberAdriaan Moors2013-08-134-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This only reduces the crasher to a warning.
| | * | | | | | | | Merge pull request #2828 from adriaanm/rebase-2771James Iry2013-08-139-13/+134
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | [Rebase #2771] SI-7694 @uncheckedBounds, an opt-out from type bounds checking
| | | * | | | | | | | SI-7694 Add @uncheckedBounds to the libraryJason Zaugg2013-08-133-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-136-13/+74
| | | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-134-4/+53
| | |\ \ \ \ \ \ \ \ | | | |/ / / / / / / | | |/| | | | | | | SI-7020 Determinism for pattern matcher warnings
| | | * | | | | | | SI-7020 Determinism for pattern matcher warningsJason Zaugg2013-08-134-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1310-14/+54
| | |\ \ \ \ \ \ \ \ | | | |/ / / / / / / | | |/| | | | | | | SI-7733 reflective packages now more consistent with scalac
| | | * | | | | | | [nomaster] SI-7733 reflective packages now more consistent with scalacEugene Burmako2013-08-1310-14/+54
| | | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-122-1/+3
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | showRaw now prints symbols of def trees
| | | * | | | | | | showRaw now prints symbols of def treesEugene Burmako2013-08-102-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-123-1/+34
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | currentRun.compiles now correctly works in toolboxes
| | | * | | | | | | | currentRun.compiles now correctly works in toolboxesEugene Burmako2013-08-103-1/+34
| | | | |/ / / / / / | | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Another random bug uncovered and extinguished when hacking macro annots.
| | * | | | | | | | Merge pull request #2818 from xeno-by/topic/macro-expansion-error-posJason Zaugg2013-08-127-1/+36
| | |\ \ \ \ \ \ \ \ | | | |/ / / / / / / | | |/| | | | | | | [nomaster] macro errors now always have positions
| | | * | | | | | | [nomaster] macro errors now always have positionsEugene Burmako2013-08-107-1/+36
| | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| | * | | | | | | Merge pull request #2800 from densh/topic/toolbox-positionsEugene Burmako2013-08-088-6/+51
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7331 tb.parse returns unpositioned trees
| | | * | | | | | | SI-7331 tb.parse returns unpositioned treesDen Shabalin2013-08-088-6/+51
| | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-017-3/+53
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | Assorted toolbox fixes
| | | * | | | | | | | brings JavaMirrors up to speed with ClassfileParserEugene Burmako2013-07-237-3/+53
| | | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-293-3/+23
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7763 Avoid dropping casts in erasure
| * | | | | | | | | | SI-7763 Don't eliminate CHECK_CAST in dead code elimination.Jason Zaugg2013-08-292-2/+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-293-2/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.