summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2641 from soc/SI-6811-cloneable-definitionPaul Phillips2013-06-131-15/+0
|\ | | | | SI-6811 Remove scala.annotation.cloneable
| * SI-6811 Remove scala.annotation.cloneableSimon Ochsenreither2013-06-071-15/+0
| |
* | Merge pull request #2645 from soc/SI-6747Paul Phillips2013-06-131-0/+3
|\ \ | | | | | | SI-6747 Deprecate Range#{numRange,last,terminal}Element{s,}
| * | SI-6747 Deprecate Range#{numRange,last,terminal}Element{s,}Simon Ochsenreither2013-06-091-0/+3
| | | | | | | | | | | | There are already better replacements which expose less surprising behaviour.
* | | Merge pull request #2647 from ↵Grzegorz Kossakowski2013-06-1215-22/+3180
|\ \ \ | | | | | | | | | | | | | | | | retronym/topic/merge-v2.10.2-RC1-35-ga54d86b-to-master merge 2.10.x to master
| * | | Merge branch '2.10.x' into topic/merge-v2.10.2-RC1-35-ga54d86b-to-masterJason Zaugg2013-06-1015-22/+3180
|/| | | | | | | | | | | | | | | | | | | Conflicts: src/partest/scala/tools/partest/DirectTest.scala
| * | | Merge pull request #2616 from retronym/ticket/7505Jason Zaugg2013-06-091-0/+16
| |\ \ \ | | | | | | | | | | SI-7505 Test case for pattern matcher + type alias bug
| | * | | SI-7505 Test case for pattern matcher + type alias bugJason Zaugg2013-06-081-0/+16
| | | | | | | | | | | | | | | | | | | | Progressed along with SI-7214 in acd74cae09.
| * | | | Merge pull request #2606 from JamesIry/2.10.x_classfile_52Jason Zaugg2013-06-095-11/+114
| |\ \ \ \ | | | | | | | | | | | | Test for reading JDK 8 (classfile format 52) class files.
| | * | | | Refactor testing logic for only running under certain JDK versionsJames Iry2013-06-044-18/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had several tests designed to only run if the JDK version was at least some specified version. This commit refactors that common logic into DirectTest.
| | * | | | Test for reading JDK 8 (classfile format 52) class files.James Iry2013-05-292-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes a test for reading JDK 8 (classfile format 52) class files, in particular default (aka defender) methods. It uses ASM to generate an interface with default methods then exercises that interface from Scala. Surprisingly no changes are necessary to the Scala code base to support reading format 52 class files. Because the test can only run under JDK 8, the JDK version is checked and the expected output is synthesized for previous versions.
| * | | | | Merge pull request #2611 from retronym/ticket/6481Paul Phillips2013-06-083-1/+21
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6841 Fix bug at the intersection of DelayedInit and named args
| | * | | | | SI-6841 Fix bug at the intersection of DelayedInit and named argsJason Zaugg2013-05-303-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DelayedInit transformation analyses the constructor to partition regular initialization from calls to super constructors / trait initializers. It failed to find such super calls if they were nested in a Block, which can happens when using named or default arguments. This commit makes that code peer into Blocks to correctly partition the constructor statements. This change doesn't affect the result of run/t4680.scala, which was mentioned in nearby comments and which chronicles bugs with DelayedInit when used in inheritance hierarchies.
| * | | | | | Merge pull request #2629 from retronym/ticket/7558Paul Phillips2013-06-082-1/+10
| |\ \ \ \ \ \ | | |_|_|/ / / | |/| | | | | SI-7558 Fix capture of free local vars in toolbox compiler
| | * | | | | SI-7558 Fix capture of free local vars in toolbox compilerJason Zaugg2013-06-052-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was creating an `ObjectRef[<notype>]` because of a small bug in `capturedVariableType`.
| * | | | | | Merge pull request #2626 from retronym/ticket/7556Adriaan Moors2013-06-054-9/+3019
| |\ \ \ \ \ \ | | |/ / / / / | |/| | | | | SI-7556 Fix runtime reflection involving ScalaLongSignature
| | * | | | | SI-7556 Fix runtime reflection involving ScalaLongSignatureJason Zaugg2013-06-054-9/+3019
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala type information is stored in classfiles in encoded in a String in the ScalaSignature annotation. When it is too big for a single String, it is split into an array of Strings in a different annotation, ScalaLongSignature. The enclosed test, with a class containing 3000 methods, uses the latter. It exposes a bug in the way runtime reflection decodes that data. It must concatentate and *then* decode, rather that the other way around.
* | | | | | Merge pull request #2621 from retronym/ticket/7264Paul Phillips2013-06-094-1/+28
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7264 Initialize owner when searching for companion.
| * | | | | | SI-7264 Initialize owner when searching for companion.Jason Zaugg2013-06-054-1/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From ClassSymbol: protected final def companionModule0: Symbol = flatOwnerInfo.decl(name.toTermName).suchThat(sym => sym.isModuleNotMethod && (sym isCoDefinedWith this)) protected final def flatOwnerInfo: Type = { if (needsFlatClasses) info owner.rawInfo } Note the call to `rawInfo`; in the enclosed test case, that gives us back an uninitialized type for the module class of `Foo`, and consequently we don't find the companion for `Foo.Values`. This commit forces the initialization of the owning symbol if it was compiled in a prior run. In addition, it adds a special case to `Run#compiles` for early initialized symbols, which start out in life with the wrong owner. As best as I can see, that complexity stems from allowing early initialized members *without* return types to be used as value arguments to the super call, which in turn is needed to infer parent type arguments. The situation is described a little further in existing comments of `typedPrimaryConstrBody`. This bug is essentially another case of SI-6976. See the comments in pull request of that patch (https://github.com/scala/scala/pull/1910) for commit archaeology that shows why we're reluctant to force the owner info more broadly than is done in this commit.
* | | | | | | Merge pull request #2640 from jedesah/patch-1Jason Zaugg2013-06-091-0/+21
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | Document exceptions thrown in some conversion methods of String
| * | | | | | Fix incorrectly documented exception of toBoolean method of StringJean-Remi Desjardins2013-06-061-1/+1
| | | | | | |
| * | | | | | Document exceptions thrown in some conversion methods of StringJean-Remi Desjardins2013-06-061-0/+21
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #2610 from axel22/issue/7498Jason Zaugg2013-06-092-2/+25
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7498 ParTrieMap.foreach no longer crashes
| * | | | | | SI-7498 ParTrieMap.foreach no longer crashesAleksandar Prokopec2013-05-302-2/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the `split` method of the `ParTrieMap` iterator threw an exception when splitting a splitter that iterated over nodes whose hash codes collide. This was due to reusing the iterator of the list of colliding keys rather than creating a new splitter. This commit changes the `subdivide` method to create a new iterator using the factory method of the current trie map iterator rather than returning a `LinearSeqLike` iterator.
* | | | | | | Merge pull request #2617 from paulp/pr/use-dedicated-sentinelsJason Zaugg2013-06-0910-67/+69
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Eliminate needless Options.
| * | | | | | | Eliminate needless Options.Paul Phillips2013-06-0810-67/+69
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Many of our core types have dedicated sentinels which serve perfectly to communicate "no value", even more perfectly than None. Saving a billion allocations is gravy.
* | | | | | | | Merge pull request #2533 from soc/SI-6503Jason Zaugg2013-06-092-9/+5
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6503 Fix doctype, remove processing instructions, ...
| * | | | | | | | SI-6503 Fix scaladoc output to generate valid HTML5Simon Ochsenreither2013-06-092-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I checked the generated HTML with the validators provided by http://validator.w3.org/ and http://html5.validator.nu/ to verify that all issues have been fixed. Changes: - Adapt doctype - Remove processing instructions - Add alt attributes to image tags Before that, the output tried to be XHTML 1.1, but failed validation as attested by both validators mentioned above, making it more likely to trigger the quirks modes in browsers.
* | | | | | | | | Merge pull request #2596 from retronym/ticket/7519Jason Zaugg2013-06-093-2/+28
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7519 Less brutal attribute resetting in adapt fallback
| * | | | | | | | | SI-7519 Less brutal attribute resetting in adapt fallbackJason Zaugg2013-05-253-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prefers `resetLocalAttrs` over `resetAllAttrs`. The latter loses track of which enclosing class of the given name is referenced by a `This` node which prefixes the an applied implicit view. The code that `resetAllAttrs` originally landed in: https://github.com/scala/scala/commit/d4c63b#L6R804
* | | | | | | | | | Merge pull request #2630 from retronym/ticket/6308Jason Zaugg2013-06-093-4/+77
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-6308 Specialize methods that have some unspecialized params
| * | | | | | | | | | SI-6308 Specialize methods that have some unspecialized paramsJason Zaugg2013-06-053-4/+77
| | |_|_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a continuation of 1591c14e50, which didn't go far enough to handle method calls with a mix of specialized and unspecialized type parameters. This commit modifies `specSym` to calculate the residual type of the original method after specialized type parameters have been removed and the type environment of the candidate specialized variant has been subsituted. For example, here is trace of `specSym` when searcing for the specialized variant of `f4` in the enclosed test: tree = Main.this.f4[Nothing, Int] tree.tpe = (a: Int, b: List[(Int, Nothing)])String fun.tpe = [B, A](a: A, b: List[(A, B)])String residualTreeType = [B](a: Int, b: List[(Int, B)])String memberType = [B](a: Int, b: List[(Int, B)])String env = Map(type A -> Int) doesConform = true A few "todo" tests are included that highlight an endemic issue with the current specialization implementation: type parameters that show up after `uncurry` might be clones of the original symbols from typer, if they have been through a TypeMap (e.g. within a call to `uncurryTreeType`). So testing them for existence with the `typeEnv` map is fruitless. No amount of `atPhase` acrobatics can rescue us from this; we need to transport this information in a symbol-cloning resiliant manner. Maybe Symbol Attachments?
* | | | | | | | | | Merge pull request #2642 from soc/SI-7564Jason Zaugg2013-06-091-1/+1
|\ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / |/| | | | | | | | | SI-7564 Fix detection of reflective calls on Avian
| * | | | | | | | | SI-7564 Fix detection of reflective calls on AvianSimon Ochsenreither2013-06-081-1/+1
| | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Base_1.scala checks whether reflection was used by inspecting the stacktrace and looking for “java.lang.reflect.”. The stacktrace looks differently on Avian and therefore the test fails. This change looks for “sun.reflect.” instead, which seems to work on OpenJDK and Avian.
* | | | | | | | | Merge pull request #2639 from retronym/ticket/2464Paul Phillips2013-06-085-8/+99
|\ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / |/| | | | | | | | SI-2464 Resiliance against missing InnerClass attributes
| * | | | | | | | SI-2464 Resiliance against missing InnerClass attributesJason Zaugg2013-06-065-8/+99
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A classfile in the wild related to Vaadin lacked the InnerClasses attribute. As such, our class file parser treated a nested enum class as top-level, which led to a crash when trying to find its linked module. More details of the investigation are available in the JIRA comments. The test introduces a new facility to rewrite classfiles. This commit turns this situation into a logged warning, rather than crashing. Code by @paulp, test by yours truly.
* | | | | | | | Merge pull request #2627 from retronym/ticket/7418Paul Phillips2013-06-081-4/+5
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7418 Avoid concurrent use of compiler in REPL startup
| * | | | | | | | SI-7418 Avoid concurrent use of compiler in REPL startupJason Zaugg2013-06-051-4/+5
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enable the tab completer *after* we're finished binding $intp and unleashing power mode on the asynchronous REPL startup thread. Tested manually: - run qbin/scala - Paste "".toUp - Hit <TAB> like a maniac Before this patch, the crash was reproducible almost every time. Afterwards, not the once.
* | | | | | | | Merge pull request #2638 from paulp/pr/error-outputPaul Phillips2013-06-083-39/+30
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Cleanup of crash output.
| * | | | | | | | Cleanup of crash output.Paul Phillips2013-06-063-39/+30
| | |/ / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I finally ran across the assert (or one of them) which produces such voluminous output that it scares the cattle. When you see "decls" in an assert, run. After silencing that, I extended the journey into quieting the default crash message down, way down. I assume this will be met only with sighs of relief. And then most challenging of all for some reason, I convinced it to only print the information once. Volume of crash data generated when reproducing the fsc bug shown below: Before this commit 1158 lines After this commit 27 lines Pretty sure there's more information in the 27 lines. To reproduce the crash: fsc src/library/scala/collection/immutable/IntMap.scala fsc src/library/scala/collection/immutable/IntMap.scala The first compile succeeds quietly; the second throws warnings out of the gate, then crashes. And the "after" output: error: Cannot create static reference to method equals because object GenMapLike$class has no source module error: fatal error: while compiling: /scala/trunk/src/library/scala/collection/immutable/IntMap.scala during phase: globalPhase=mixin, enteringPhase=cleanup library version: version 2.11.0-20130606-052937-392858b4f6 compiler version: version 2.11.0-20130606-055515-1856bec71b reconstructed args: -d /tmp last tree to typer: Ident(key$2) tree position: line 377 of /scala/trunk/src/library/scala/collection/immutable/IntMap.scala tree tpe: Int symbol: value key$2 (flags: <param> <synthetic>) symbol definition: key$2: Int (a TermSymbol) symbol package: scala.collection.immutable symbol owners: value key$2 -> constructor IntMap$$anonfun$unionWith$2 -> anonymous class anonfun$unionWith$2 call site: object IntMap$Nil in package immutable in package immutable == Source file context for tree position == 374 } 375 case (IntMap.Tip(key, value), x) => x.updateWith[S](key, value, (x, y) => f(key, y, x)) 376 case (x, IntMap.Tip(key, value)) => x.updateWith[S](key, value, (x, y) => f(key, x, y)) 377 case (IntMap.Nil, x) => x 378 case (x, IntMap.Nil) => x 379 } 380
* | | | | | | | Merge pull request #2622 from scalamacros/pullrequest/paradisePaul Phillips2013-06-0711-57/+107
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Backport from paradise/macros
| * | | | | | | unifies handling of T's in various analyses of Foo[T]'sEugene Burmako2013-06-073-42/+50
| | | | | | | |
| * | | | | | | fixes a crash on a degenerate macro definitionEugene Burmako2013-06-073-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous version of the MacroImplReference extractor didn't take into the account the fact that RefTree.qualifier.symbol can be null (and it can be null if RefTree is an Ident, because then qualifier is an EmptyTree). This led to NPEs for really weird macro defs that refer to local methods as their corresponding macro impls. Now I check for this corner case, and the stuff now longer crashes. This was wrong; this is how I fixed it; the world is now a better place.
| * | | | | | | cleans up 82f0925Eugene Burmako2013-06-035-11/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Updates comments, implements accidentally forgotten IMPLPARAM_TREE, creates a test to ensure that nothing else is overseen.
* | | | | | | | Merge pull request #2582 from paulp/pr/SubstTypeMapAdriaan Moors2013-06-052-4/+14
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Cache the most recently created SubstTypeMap.
| * | | | | | | | Cache the most recently created SubstTypeMap.Paul Phillips2013-05-222-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I discovered that a 1-element cache for SubstTypeMaps gave a 75-90% hit rate.
* | | | | | | | | Merge pull request #2605 from JamesIry/weak_hashset_uniquesGrzegorz Kossakowski2013-06-044-50/+588
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7149 Use a WeakHashSet for type uniqueness
| * | | | | | | | | Modify perRunCaches to not leak WeakReferencesJames Iry2013-06-041-10/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | perRunCaches was using a HashMap of WeakReferences which meant it would accumulate WeakReferences over time. This commit uses a WeakHashSet instead so that the references are cleaned up.
| * | | | | | | | | SI-7149 Use a WeakHashSet for type uniquenessJames Iry2013-06-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently type uniqueness is done via a HashSet[Type], but that means the Types live through an entire compile session, even ones that are used once. The result is a huge amount of unnecessarily retained memory. This commit uses a WeakHashSet instead so that Types and their WeakReferences are cleaned up when no longer in use.
| * | | | | | | | | SI-7150 Replace scala.reflect.internal.WeakHashSetJames Iry2013-06-042-38/+583
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces scala.reflect.internal.WeakHashSet with a version that * extends the mutable.Set trait * doesn't leak WeakReferences * is unit tested