summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2655 from VladUreche/issue/7344Adriaan Moors2013-06-261-24/+94
|\ | | | | SI-7344 Specialize methods in private scopes
| * SI-7344 Specialize methods in private scopesVlad Ureche2013-06-251-24/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This performs method specialization inside a scope other than a {class, trait, object}: could be another method or a value. This specialization is much simpler, since there is no need to record the new members in the class signature, their signatures are only visible locally. It works according to the usual logic: - we use normalizeMember to create the specialized symbols - we leave DefDef stubs in the tree that are later filled in by tree duplication and adaptation The solution is limited by SI-7579: since the duplicator loses the sym annotations when duplicating, this expansion and rewiring can only take place in code that has not been subject to duplication. You can see the test case for an example. Review by @dragos, @paulp or @axel22.
* | Merge pull request #2648 from retronym/ticket/7571Grzegorz Kossakowski2013-06-251-2/+2
|\ \ | | | | | | SI-7571 Allow nesting of anonymous classes in value classes
| * | SI-7571 Allow nesting of anonymous classes in value classesJason Zaugg2013-06-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 5d9cde105e added deep prohibition of nested classes within a value class. This has the undesirable side effect of prohibiting partial functions literals in method bodies of a value class. The intention of that prohibition was to avoid problems in code using Type Tests, such as: class C(val inner: A) extends AnyVal { class D } def foo(a: Any, other: C) = a match { case _ : other.D } Here, the pattern usually checks that `a.$outer == other`. But that is incongruent with the way that `other` is erased to `A`. However, not all nested classes could lead us into this trap. This commit slightly relaxes the restriction to allow anonymous classes, which can't appear in a type test. The test shows that the translation generates working code.
* | | Merge pull request #2511 from ↵Adriaan Moors2013-06-241-137/+44
|\ \ \ | |_|/ |/| | | | | | | | viktorklang/wip-cleaner-Future-method-implementations-2.10-√ General SIP-14 Future method implementation cleanup
| * | Cleaning up method implementations in FutureViktor Klang2013-06-191-137/+44
| | | | | | | | | | | | | | | | | | | | | Optimizations: 1) Avoiding isDefinedAt + apply and using applyOrElse to allow for optimizations later 2) Reducing method sizes to be more JIT + inliner friendly 3) Reusing core combinators to reuse inliner/JIT optimizations and be more code-cache friendly
* | | Merge pull request #2651 from VladUreche/issue/7343-2Adriaan Moors2013-06-182-20/+33
|\ \ \ | | | | | | | | SI-7343 Fixed phase ordering in specialization
| * | | SI-7343 Fixed phase ordering in specializationVlad Ureche2013-06-122-2/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Specialization rewires class parents during info transformation, and the new info then guides the tree changes. But if a symbol is created during duplication, which runs after specialization, its info is not visited and thus the corresponding tree is not specialized. One manifestation is the following: ``` object Test { class Parent[@specialized(Int) T] def spec_method[@specialized(Int) T](t: T, expectedXSuper: String) = { class X extends Parent[T]() // even in the specialized variant, the local X class // doesn't extend Parent$mcI$sp, since its symbol has // been created after specialization and was not seen // by specialzation's info transformer. ... } } ``` We can fix this by forcing duplication to take place before specialization. Review by @dragos, @paulp or @axel22.
| * | | Removed redundant `retypedMethod` in `Duplicators`Vlad Ureche2013-06-121-18/+2
| | |/ | |/| | | | | | | | | | | | | It was never used since its introduction in 3ee6b3653 by @dragos. Review by @dragos or @axel22 or @paulp.
* / | Add Eclipse project for JUnit tests.Grzegorz Kossakowski2013-06-153-0/+50
|/ /
* | [backport] SI-7498 ParTrieMap.foreach no longer crashesAleksandar Prokopec2013-06-091-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | 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 #2606 from JamesIry/2.10.x_classfile_52Jason Zaugg2013-06-091-0/+27
|\ \ | | | | | | Test for reading JDK 8 (classfile format 52) class files.
| * | Refactor testing logic for only running under certain JDK versionsJames Iry2013-06-041-0/+27
| | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #2611 from retronym/ticket/6481Paul Phillips2013-06-081-1/+4
|\ \ \ | | | | | | | | 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-301-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-081-1/+1
|\ \ \ \ | | | | | | | | | | SI-7558 Fix capture of free local vars in toolbox compiler
| * | | | SI-7558 Fix capture of free local vars in toolbox compilerJason Zaugg2013-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | It was creating an `ObjectRef[<notype>]` because of a small bug in `capturedVariableType`.
* | | | | Merge pull request #2626 from retronym/ticket/7556Adriaan Moors2013-06-051-9/+4
|\ \ \ \ \ | |/ / / / |/| | | | SI-7556 Fix runtime reflection involving ScalaLongSignature
| * | | | SI-7556 Fix runtime reflection involving ScalaLongSignatureJason Zaugg2013-06-051-9/+4
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #2609 from retronym/ticket/7507Paul Phillips2013-06-031-2/+10
|\ \ \ \ | | | | | | | | | | SI-7507 Fix lookup of private[this] member in presence of self type.
| * | | | SI-7507 Fix lookup of private[this] member in presence of self type.Jason Zaugg2013-05-311-2/+10
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the following code: trait Cake extends Slice trait Slice { self: Cake => // must have self type that extends `Slice` private[this] val bippy = () // must be private[this] locally(bippy) } `ThisType(<Slice>)`.findMember(bippy)` excluded the private local member on the grounds that the first class in the base type sequence, `Cake`, was not contained in `Slice`. scala> val thisType = typeOf[Slice].typeSymbol.thisType thisType: $r.intp.global.Type = Slice.this.type scala> thisType.baseClasses res6: List[$r.intp.global.Symbol] = List(trait Cake, trait Slice, class Object, class Any) This commit changes `findMember` to use the symbol of the `ThisType`, rather than the first base class, as the location of the selection.
* | | | Merge pull request #2619 from scalamacros/ticket/7375Eugene Burmako2013-06-021-2/+5
|\ \ \ \ | |/ / / |/| | | SI-7375 ClassTag for value class aliases
| * | | SI-7375 ClassTag for value class aliasesEugene Burmako2013-05-311-2/+5
| | | | | | | | | | | | | | | | reifyRuntimeClass now always dealiases its argument prior to processing.
* | | | Merge pull request #2578 from retronym/ticket/6138Adriaan Moors2013-05-293-9/+11
|\ \ \ \ | |_|/ / |/| | | SI-6138 Centralize and refine detection of `getClass` calls
| * | | SI-6138 Centralize and refine detection of `getClass` callsJason Zaugg2013-05-233-9/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `getClass` is special cased in the compiler; this is described in in the comments on `Definitions.Any_getClass`. Part of this happens in `Typer#stabilize`. This was trying to determine if an Ident or Select node was a call to `getClass` by merits of the name of the tree's symbol and by checking that the its type (if it was a MethodType or PolyType) had no parameters in the primary parameter list. Overloaded user defined `getClass` methods confused this check. In the enclosed test case, the tree `definitions.this.getClass` had an `OverloadedType`, and such types always report an empty list of `params`. This commit: - changes `stabilize` to use `isGetClass`, rather than the homebrew check - changes `isGetClass` to consider a `Set[Symbol]` containing all `getClass` variants. This moves some similar code from `Erasure` to `Definitions` - keeps a fast negative path in `isGetClass` based on the symbol's name
* | | | Merge pull request #2570 from soc/SI-7391James Iry2013-05-281-4/+1
|\ \ \ \ | |_|/ / |/| | | SI-7391 Always use ForkJoin in Scala actors on ...
| * | | SI-7391 Always use ForkJoin in Scala actors on ...Simon Ochsenreither2013-05-201-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... Java 6 and above (except when the porperty actors.enableForkJoin says otherwise) Like SI-7236 and SI-7237, the logic in scala.actors.scheduler.ThreadPoolConfig.useForkJoin (which resulted in a different thread pool implementation being chosen) was causing random hangs in the test concurrent-stream.scala when running on Avian.
* | | | Merge pull request #2583 from som-snytt/issue/7473-pointless-for-crashPaul Phillips2013-05-272-5/+10
|\ \ \ \ | | | | | | | | | | SI-7473 Bad for expr crashes postfix
| * | | | SI-7473 Bad for expr crashes postfixSom Snytt2013-05-232-5/+10
| | |/ / | |/| | | | | | | | | | | | | | | | | | This commit makes building PostfixSelect robust against a bad pos on its operand, which can happen if a bad for expression results in an EmptyTree.
* | | | SI-7421 remove unneeded extra-attachement in maven deployFrançois Garillot2013-05-241-5/+1
| | | |
* | | | SI-7497 Fix scala.util.Properties.isMacSimon Ochsenreither2013-05-231-7/+9
|/ / / | | | | | | | | | | | | | | | | | | | | | It returned wrong values because it used the java.vendor property instead of os.name. See http://mail.openjdk.java.net/pipermail/macosx-port-dev/2012-November/005148.html for the reason why we don't follow developer.apple.com/library/mac/#technotes/tn2002/tn2110.
* | | Merge pull request #2506 from scalamacros/ticket/7461Eugene Burmako2013-05-202-2/+2
|\ \ \ | | | | | | | | c.typeCheck(silent = true) now suppresses ambiguous errors
| * | | c.typeCheck(silent = true) now suppresses ambiguous errorsEugene Burmako2013-05-092-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Otherwise use cases like the one shown in the attached test (trying to typecheck something, which leads to an ambiguous overload error) will mysteriously fail compilation.
* | | | Merge pull request #2508 from ↵Adriaan Moors2013-05-201-43/+42
|\ \ \ \ | |_|/ / |/| | | | | | | | | | | viktorklang/wip-removing-synchronization-from-DefaultPromise-2.10-√ Reimplementing blocking awaiting for Futures so only the blockers have t...
| * | | Reimplementing much of the DefaultPromise methodsViktor Klang2013-05-181-43/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Optimizations: 1) Avoiding to call 'synchronized' in tryComplete and in tryAwait 2) Implementing blocking by using an optimized latch so no blocking ops for non-blockers 3) Reducing method size of isCompleted to be cheaper to inline 4) 'result' to use Try.get instead of patmat
* | | | Merge pull request #2540 from adriaanm/ticket-7201v2.10.2-RC1Adriaan Moors2013-05-174-1/+12
|\ \ \ \ | | | | | | | | | | SI-7201 scala-library's pom points to scaladoc url
| * | | | SI-7201 scaladoc url in scala-(library,actors,swing,reflect) pomAdriaan Moors2013-05-174-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The project/properties/info.apiURL pom property is used by SBT to link to an artifact's scaladoc. For scala library version $v, the url is http://www.scala-lang.org/api/$v/ Note that actors, reflect and swing are included in the library docs in 2.10.x.
* | | | | Merge pull request #2530 from kzys/jira-6424Adriaan Moors2013-05-171-9/+25
|\ \ \ \ \ | | | | | | | | | | | | SI-6424 Scaladoc: Use mapNodes.get(_) to avoid NoSuchElementException
| * | | | | SI-6424 Scaladoc: Use mapNodes.get(_) to avoid NoSuchElementExceptionKato Kazuyoshi2013-05-151-9/+25
| | | | | | | | | | | | | | | | | | | | | | | | Use mapNodes.get(_) instead of mapNodes(_) to avoid NoSuchElementException.
* | | | | | Merge pull request #2549 from vigdorchik/slash_slashAdriaan Moors2013-05-171-4/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | Prevent slash duplication.
| * | | | | | Prevent slash duplication.Eugene Vigdorchik2013-05-171-4/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't add trailing slash to external doc URL if it already ends with one.
* | | | | | | Merge pull request #2536 from adriaanm/ticket-7359Adriaan Moors2013-05-171-6/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | [backport #1727] SI-7359 cyclic nested java class
| * | | | | | | [backport #1727] SI-7359 cyclic nested java classAdriaan Moors2013-05-161-6/+11
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original commit message (from 54a84a36d5): SI-6548 reflection correctly enters jinners When completing Java classes, runtime reflection enumerates their fields, methods, constructors and inner classes, loads them and enters them into either the instance part (ClassSymbol) or the static part (ModuleSymbol). However unlike fields, methods and constructors, inner classes don't need to be entered explicitly - they are entered implicitly when being loaded. This patch fixes the double-enter problem, make sure that enter-on-load uses the correct owner, and also hardens jclassAsScala against double enters that can occur in a different scenario.
* | | | | | | SI-7486 regression in implicit resolution.Paul Phillips2013-05-171-3/+7
| |/ / / / / |/| | | | | | | | | | | | | | | | | What a touchy beast the compiler is.
* | | | | | [nomaster] unbreaks test.bcEugene Burmako2013-05-171-0/+3
| |_|/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The optimizer behaves unexpectedly smartly, stripping off unused private methods. Unfortunately, sometimes private methods might be compiled down to public Java methods, so stripping them off might lead to binary incompatibilities. This particular commit recovers from this problem caused by https://github.com/scala/scala/commit/5e715396af.
* | | | | Merge pull request #2504 from scalamacros/ticket/7464Jason Zaugg2013-05-172-4/+4
|\ \ \ \ \ | | | | | | | | | | | | SI-7464 allows FieldMirror.set to update vals
| * | | | | SI-7464 allows FieldMirror.set to update valsEugene Burmako2013-05-172-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no reason to leave such sentinels in place inside a facility designed to circumvent usual restrictions of static types / visibility.
* | | | | | Merge pull request #2497 from scalamacros/topic/macro-qqqJason Zaugg2013-05-173-21/+33
|\ \ \ \ \ \ | | | | | | | | | | | | | | easy way of writing not implemented macros
| * | | | | | easy way of writing not implemented macrosEugene Burmako2013-05-123-21/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Even though it's easy to mark regular method bodies as stubs (using ???), there's no simple way of doing the same for macro methods. This patch fixes the inconvenience.
* | | | | | | Fix for unreachable code warning.Paul Phillips2013-05-161-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Oops, I miss when unreachable code was an error.