summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
Commit message (Collapse)AuthorAgeFilesLines
* opt: fuse some operations on `Scope`sAdriaan Moors2016-06-011-2/+1
| | | | | | | `Scope`'s `filter` is implemented using `toList`, so may as well start with `toList`ourselves. Also fused some `filter`/`foreach` combos.
* SI-9542 Fix regression in value classes with enclosing refsJason Zaugg2016-02-011-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In SI-9473 / e2653736, I changed `mkAttributedRef` to avoid prefixing references to statically owned symbols with a `ThisType`. Turns out there was one place that depended on the old behaviour. ``` object Outer { trait T class C(val value: Any) extends AnyVal { def foo(t: T) = expr } } ``` Is translated to: ``` object Outer { trait T class C(val value: Any) extends AnyVal { def foo(t: T) = Outer.this.C.foo$extension(C.this, t) } object C { def foo$extension($this: C, t: T) = expr } } ``` After the change, the forwarder was instead: ``` def foo(t: T) = Outer.C.foo$extension(C.this, t) ``` Note: this change is not actually necessary after the following commit that makes subtyping unify the different module class reference, that alone is enough to make the enclosed test pass.
* Remove unused imports and other minor cleanupsSimon Ochsenreither2015-12-181-1/+1
| | | | | | | | | | - Language imports are preceding other imports - Deleted empty file: InlineErasure - Removed some unused private[parallel] methods in scala/collection/parallel/package.scala This removes hundreds of warnings when compiling with "-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
* Merge pull request #3877 from retronym/merge/2.11.x-to-2.12.x-20140714Jason Zaugg2014-07-181-1/+1
|\ | | | | Merge 2.11.x to 2.12.x
| * Rip out reporting indirection from CompilationUnitAdriaan Moors2014-07-041-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inline the forwarders from CompilationUnit, which should not affect behavior. Since all forwarders lead to global.reporter, don't first navigate to a compilation unit, only to then forward back to global.reporter. The cleanup in the previous commits revealed a ton of confusion regarding how to report an error. This was a mechanical search/replace, which has low potential for messing things up, since the list of available methods are disjoint between `reporter` and `currentRun.reporting`. The changes involving `typer.context` were done previously. Essentially, there are three ways to report: - via typer.context, so that reporting can be silenced (buffered) - via global.currentRun.reporting, which summarizes (e.g., deprecation) - via global.reporter, which is (mostly) stateless and straightforward. Ideally, these should all just go through `global.currentRun.reporting`, with the typing context changing that reporter to buffer where necessary. After the refactor, these are the ways in which we report (outside of typer): - reporter.comment - reporter.echo - reporter.error - reporter.warning - currentRun.reporting.deprecationWarning - currentRun.reporting.incompleteHandled - currentRun.reporting.incompleteInputError - currentRun.reporting.inlinerWarning - currentRun.reporting.uncheckedWarning Before: - c.cunit.error - c.enclosingUnit.deprecationWarning - context.unit.error - context.unit.warning - csymCompUnit.warning - cunit.error - cunit.warning - currentClass.cunit.warning - currentIClazz.cunit.inlinerWarning - currentRun.currentUnit.error - currentRun.reporting - currentUnit.deprecationWarning - currentUnit.error - currentUnit.warning - getContext.unit.warning - getCurrentCUnit.error - global.currentUnit.uncheckedWarning - global.currentUnit.warning - global.reporter - icls.cunit.warning - item.cunit.warning - reporter.comment - reporter.echo - reporter.error - reporter.warning - reporting.deprecationWarning - reporting.incompleteHandled - reporting.incompleteInputError - reporting.inlinerWarning - reporting.uncheckedWarning - typer.context.unit.warning - unit.deprecationWarning - unit.echo - unit.error - unit.incompleteHandled - unit.incompleteInputError - unit.uncheckedWarning - unit.warning - v1.cunit.warning All these methods ended up calling a method on `global.reporter` or on `global.currentRun.reporting` (their interfaces are disjoint). Also clean up `TypeDiagnostics`: inline nearly-single-use private methods.
* | SI-8710 Fix crasher for value classes + private + overloadingJason Zaugg2014-07-111-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The link between methods owned by a value class and the corresponding extension method in the companion is governed in part by a naming convention that depends on how many eponymous decls exist. This is easiest to explain with an example: % cat sandbox/test.scala && \ qscalac -Xprint:extmethods sandbox/test.scala \ | egrep 'class|object|def (foo|bar)|}$' class C(val x: Any) extends AnyVal { def foo(a: Int) = "" def foo(a: String) = "" def bar(a: Byte) } final class C extends scala.AnyVal { def foo(a: Int): String = C.foo$extension0(C.this)(a); def foo(a: String): String = C.foo$extension1(C.this)(a); def bar(a: Byte): Unit = C.bar$extension(C.this)(a); } <synthetic> object C extends AnyRef { final def foo$extension0($this: C)(a: Int): String = ""; final def foo$extension1($this: C)(a: String): String = ""; final def bar$extension($this: C)(a: Byte): Unit = (<empty>.asInstanceOf[Unit]: Unit); } } } Notice how the extension method names for `foo` are suffixed with a counter. This logic is contained in `extensionNames`. However, in the enclosed test cases, when we call `extensionNames` in a late phase of the compiler, in particular during erasure when we rewire `new C(x).foo(args)` to `C.foo$extensionN(x)(args)`, we crash. Why? The private method in the value class has been name mangled by `ExplicitOuter`'s use of `makeNotPrivate`, and we no longer appear to have multiple eponymous methods in play. We could try to fix this by changing `extensionNames` to poke around through the scopes of the value class and its companion in a manner insensitive to expanded names. This might look something like: - info.decl(imeth.name) + newOverloadedSymbol(info.decls.filter(sym => unexpandedName(sym) == unexpandedName(imeth.name)) But in fact we never need to expand the name of a private method in an value class, nor its corresponding companion, as: - calls to private value class members end up as calls to public extension methods - extension methods already have a the `$extension[N]` suffix and need no further mangling. This commit: - Resets `PRIVATE` and `LOCAL` when deriving the extension method - Adds a special case to `ExplicitOuter` to imbue the special knowledge that a call to `SomeValueClass#somePrivateMethod` need not `makeNotPrivate`, as erasure will come along later and rewire that to a (public) extension method.
* Refactor Erasure for delambdafication.James Iry2013-11-061-1/+1
| | | | | | | This commit is purely a refactor. It pulls code needed to adapt a tree of one type into a tree of another type (by casting, boxing, coercing, etc) out of Erasure and into common locations that will be usable from the Delambdafy phase.
* Merge pull request #2965 from retronym/ticket/7859Grzegorz Kossakowski2013-10-031-0/+3
|\ | | | | SI-7859 Value classes may wrap a non-public member
| * SI-7859 Value classes may wrap a non-public memberJason Zaugg2013-09-291-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We allow value class constructors to be non-public, so to be regular, we should also allow the same for the param accessor. This commit uses the 'makeNotPrivate' machinery to ensure that the backend can generate the requisite unboxing calls. This commit: - refactors the code that enforced the restrictions, improving a few error messages and positions. The remaining restrictions needed some rewording in light of this change. - allows value classes to have non-public, val parameters. private[this] / protected[this] are still disallowed as value classes don't have a concept of `this`, and because trying to accomdate then would complicate the implementation. This means that `class C(x: Int) extends AnyVal` is not allowed, the user still must write `private val x: Int` or `val x: Int`. - Outlaw `class C()()(val x: Int) extends AnyVal` to curtail any bugs that might lurk in such a formulation. The tests: - Show that the privacy is respected in the typer phase, under joint and separate compilation. We don't want a repeat performance of SI-6601. - Show that code that needs compiler-generated unboxes works under both compilation scenarios - Checks that the remaining restrictions are enforced and well communicated.
* | Removing unused code.Paul Phillips2013-10-021-1/+0
|/ | | | | | | Most of this was revealed via -Xlint with a flag which assumes closed world. I can't see how to check the assumes-closed-world code in without it being an ordeal. I'll leave it in a branch in case anyone wants to finish the long slog to the merge.
* Reducing variation of tree creation methods.Paul Phillips2013-09-131-3/+3
| | | | | | | | | | | | | | | | | | | | | | | TreeDSL has no future - it was always a temporary measure waiting for something like quasiquotes to come along. In this commit I cull as much of it as I can, especially the delicate matter of creating new DefDefs and ValDefs, which I completely turn over to the old style creators. I unified all the symbol-based DefDef and ValDef creators under a single method, since it was yet another place where ctrl-C and ctrl-V were being punched with glee. Was beaten to the punch on adding copyTypeDef to fill out the *Def creators. Eliminated as many redundant positioning calls as I could find. If you are creating a DefTree tree based on a symbol, it will always have an atPos(sym.pos) { ... } wrapped around it. You don't need another one. All of this is motivated by positions work: positions are assigned in so many places and in such an ad hoc fashion that it is impossible to bring consistency to that without first bringing some consistency to tree creation.
* Corrects behavior of finalResultType.Paul Phillips2013-09-131-1/+1
| | | | | | | | | | | | The implementation had come to depend on finalResultType accidentally doing things beyond its charter - in particular, widening types. After hunting down and fixing the call sites depending on the bugs, I was able to rewrite the method to do only what it's supposed to do. I threw in a different way of writing it entirely to suggest how some correctness might be obtained in the future. It's a lot harder for a method written like this to break.
* Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-masterJason Zaugg2013-09-101-1/+6
|\ | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
| * SI-7818 Cast our way out of extended existential angstJason Zaugg2013-09-061-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `substituteSymbols` is not sophisticated enough to operate on `TypeSkolem`-s which are based on one of the "from" symbols. The pertinant usage of `substituteSymbols` for this bug in in `Extender`. Recapping on that transform: // orig class C[T](...) extends AnyVal { def foo[U] = <rhs> } // transform class C[T] extends AnyVal { ... } object C { def foo$extension[T', U'] = <rhs'> } Where `<rhs'>` has been subtituted with, among other things, `[T, U] ~> [T', U']`. In this case our expected type contains a new type parameter (of the extension method), whereas the type of the RHS contains an existential skolem still pinned to the corresponding class type parameter. tree.tpe = Observable1#7037[_$1#12344] <_$1#12344>.info = <: T#7040 pt = Observable1#7037[T#15644] The limitation of substution is lamented in the comments of `adaptMismatchedSkolems`, which faces the harder version of the issue where the skolems are in the expected type. But, we're in the "easy" case with the skolems in the tree's type; we can cast our way out of the problem. See also f335e447 / ed915c54.
| * [backport] SI-6482, lost bounds in extension methods.Jason Zaugg2013-02-021-72/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 5c156185306ba797c0443d9dccae0ae7ce462a1f Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 15:42:50 2012 -0700 A little more housecleaning in ExtensionMethods. The only real contribution is readability. (cherry picked from commit 61f12faacaaccf366f9211ba6493fb042a91f1d2) Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala commit 79f443edf584745d614e24fb9ca6644c6b18d439 Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 14:22:19 2012 -0700 Incorporated pull request feedback. (cherry picked from commit 153ccb4757718cceb219988f30381f73362e6075) commit 707f580b0cdcb01e27ca4c76991dea427945b5bd Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 10:20:45 2012 -0700 Fix for SI-6482, lost bounds in extension methods. That was a good one. How to create a new method with type parameters from multiple sources, herein. (cherry picked from commit ff9f60f420c090b6716c927ab0359b082f2299de) commit 8889c7a13f74bc175e48aa2209549089a974c2af Author: Paul Phillips <paulp@improving.org> Date: Fri Oct 5 22:19:52 2012 -0700 Responded to comment about how many isCoercibles there are. I make the case that there is only one. (cherry picked from commit 883f1ac88dd7cec5882d42d6b48d7f267d1f6e00)
| * Merge pull request #1975 from retronym/ticket/6601-revertJames Iry2013-02-011-0/+1
| |\ | | | | | | Revert "SI-6601 Publicise derived value contstructor after pickler"
| | * Revert "SI-6601 Publicise derived value contstructor after pickler"Jason Zaugg2013-01-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit b07228aebe7aa620af45a681ef60d945ffc65665. The remedy was far worse than the disease: % cat sandbox/test.scala class V private (val a: Any) extends AnyVal % RUNNER=scalac scala-hash b07228aebe sandbox/test.scala [info] b07228aebe => /Users/jason/usr/scala-v2.10.0-256-gb07228a % scala-hash b07228aebe [info] b07228aebe => /Users/jason/usr/scala-v2.10.0-256-gb07228a Welcome to Scala version 2.10.1-20130116-230935-b07228aebe (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27). Type in expressions to have them evaluated. Type :help for more information. scala> def foo(v: V) = v.a == v.a exception when typing v.a().==(v.a())/class scala.reflect.internal.Trees$Apply constructor V in class V cannot be accessed in object $iw in file <console> scala.reflect.internal.Types$TypeError: constructor V in class V cannot be accessed in object $iw
* | | SI-6574 Support @tailrec for extension methods.Jason Zaugg2013-07-101-4/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently, when the body of an extension method is transplanted to the companion object, recursive calls point back to the original instance method. That changes during erasure, but this is too late for tail call analysis/elimination. This commit eagerly updates the recursive calls to point to the extension method in the companion. It also removes the @tailrec annotation from the original method.
* | | Cleaning up after brutal merge of 2.10.x into master.Paul Phillips2013-02-021-73/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | That's the best I can do. The tests pass, if someone wants a cleaner merge it is all theirs. For reference, the merge leading up to this commit was achieved as follows. The lines with -s ours are where the merge commit being merged was completely made up of backports from master. git merge -s ours eff78b852e c1dd8bbaa4 && \ git merge 7026376dcc ccd7abe897 && \ git merge -s ours 62681e191a && \ git merge 74b3e9aefe 7d80e08469 d24f341f08 c4f49759fe \ 27d73a2352 ba72ee7c6f 42c4cc7a1e d672102fd8 644eb7078a && \ git merge -s ours 08596af059 b573c287d2 && \ git merge d1b6d8b20f && \ git merge -s ours 110b54a575 36f78dd606 309ff57ba6 && \ git merge 06295f9682 d3886086c3 adf51eef76 b403234a27 && \ git merge -s ours 09d1433064 && \ git merge 9ddcc1b90e cabf626bbc && \ git merge -s ours 283924bfa5
* | | Merge commit 'ccd7abe897' into wip/fresh-merge2Paul Phillips2013-02-011-82/+86
|\| | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
| * | SI-6651 Substitute `this` in extension method sigsJason Zaugg2013-01-291-7/+30
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows for the likes of: class A[X](val x: X) extends AnyVal { def foo(xy: x.Y) {} } We have to do this in both directions, when synthesizing the extension method in `Extender#transform`, and later on when Erasure tries to find the corresponding extension methods by backing out the original signatures from the signatures of the synthesized methods in the companion. In the first case, we have to be careful to use a stable reference to the `self` parameter, which can satisfy the dependent types.
* | Merge remote-tracking branch 'origin/2.10.x' into pr/merge-2.10Paul Phillips2013-01-251-4/+8
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: SI-6969, mishandling of SoftReferences in method cache. SI-7011 Fix finding constructor type in captured var definitions SI-6987 Tests fsc verbose output SI-6987 Fixes fsc compile server verbose output SI-6231 Report unsupported free var capture by a trait. SI-6666 Restrict hidden `this` access in self/super calls. SI-6902 Check unreachability under @unchecked SI-6976 Fix value class separate compilation crasher. Closes SI-6952: add correct error positions for Dynamic feature check. Conflicts: src/compiler/scala/tools/nsc/CompileServer.scala src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
| * Merge pull request #1910 from retronym/ticket/6976Paul Phillips2013-01-251-4/+8
| |\ | | | | | | SI-6976 Fix value class separate compilation crasher.
| | * SI-6976 Fix value class separate compilation crasher.Jason Zaugg2013-01-161-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't guarantee that the owner of the value class is initialized, and if it isn't, the search for the companion module will turn up bubkis. This is a localized fix, but I'd be suprised if there weren't other places that suffered from the same problem. Wouldn't it be nicer to have something like: // doesn't force info sym.raw.info sym.raw.companionModule // forces info sym.info sym.companionModule
| * | SI-6601 Publicise derived value contstructor after picklerJason Zaugg2013-01-161-1/+0
| |/ | | | | | | | | | | | | Otherwise the access restrictions are not enforced under separate compilation. See also SI-6608.
* | Eliminated some sources of tree sharing.Paul Phillips2012-12-121-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tracking shared trees led to various perpetrators, the simplest of which are addressed herein. More consideration will be required: we need to approach the problem with sufficient command to assure both that trees are only shared when safe (which might without architectural changes be "never") but also that we do not duplicate definition trees unless it is appropriate. Why do we care about tree sharing? Sometimes, a lot of the time even, you can get away with sharing trees - but that's also why it's responsible for all kinds of trouble. If the compiler would break obviously and immediately then we wouldn't be doing it. The danger of sharing is that one piece of an AST may undergo a transformation or mutation and an unrelated piece of the AST will be partially dragged into the change. The danger has become more urgent with the arrival of macros. The first step in preventing tree sharing mishaps is to reduce the amount the compiler does so whatever is left is a lot easier to see. As a happy accident, it will also fix bugs.
* | Remove Name -> TermName implicit.Paul Phillips2012-12-011-1/+1
| | | | | | | | And simplify the name implicits.
| |
| \
*-. | Merge remote-tracking branches 'origin/2.10.x' and 'origin/2.10.0-wip' into ↵Paul Phillips2012-11-141-3/+1
|\ \| | | | | | | | | | | | | | | | | | | master Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
| | * SI-6644 Account for varargs in extmethod forwarderJason Zaugg2012-11-101-3/+1
| |/ | | | | | | | | Which sounded difficult, so instead I offshored the work to the friendly republic of TreeGen.
* | Removed unused imports.Paul Phillips2012-11-061-4/+0
| | | | | | | | | | | | | | | | | | A dizzying number of unused imports, limited to files in src/compiler. I especially like that the unused import option (not quite ready for checkin itself) finds places where feature implicits have been imported which are no longer necessary, e.g. this commit includes half a dozen removals of "import scala.language.implicitConversions".
* | Merge commit 'refs/pull/1574/head' into merge-210Paul Phillips2012-11-051-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'refs/pull/1574/head': (24 commits) Fixing issue where OSGi bundles weren't getting used for distribution. Fixes example in Type.asSeenFrom Fix for SI-6600, regression with ScalaNumber. SI-6562 Fix crash with class nested in @inline method Brings copyrights in Scaladoc footer and manpage up-to-date, from 2011/12 to 2013 Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013 SI-6606 Drops new icons in, replaces abstract types placeholder icons SI-6132 Revisited, cleaned-up, links fixed, spelling errors fixed, rewordings Labeling scala.reflect and scala.reflect.macros experimental in the API docs Typo-fix in scala.concurrent.Future, thanks to @pavelpavlov Remove implementation details from Position (they are still under reflection.internal). It probably needs more cleanup of the api wrt to ranges etc but let's leave it for later SI-6399 Adds API docs for Any and AnyVal Removing actors-migration from main repository so it can live on elsewhere. Fix for SI-6597, implicit case class crasher. SI-6578 Harden against synthetics being added more than once. SI-6556 no assert for surprising ctor result type Removing actors-migration from main repository so it can live on elsewhere. Fixes SI-6500 by making erasure more regular. Modification to SI-6534 patch. Fixes SI-6559 - StringContext not using passed in escape function. ... Conflicts: src/actors-migration/scala/actors/migration/StashingActor.scala src/compiler/scala/tools/nsc/backend/jvm/GenASM.scala src/compiler/scala/tools/nsc/settings/AestheticSettings.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/library/scala/Application.scala src/library/scala/collection/immutable/GenIterable.scala.disabled src/library/scala/collection/immutable/GenMap.scala.disabled src/library/scala/collection/immutable/GenSeq.scala.disabled src/library/scala/collection/immutable/GenSet.scala.disabled src/library/scala/collection/immutable/GenTraversable.scala.disabled src/library/scala/collection/mutable/GenIterable.scala.disabled src/library/scala/collection/mutable/GenMap.scala.disabled src/library/scala/collection/mutable/GenSeq.scala.disabled src/library/scala/collection/mutable/GenSet.scala.disabled src/library/scala/collection/mutable/GenTraversable.scala.disabled src/library/scala/collection/parallel/immutable/ParNumericRange.scala.disabled
| * Brings all copyrights (in comments) up-to-date, from 2011/12 to 2013Heather Miller2012-11-021-1/+1
| |
* | Merge pull request #1468 from paulp/issue/6482Adriaan Moors2012-10-221-65/+117
|\ \ | | | | | | SI-6482 preserve bounds on tparams of value class
| * | A little more housecleaning in ExtensionMethods.Paul Phillips2012-10-061-52/+74
| | | | | | | | | | | | The only real contribution is readability.
| * | Incorporated pull request feedback.Paul Phillips2012-10-061-7/+6
| | |
| * | Fix for SI-6482, lost bounds in extension methods.Paul Phillips2012-10-061-13/+44
| | | | | | | | | | | | | | | That was a good one. How to create a new method with type parameters from multiple sources, herein.
* | | Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2012-10-191-4/+4
|\ \ \ | |/ / |/| / | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: (52 commits) JavaUniverse Moved @contentDiagram in Symbols Adds lots of new documentation for TypeTags, Mirrors, Universes and more runtime.JavaUniverse - put ungrouped members at the top Forgotten annotation in Annotations Diagram tweaking Grouping for reflection and macros fixes a typo scala.reflect.api.Symbols documentation Symbols docs cleanup, mostly moved to guide scala.reflect.api.Position documentation scala.reflect.api.StandardNames documentation scala.reflect.api.Constants documentation removed docs for internal TypeCreator and TreeCreator simplified reflection docs for trees Rearranged some reflection docs, moving things to the guide reflection docs improvements and moves to doc page docs for reflection and macros SI-6509 Correct @template owners SI-6155 Scaladoc @template diagrms ... Conflicts: src/compiler/scala/tools/nsc/doc/model/ModelFactory.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/api/Trees.scala test/scaladoc/run/links.scala
| * SI-6215 Fix compiler crash on private method in value classMartin Odersky2012-10-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes the problem with private defs in value classes by moving the $extension after the name proper rather than before. The previous scheme did not commute with makeNonPrivate: I.e. if -ext-> is "generate extension name" and -mnp-> is "make not private" we did get for method foo in value class Foo: foo -ext-> extension$foo -mnp-> Foo$$extension$foo but foo -mnp-> Foo$$foo -ext-> extension$Foo$$foo With the change both variations give the same name: foo -ext-> foo$extension -mnp-> Foo$$foo$extension but foo -mnp-> Foo$$foo -ext-> Foo$$foo$extension
* | Merge branch '2.10.x'Paul Phillips2012-09-201-2/+5
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 2.10.x: (36 commits) Normalized line endings. New .gitattributes file. Disabled failing build manager tests. New test case for SI-6337 New test case for closing SI-6385 Value classes: eliminated half-boxing Cleanup of OverridingPairs Fixes SI-6260 Use faster download URL now that artifactory is fixed. don't try to create tags w/o scala-reflect.jar some small remaining fixes SI-5943 toolboxes now autoimport Predef and scala Fix for loud test. SI-6363 deploys the updated starr SI-6363 removes scala.reflect.base SI-6392 wraps non-terms before typecheck/eval SI-6394 fixes macros.Context.enclosingClass Error message improvement for SI-6336. Adjustments to scala.concurrent.duration. prepping for the refactoring ... Conflicts: src/actors-migration/scala/actors/Pattern.scala src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/transform/Erasure.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/collection/immutable/Vector.scala test/files/jvm/actmig-PinS_1.scala test/files/jvm/actmig-PinS_2.scala test/files/jvm/actmig-PinS_3.scala test/files/jvm/actmig-public-methods_1.scala
| * Merge pull request #1325 from odersky/ticket/6337Paul Phillips2012-09-201-1/+3
| |\ | | | | | | Fixes SI-6337 by disallowing nested value classes.
| | * Fixed comment.Martin Odersky2012-09-171-0/+1
| | |
| | * Fixes SI-6337 by disallowing nested value classes.Martin Odersky2012-09-171-1/+2
| | | | | | | | | | | | It seems for the moment too hard to allow this, and the functionality to have value classes wrap other value classes does not seem essential.
| * | Value classes: eliminated half-boxingMartin Odersky2012-09-201-1/+2
| |/ | | | | | | | | | | | | We now apply erasure of value classes everywhere. previously, erasure was disabled in the value class itself. This led to irregegularities and bugs. See test run/valueclasses-pavlov.scala for something that led to a ClassCastException before.
* | Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2012-09-041-1/+2
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Eugene Burmako (10) and others # Via Josh Suereth (10) and Paul Phillips (9) * origin/2.10.x: (32 commits) Removing duplication from Duration. Fixed positions in de-aliased special symbols and for automatically added `apply` methods. Fixes SI-6285 - ParIterableLike no longer says sequential foreach. SI-6274 Fix owners when eta-expanding function with byName param Fixes typos in the ScalaDoc of StringContext Allow nested calls to `askForResponse` in the presentation compiler. Made Dynamic extend Any. Fix for SI-6273, repl string interpolation. Formatting cleanup in def typed. Better errors for Any/AnyRef issues. Fix for SI-6263, futile adaptation. Suppressed 'possible cause' mis-warning. Fix for SI-6034, covariant value classes. Fixes SI-6290 by creating real instnaces of language features. SBT build now works with SBT 0.12. Removed previosuly uncommented code, added more diagnosis output to REPL. Made instrumenter more robust by looking at tokens Removed dead code. Two fixes for the worksheet instrumenter Fix SI-6294. ...
| * Fix for SI-6034, covariant value classes.Paul Phillips2012-08-311-1/+2
| | | | | | | | | | | | | | | | My summary in the ticket was incorrect. The problem was that the class type parameters were being cloned for the method and being allowed to keep their variance. I threw in an assertion for anyone attempting to create a method type with variant type parameters, because hey, why should we allow such madness.
* | Merge branch '2.10.x'Adriaan Moors2012-08-141-3/+0
|\| | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/Global.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala test/files/neg/t6048.check
| * Moved inline logic before pickler.Grzegorz Kossakowski2012-08-091-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The test case failed due to separate compilation. The problem was that we don't pickle the fact that the field was made public. Original patch by @odersky. Cleaned up by me. Changes I made: * removed stale test-case * reduced whitespace changes Supersedes #1089. Review by @odersky and @moors.
* | Merge branch '2.10.x'Adriaan Moors2012-08-081-1/+1
|\| | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/ast/TreeGen.scala src/compiler/scala/tools/nsc/settings/AestheticSettings.scala
| * update and normalize copyright noticeAdriaan Moors2012-08-071-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are the regexp replacements performed: Sxcala -> Scala Copyright (\d*) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*)(,?) LAMP/EPFL -> Copyright $1-2012 LAMP/EPFL Copyright (\d*)-(\d*) Scala Solutions and LAMP/EPFL -> Copyright $1-2012 Scala Solutions and LAMP/EPFL \(C\) (\d*)-(\d*) LAMP/EPFL -> (C) $1-2012 LAMP/EPFL Copyright \(c\) (\d*)-(\d*)(.*?)EPFL -> Copyright (c) $1-2012$3EPFL The last one was needed for two HTML-ified copyright notices. Here's the summarized diff: Created using ``` git diff -w | grep ^- | sort | uniq | mate git diff -w | grep ^+ | sort | uniq | mate ``` ``` - <div id="footer">Scala programming documentation. Copyright (c) 2003-2011 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> - copyright.string=Copyright 2002-2011, LAMP/EPFL - <meta name="Copyright" content="(C) 2002-2011 LAMP/EPFL"/> - * Copyright 2002-2011 LAMP/EPFL - * Copyright 2004-2011 LAMP/EPFL - * Copyright 2005 LAMP/EPFL - * Copyright 2005-2011 LAMP/EPFL - * Copyright 2006-2011 LAMP/EPFL - * Copyright 2007 LAMP/EPFL - * Copyright 2007-2011 LAMP/EPFL - * Copyright 2009-2011 Scala Solutions and LAMP/EPFL - * Copyright 2009-2011 Scxala Solutions and LAMP/EPFL - * Copyright 2010-2011 LAMP/EPFL - * Copyright 2012 LAMP/EPFL -# Copyright 2002-2011, LAMP/EPFL -* Copyright 2005-2011 LAMP/EPFL -/* NSC -- new Scala compiler -- Copyright 2007-2011 LAMP/EPFL */ -rem # Copyright 2002-2011, LAMP/EPFL ``` ``` + <div id="footer">Scala programming documentation. Copyright (c) 2003-2012 <a href="http://www.epfl.ch" target="_top">EPFL</a>, with contributions from <a href="http://typesafe.com" target="_top">Typesafe</a>.</div> + copyright.string=Copyright 2002-2012 LAMP/EPFL + <meta name="Copyright" content="(C) 2002-2012 LAMP/EPFL"/> + * Copyright 2002-2012 LAMP/EPFL + * Copyright 2004-2012 LAMP/EPFL + * Copyright 2005-2012 LAMP/EPFL + * Copyright 2006-2012 LAMP/EPFL + * Copyright 2007-2012 LAMP/EPFL + * Copyright 2009-2012 Scala Solutions and LAMP/EPFL + * Copyright 2010-2012 LAMP/EPFL + * Copyright 2011-2012 LAMP/EPFL +# Copyright 2002-2012 LAMP/EPFL +* Copyright 2005-2012 LAMP/EPFL +/* NSC -- new Scala compiler -- Copyright 2007-2012 LAMP/EPFL */ +rem # Copyright 2002-2012 LAMP/EPFL ```
* | Merge remote-tracking branch 'origin/2.10.x' into merge-2.10.xPaul Phillips2012-08-021-0/+9
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: first stab at serialization of exprs and tags deploys a new starr that knows reify is a macro moves Expr from api to base evicts last traces of makro from our codebase reflect.makro => reflect.macros (Step I) removes -Xmacro-(.*)-classpath compiler options prepares our macro defs for refactoring (Step II) prepares our macro defs for refactoring (Step I) more refinements of reflection API SI-5888 Mirrors now have sane toStrings renames asType to toType and asXXXSymbol to asXXX miscellaneous refinements of reflection API navigation between fields and accessors moves most of symbol tests in API to descendants simplifies flag API SI-5732 members and derivatives now return Scope SI-5751 cleans up toolboxes for the release I actually managed to hit the limit of Scala signature annotation not fitting into a single string (high five everyone) and entered the undisovered region of arrEncode in GenASM. arrEncode returns Array[String] so asm.AnnotationWriter is not going to like it. Added more variants to achieve getLinkPos Checkfile update. Fixed maddening "..." lately in printed types. Removed resolveOverloaded SI-5866 Support casting null to value classes ClassTag.Nothing now throws an exception Fixed SI-5031. Only consider classes when looking for companion class. sym.effectiveOwner revealed this piece of inconsistency. companionModule is fine because similar check is there already. Fixed SI-5603. Early definitions now get transparent positions. This includes a fix for a minor problem described in #594 - ensureNonOverlapping still focuses on default position when outside of early defs. Review by @dragos, @odersky. SI-5799 Secondary constructors in value classes not allowed Closes SI-5878 Closes SI-5882 Closed 6029 ... New Worksheet mixing scheme Raw string interpolator Adds method askForResponse Disable interrupts during code instrumentation New Executor. SI-6142: warn @inline-methods ending up not inlined (rightfully or not) Avoids loading scala.package and scala.reflect.package from source if a classfile exists. `ScriptSourceFile` should not hard-code `OffsetPosition`. Fix `Instrumentation.getStatistics` method in partest. Instrument all classes in `instrumented` package. SI-5958 This deserves a stable type SI-6140 Scaladoc infinite recursion in wiki parser SI-4560 - improved test Revert "tentative fix for RC5 lift build problem." Revert "Closes #4560. Review by dragos." (introduction of safeREF) Revert fix part of "Closes 4560. Review by dragos." Fix SI-4560, NoSuchMethodErrors involving self types. SI-2038 make pt fully-defined when typing Typed Conflicts: src/compiler/scala/tools/nsc/interpreter/Imports.scala src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala src/compiler/scala/tools/nsc/interpreter/MemberHandlers.scala