summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5323 from szeiger/issue/7838-2Seth Tisue2016-08-123-0/+15
|\ | | | | SI-7838 Document the multi-threading semantics of List and Vector
| * SI-7838 Document the multi-threading semantics of List and VectorStefan Zeiger2016-08-123-0/+15
| | | | | | | | Making them completely thread-safe would be too expensive (in terms of performance of single-threaded use cases).
* | Merge pull request #5306 from szeiger/issue/8576Stefan Zeiger2016-08-122-1/+2
|\ \ | | | | | | SI-8576 Minimal changes for `-Xcheckinit` compatibility
| * | SI-8576 Minimal changes for `-Xcheckinit` compatibilityStefan Zeiger2016-08-122-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As explained in https://issues.scala-lang.org/browse/SI-8576, I expect serialization compatibility between builds with and without `-Xcheckinit` to be unattainable. This commit contains some minor fixes for issues discovered while running builds with `-Xcheckinit`: - Add `@SerialVersionUID` to `scala.collection.immutable.Vector`, as requested in SI-8576. Note that this does not make `Vector` serialization compatible. - Use lazy initialization for `global` in `PresentationCompilation`. It used to access the uninitialized `self` variable (which seems to be inconsequential in practice and only fails under `-Xcheckinit`). We should consider using `Externalizable` instead of `Serializable` for collections in 2.13 to make collection classes serialization compatible.
* | | Merge pull request #5312 from szeiger/issue/8434-2Stefan Zeiger2016-08-122-1/+189
|\ \ \ | | | | | | | | SI-8434 Make generic Set operations build the same kind of Set
| * | | SI-8434 Make generic Set operations build the same kind of SetStefan Zeiger2016-08-122-1/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When building from a `Set` implementation that was statically seen as a `collection.GenSet` or `collection.Set`, we used to build a default `Set` implementation determined by `GenSetFactory.setCanBuildFrom`. This change modifies `setCanBuildFrom` to determine the correct implementation at runtime by asking the source `Set`’s companion object for the `Builder`. Tests are in `NewBuilderTest.mapPreservesCollectionType`, including lots of disabled tests for which I believe there is no solution under the current collection library design. `Map` suffers from the same problem as `Set`. This *can* be fixed in the same way as for `Set` with some non-trivial changes (see the note in `NewBuilderTest`), so it is probably best left for Scala 2.13.
* | | | Merge pull request #5258 from szeiger/issue/9019Stefan Zeiger2016-08-123-13/+55
|\ \ \ \ | | | | | | | | | | SI-9019 TraversableLike stringPrefix broken for inner classes
| * | | | SI-9019 TraversableLike stringPrefix broken for inner classesRex Kerr2016-08-123-13/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This version preserves outer class and object names but discards any part of the name after a `$` that does not start with an upper-case letter. When an integer literal occurs after a `$`, the prefix up to that point is dropped so that classes defined within methods appear as top-level.
* | | | | Merge pull request #5259 from szeiger/issue/6881Stefan Zeiger2016-08-122-0/+33
|\ \ \ \ \ | | | | | | | | | | | | SI-6881 Detect reference equality when comparing streams
| * | | | | SI-6881 Detect reference equality when comparing streamsStefan Zeiger2016-07-072-0/+33
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `==` already covers this case. We override `equals` in `Stream` to do the same when `equals` is called directly. This takes care of identical streams. To support short-circuiting equality checks on elements prepended to identical streams we also override `sameElements` in `Cons` to treat the case where both sides are `Cons` separately. Tests in StreamTest.test_reference_equality.
* | | | | Merge pull request #5231 from gourlaysama/ticket/t9585-scaladoc-wrong-implicitsStefan Zeiger2016-08-123-0/+45
|\ \ \ \ \ | | | | | | | | | | | | SI-9585 hide auto-implicit conversions from scaladoc
| * | | | | SI-9585 hide auto-implicit conversions from scaladocAntoine Gourlay2016-06-063-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This hides implicits conversions (and potential members obtained through it) that converts a type into itself, because these conversions are usually non-sensical. They are not completely removed, just placed behind `-doc-implicits-show-all`, like other implicits deemed probably useless. --- Consider the scaladoc for the following class: ``` object Box { implicit def anyToBox[T](t: T): Box[T] = new Box(t) } class Box[T](val t: T) ``` When looking for implicits members to add to class `Box`, it finds the implicit conversion `anyToBox`, and applies it to itself to have an implicit conversion to Box[Box[T]], which brings a useless implicit member `t: Box[T]`. This commit makes scaladoc ignore any conversion from a type to itself (even if type parameters differ) by default. Using the (very useful) `tools/scaladoc-diff` script, I found that this change removes the following conversion from the library doc: ``` Ensuring[A] to Ensuring[Ensuring[A]] anytostringadd[A] to any2stringadd[anytostringadd[A]] ArrowAssoc[A] to ArrowAssoc[ArrowAssoc[A]] =:=[From,To] to =:=[From,To] SearchImpl[A,Repr] to SearchImpl[A,SearchImpl[A,Repr]] CollectionsHaveToParArray[C, T] to CollectionsHaveToParArray[CollectionsHaveToParArray[C, T], T] Ordered[A] to Ordered[Ordered[A]] StringFormat[A] to StringFormat[StringFormat[A]] ```
* | | | | | Merge pull request #5252 from adriaanm/t8339Stefan Zeiger2016-08-126-56/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8339 remove deprecated rewrite of withFilter -> filter
| * | | | | | SI-8339 drop deprecated fallback `withFilter` -> `filter`Adriaan Moors2016-08-116-56/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | You must implement the `withFilter` method to use `if`-guards in a `for`-comprehension. (Drop pos/t7239.scala because it relied on this rewrite.)
* | | | | | | Merge pull request #5141 from adriaanm/fieldsAdriaan Moors2016-08-11137-1806/+2942
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Introducing: the fields phase [ci: last-only]
| * | | | | | | Review feedback from Jason & LukasAdriaan Moors2016-08-113-9/+13
| | | | | | | |
| * | | | | | | Make fewer trait methods not-{private, protected}Adriaan Moors2016-08-113-18/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No longer making trait methods not-protected. (The backend only does public/private because of the poor mapping between visibility from Scala to the JVM). Note that protected trait members will not receive static forwarders in module classes (when mixed into objects). Historic note: we used to `makeNotPrivate` during explicitouter, now we do it later, which means more private methods must be excluded (e.g., lambdaLIFTED ones).
| * | | | | | | Drive accessor synthesis from info transformerAdriaan Moors2016-08-1111-465/+358
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Derive/filter/propagate annotations in info transformer, don't rely on having type checked the derived trees in order to see the annotations. Use synthetics mechanism for bean accessors -- the others will soon follow. Propagate inferred tpt from valdef to accessors by setting type in right spot of synthetic tree during the info completer. No need to add trees in derivedTrees, and get rid of some overfactoring in method synthesis, now that we have joined symbol and tree creation. Preserve symbol order because tests are sensitive to it. Drop warning on potentially discarded annotations, I don't think this warrants a warning. Motivated by breaking the scala-js compiler, which relied on annotations appearing when trees are type checked. Now that ordering constraint is gone in the new encoding, we may as well finally fix annotation assignment.
| * | | | | | | Admit @volatile on accessor in traitAdriaan Moors2016-08-112-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There's no other place to squirrel away the annotation until we create a field in a subclass. The test documents the idea, but does not capture the regression seen in the wild, as explained in a comment.
| * | | | | | | Mixed in getter needs NullaryMethodType tooAdriaan Moors2016-08-111-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Clone at uncurry to preserve it in its info history. Discovered by the scala-js test suite.
| * | | | | | | Allow 'overriding' deferred varAdriaan Moors2016-08-114-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Discovered by scala-js's test suite.
| * | | | | | | Align double definition check with specAdriaan Moors2016-08-111-20/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove weird special cases for private-local fields and parameter accessor (fields). One change with the new trait val encoding: ``` scala> trait T { private[this] var x: String = "1" ; def x(): Int = 1 } <console>:11: error: method x is defined twice; the conflicting variable x was defined at line 11:37 trait T { private[this] var x: String = "1" ; def x(): Int = 1 } ^ ``` Whereas: ``` scala> class T { private[this] var x: String = "1" ; def x(): Int = 1 } defined class T ``` Before, both the `class` and `trait` definition were accepted. (Because there is no accessor for a private[this] val/var, and a MethodType does not match the type of a value.) (Dotty accepts neither the class or the trait definition.)
| * | | | | | | LambdaLift emits paramaccessor syms and defdefsAdriaan Moors2016-08-115-69/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... instead of emitting ValDefs and field symbols, which are then promptly unlinked and transformed by the "late trait methods" logic in mixins... Mixins still synthesizes implementations for these accessors in subclasses. A paramaccessor in a trait is a method without an underlying field.
| * | | | | | | Simplify erasure + mixinAdriaan Moors2016-08-1110-268/+177
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove some old, obsolete & untested hacks from ExplicitOuter. Added a test for one of them to show this is now fine. There are a lot of `makeNotPrivate` invocations sprinkled around the codebase. Lets see if we can centralize the ones dealing with trait methods that need implementations in the phase that emits them. For example Fields (accessors for fields/modules) or SuperAccessors.
| * | | | | | | Reduce flag fiddlingAdriaan Moors2016-08-1111-79/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There isn't much point to the late* flags in a world where we're mutating flags left and right in tree and info transformers... So, lets get rid of the indirection until we can include flags in a symbol's type history, like we do for its info. This retires lateDEFERRED (redundant with SYNTHESIZE_IMPL_IN_SUBCLASS). Since it's introduced so late, it makes little sense to have these synthetic members go back to DEFERRED. Instead, just set DEFERRED directly. Also remove unused late* and not* flags. notPRIVATE subsumes lateFINAL for effective finality (scala/scala-dev#126)
| * | | | | | | Address lrytz's review feedbackAdriaan Moors2016-08-113-13/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove obsolete hack for BeanSetter's RHS Use currentOwner.isClass instead of exprOwner.isLocalDummy Refactor: shortest branches first in if/else Fix comments from when the prototype ran before refchecks Also, store `isScala212` as a `val` in `Namer` since the `def` on `settings` parses the version each time...
| * | | | | | | Uncurry's info transform: non-static module --> methodAdriaan Moors2016-08-1111-54/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We do this during uncurry so we can insert the necessary applications to the empty argument list. Fields is too late. Refchecks is no longer an info transform.
| * | | | | | | Don't cache `MethodSymbol`'s `memberType`.Adriaan Moors2016-08-113-38/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Correct caching is impossible because `sym.tpeHK.asSeenFrom(pre, sym.owner)` may have different results even for reference-identical `sym.tpeHK` and `pre` (even in the same period). For example, `pre` could be a `ThisType`. For such a type, `tpThen eq tpNow` does not imply `tpThen` and `tpNow` mean the same thing, because `tpThen.typeSymbol.info` could have been different from what it is now, and the cache won't know simply by looking at `pre`. Somehow this distinction never caused trouble, but when starting to desugar module definitions during the fields phase, it causes several test failures. I tried keying the cache on the current period to no avail.
| * | | | | | | Fields phase synthesizes modulesAdriaan Moors2016-08-117-188/+221
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For now, keep the info transform in refchecks. Ultimately, refchecks should only check, not transform trees/infos. Fixes https://github.com/scala/scala-dev/issues/126: the accessor for a module in a trait is correctly marked non-final (it's deferred).
| * | | | | | | Test EnclosingMethod attribute for classes in lazy valsLukas Rytz2016-08-112-1/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Local and anonymous classes need to have an EnclosingMethod attribute denoting the enclosing class and method. In fact, the enclosing class must always be defined for local and anonymous classes, but the enclosing method may be null (for local / anonymous classes defined in field initializers or local blocks within a class body). The new test here ensures that classes declared within a lazy val initializer block indeed have the enclosing method set to null.
| * | | | | | | Fields phaseAdriaan Moors2016-08-11103-794/+2064
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One step towards teasing apart the mixin phase, making each phase that adds members to traits responsible for mixing in those members into subclasses of said traits. Another design tenet is to not emit symbols or trees only to later remove them. Therefore, we model a val in a trait as its accessor. The underlying field is an implementation detail. It must be mixed into subclasses, but has no business in a trait (an interface). Also trying to reduce tree creation by changing less in subtrees during tree transforms. A lot of nice fixes fall out from this rework: - Correct bridges and more precise generic signatures for mixed in accessors, since they are now created before erasure. - Correct enclosing method attribute for classes nested in trait fields. Trait fields are now created as MethodSymbol (no longer TermSymbol). This symbol shows up in the `originalOwner` chain of a class declared within the field initializer. This promoted the field getter to being the enclosing method of the nested class, which it is not (the EnclosingMethod attribute is a source-level property). - Signature inference is now more similar between vals and defs - No more field for constant-typed vals, or mixed in accessors for subclasses. A constant val can be fully implemented in a trait. TODO: - give same treatment to trait lazy vals (only accessors, no fields) - remove support for presuper vals in traits (they don't have the right init semantics in traits anyway) - lambdalift should emit accessors for captured vals in traits, not a field Assorted notes from the full git history before squashing below. Unit-typed vals: don't suppress field it affects the memory model -- even a write of unit to a field is relevant... unit-typed lazy vals should never receive a field this need was unmasked by test/files/run/t7843-jsr223-service.scala, which no longer printed the output expected from the `0 to 10 foreach` Use getter.referenced to track traitsetter reify's toolbox compiler changes the name of the trait that owns the accessor between fields and constructors (`$` suffix), so that the trait setter cannot be found when doing mkAssign in constructors this could be solved by creating the mkAssign tree immediately during fields anyway, first experiment: use `referenced` now that fields runs closer to the constructors phase (I tried this before and something broke) Infer result type for `val`s, like we do for `def`s The lack of result type inference caused pos/t6780 to fail in the new field encoding for traits, as there is no separate accessor, and method synthesis computes the type signature based on the ValDef tree. This caused a cyclic error in implicit search, because now the implicit val's result type was not inferred from the super member, and inferring it from the RHS would cause implicit search to consider the member in question, so that a cycle is detected and type checking fails... Regardless of the new encoding, we should consistently infer result types for `def`s and `val`s. Removed test/files/run/t4287inferredMethodTypes.scala and test/files/presentation/t4287c, since they were relying on inferring argument types from "overridden" constructors in a test for range positions of default arguments. Constructors don't override, so that was a mis-feature of -Yinfer-argument-types. Had to slightly refactor test/files/presentation/doc, as it was relying on scalac inferring a big intersection type to approximate the anonymous class that's instantiated for `override lazy val analyzer`. Now that we infer `Global` as the expected type based on the overridden val, we make `getComment` private in navigating between good old Skylla and Charybdis. I'm not sure why we need this restriction for anonymous classes though; only structural calls are restricted in the way that we're trying to avoid. The old behavior is maintained nder -Xsource:2.11. Tests: - test/files/{pos,neg}/val_infer.scala - test/files/neg/val_sig_infer_match.scala - test/files/neg/val_sig_infer_struct.scala need NMT when inferring sig for accessor Q: why are we calling valDefSig and not methodSig? A: traits use defs for vals, but still use valDefSig... keep accessor and field info in synch
| * | | | | | | Do not add `@TraitSetter` -- not sure what it's forAdriaan Moors2016-08-094-5/+2
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | Also deprecate the TraitSetter annotation.
* | | | | | | Merge pull request #5260 from szeiger/issue/9068Seth Tisue2016-08-113-3/+6
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-9068 Deprecate scala.collection.mutable.Stack
| * | | | | | | SI-9068 Deprecate scala.collection.mutable.StackStefan Zeiger2016-08-103-3/+6
| |/ / / / / /
* | | | | | | Merge pull request #5329 from adriaanm/doc-version-was-too-long-begoneAdriaan Moors2016-08-112-13/+10
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Remove doc-version was too long warning
| * | | | | | | Remove doc-version was too long warningAdriaan Moors2016-08-112-13/+10
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | It would trigger 3091 times per test run. Use CSS to handle overflow instead.
* | | | | | | Merge pull request #5272 from som-snytt/issue/8829Adriaan Moors2016-08-1117-29/+46
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8829 Defaultly scala -feature -deprecation
| * | | | | | | SI-8829 Let reporter customize retry messageSom Snytt2016-07-0916-29/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "Re-run with -deprecation" is not always appropriate. REPL gets to customize the message. The API includes the setting and its name, because reflect Settings do not have names. (!)
| * | | | | | | SI-8829 Defaultly scala -feature -deprecationSom Snytt2016-07-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Turn on `-feature -deprecation` in REPL if neither option is selected. ``` $ ./build/pack/bin/scala Welcome to Scala 2.12.0-20160707-105953-4e564ef (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_92). Type in expressions for evaluation. Or try :help. scala> @deprecated("","") def f = 42 f: Int scala> f toDouble <console>:13: warning: postfix operator toDouble should be enabled by making the implicit value scala.language.postfixOps visible. This can be achieved by adding the import clause 'import scala.language.postfixOps' or by setting the compiler option -language:postfixOps. See the Scaladoc for value scala.language.postfixOps for a discussion why the feature should be explicitly enabled. f toDouble ^ <console>:13: warning: method f is deprecated: f toDouble ^ res1: Double = 42.0 scala> :quit $ scala Welcome to Scala 2.11.8 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_92). Type in expressions for evaluation. Or try :help. scala> @deprecated("","") def f = 42 f: Int scala> f toDouble warning: there was one deprecation warning; re-run with -deprecation for details warning: there was one feature warning; re-run with -feature for details res1: Double = 42.0 ```
* | | | | | | | Merge pull request #5262 from lrytz/t8786Adriaan Moors2016-08-1110-92/+237
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-8786 fix generic signature for @varargs forwarder methods
| * | | | | | | | SI-8786 fix generic signature for @varargs forwarder methodsLukas Rytz2016-08-1110-92/+237
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating a varargs forwarder for def foo[T](a: T*) the parameter type of the forwarder needs to be Array[Object]. If we gnerate Array[T] in UnCurry, that would be erased to plain Object, and the method would not be a valid varargs. Unfortunately, setting the parameter type to Array[Object] lead to an invalid generic signature - the generic signature should reflect the real signature. This change adds an attachment to the parameter symbol in the varargs forwarder method and special-cases signature generation. Also cleanes up the code to produce the varargs forwarder. For example, type parameter and parameter symbols in the forwarder's method type were not clones, but the same symbols from the original method were re-used.
* | | | | | | | Merge pull request #5327 from lrytz/2.12.xLukas Rytz2016-08-118-42/+54
|\ \ \ \ \ \ \ \ | |_|_|/ / / / / |/| | | | | | | SI-7187 deprecate eta-expansion of zero-arg method values
| * | | | | | | SI-7187 deprecate eta-expansion of zero-arg method valuesAdriaan Moors2016-08-108-42/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For backwards compatiblity with 2.11, we already don't adapt a zero-arg method value to a SAM. In 2.13, we won't do any eta-expansion for zero-arg method values, but we should deprecate first.
* | | | | | | | Merge pull request #5290 from lrytz/sd48Stefan Zeiger2016-08-094-10/+68
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SD-48 limit the lenght of inlined local variable names
| * | | | | | | | SD-48 limit the lenght of inlined local variable namesLukas Rytz2016-07-204-10/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When inlining local variables, the names are prefixed with the callee method name. In long chains of inlining, these names can grow indefinitely. This commits introduces a limit.
* | | | | | | | | Merge pull request #5318 from m0xb/2.12.xLukas Rytz2016-08-091-2/+2
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Typo fix in scala.sys.process.ProcessBuilder.
| * | | | | | | | | Typo fix in scala.sys.process.ProcessBuilder.Steven Mitchell2016-08-021-2/+2
| | |_|_|_|_|_|_|/ | |/| | | | | | |
* | | | | | | | | Merge pull request #5315 from retronym/topic/raceLukas Rytz2016-08-091-7/+9
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix race condition in lambda deserialization
| * | | | | | | | | Fix race condition in lambda deserializationJason Zaugg2016-07-311-7/+9
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Review of the code made me aware that concurrent calls to `$deserializeLambda$` for some lambda hosting class could result in concurrent calls to operations on `j.u.HashMap`. I've added a synchronized block to avoid this problem. I don't think this is likely to be a bottleneck in practical use cases, but if so we could come up with a lock-free scheme in the future.
* | | | | | | | | Merge pull request #5302 from soc/topic/deprecation-fixes-2.12Lukas Rytz2016-08-0922-52/+86
|\ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / |/| | | | | | | | Reduce deprecations and warnings