summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | | Fields phaseAdriaan Moors2016-08-1176-295/+951
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | | | | | | Merge pull request #5260 from szeiger/issue/9068Seth Tisue2016-08-112-3/+5
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-9068 Deprecate scala.collection.mutable.Stack
| * | | | | | | | | SI-9068 Deprecate scala.collection.mutable.StackStefan Zeiger2016-08-102-3/+5
| |/ / / / / / / /
* | | | | | | | | Merge pull request #5272 from som-snytt/issue/8829Adriaan Moors2016-08-1113-24/+24
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-8829 Defaultly scala -feature -deprecation
| * | | | | | | | | SI-8829 Let reporter customize retry messageSom Snytt2016-07-0913-24/+24
| | |_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "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. (!)
* | | | | | | | | Merge pull request #5262 from lrytz/t8786Adriaan Moors2016-08-117-39/+156
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-8786 fix generic signature for @varargs forwarder methods
| * | | | | | | | | SI-8786 fix generic signature for @varargs forwarder methodsLukas Rytz2016-08-117-39/+156
| | |_|_|/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-117-25/+24
|\ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / |/| | | | | | | | SI-7187 deprecate eta-expansion of zero-arg method values
| * | | | | | | | SI-7187 deprecate eta-expansion of zero-arg method valuesAdriaan Moors2016-08-107-25/+24
| | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-091-0/+37
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SD-48 limit the lenght of inlined local variable names
| * | | | | | | | SD-48 limit the lenght of inlined local variable namesLukas Rytz2016-07-201-0/+37
| | |_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | | | | Deprecate values that had to be public in older versions...Simon Ochsenreither2016-08-021-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... so we can make them private later.
* | | | | | | | Reduce deprecations and warningsSimon Ochsenreither2016-08-024-5/+5
| |/ / / / / / |/| | | | | |
* | | | | | | Merge pull request #5301 from retronym/ticket/SD-167Adriaan Moors2016-07-262-0/+9
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SD-167 Fine tuning constructor pattern translation Fixes scala/scala-dev#167
| * | | | | | | SD-167 Fine tuning constructor pattern translationJason Zaugg2016-07-252-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Avoid calling NoSymbol.owner when checking whether we're dealing with a case class constructor pattern or a general extractor. Tested manually with the test case in the ticket, no more output is produced under `-Xdev`. - Be more conservative about the conversion to a case class pattern: rather than looking just at the type of the pattern tree, also look at the tree itself to ensure its safe to elide. This change is analagous to SI-4859, which restricted rewrites of case apply calls to case constructors. I've manually tested that case class patterns are still efficiently translated: ``` object Test { def main(args: Array[String]) { Some(1) match { case Some(x) => } } } ``` ``` % qscalac -Xprint:patmat sandbox/test.scala [[syntax trees at end of patmat]] // test.scala package <empty> { object Test extends scala.AnyRef { def <init>(): Test.type = { Test.super.<init>(); () }; def main(args: Array[String]): Unit = { case <synthetic> val x1: Some[Int] = scala.Some.apply[Int](1); case4(){ if (x1.ne(null)) matchEnd3(()) else case5() }; case5(){ matchEnd3(throw new MatchError(x1)) }; matchEnd3(x: Unit){ x } } } } ```
* | | | | | | | Merge pull request #5279 from retronym/ticket/SD-183Adriaan Moors2016-07-262-12/+28
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SD-183 Make refinement classes ineligible as SAMs
| * | | | | | | | SD-183 Make refinement classes ineligible as SAMsJason Zaugg2016-07-142-12/+28
| | |_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Only non-refinement class types need apply, which is the same restriction that we levy on parent types of a class. ``` scala> class C; class D extends C; type CD = C with D; class E extends CD <console>:11: error: class type required but C with D found class C; class D extends C; type CD = C with D; class E extends CD ^ scala> class C; class D extends C; type DC = D with C; class E extends DC <console>:11: error: class type required but D with C found class C; class D extends C; type DC = D with C; class E extends DC ^ ``` Prior to this change: ``` scala> trait T { def t(a: Any): Any }; trait U; abstract class C extends T defined trait T defined trait U defined class C ```` For indy-based lambdas: ``` scala> val tu: T with U = x => x tu: T with U = $$Lambda$1812/317644782@3c3c4a71 scala> tu: U java.lang.ClassCastException: $$Lambda$1812/317644782 cannot be cast to U ... 30 elided ``` For anon class based lambdas: ``` scala> ((x => x): C with U) <console>:14: error: class type required but C with U found ((x => x): C with U) ^ scala> implicit def anyToCWithU(a: Any): C with U = new C with U { def t(a: Any) = a } warning: there was one feature warning; re-run with -feature for details anyToCWithU: (a: Any)C with U scala> (((x: Any) => x): C with U) // SAM chosen but fails to typecheck the expansion uncurry <console>:17: error: class type required but C with U found (((x: Any) => x): C with U) // SAM chosen but fails to typecheck the expansion uncurry ^ ``` Fixes https://github.com/scala/scala-dev/issues/183 While it is tempting to special case refinement classes with no decls by flattening their parents into the parents of the lambda. But there are some subtle issues at play with lineriazation order, as Martin pointed out when I brought this up before: http://www.scala-lang.org/old/node/6817.html
* | | | | | | | Merge pull request #5267 from lrytz/deprecateRemoteAdriaan Moors2016-07-262-0/+4
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Deprecate @remote
| * | | | | | | | Deprecate scala.remoteLukas Rytz2016-07-202-0/+4
| | |_|_|/ / / / | |/| | | | | |
* | | | | | | | Merge pull request #5300 from milessabin/topic/si-4914Adriaan Moors2016-07-262-0/+27
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|/ / |/| | | | | | | SI-4914 Addition of tests resolves as fixed
| * | | | | | | Added tests for SI-482/SI-4914Miles Sabin2016-07-222-0/+27
| | | | | | | |
* | | | | | | | Merge pull request #5297 from retronym/review/5268Jason Zaugg2016-07-263-4/+3
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Disable stub warning by default.
| * | | | | | | Disable stub warning by default.Oscar Boykin2016-07-223-4/+3
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When we create a class symbols from a classpath elements, references to other classes that are absent from the classpath are represented as references to "stub symbols". This is not a fatal error; for instance if these references are from the signature of a method that isn't called from the program being compiled, we don't need to know anything about them. A subsequent attempt to look at the type of a stub symbols will trigger a compile error. Currently, the creation of a stub symbol incurs a warning. This commit removes that warning on the basis that it isn't something users need to worry about. javac doesn't emit a comparable warning. The warning is still issued under any of `-verbose` / `-Xdev` / `-Ydebug`.
* | | | | | | Merge pull request #5296 from retronym/ticket/SD-186Lukas Rytz2016-07-221-0/+19
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SD-186 Fix positions in trait method bytecode
| * | | | | | | SD-186 Fix positions in trait method bytecodeJason Zaugg2016-07-221-0/+19
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Concrete, non private methods in traits are translated into a static method with an explicit `$this` parameter. After this translation, the references to `$this` (subistuted for `this` in user written code) where being positioned at the position of the method, which makes debugging unpleasant. This commit leaves the `Ident($this)` trees unpositioned. This is analagous to what we do in the body of extension methods, which is the other user of `ThisSubstitutor`. It would be more correct to copy the position of each `This` tree over to the substituted tree. That would let us set a breakpoint on a line that _only_ contained `this`. But in 99% of cases users won't be able to spot the difference, so I've opted for the tried and tested approach here.
* | | | | | | SD-120 Non FunctionN lambdas should not be universally serializableJason Zaugg2016-07-222-1/+48
| |/ / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead, we follow the example set by javac, and predicate serializability of bot anon-class and invokedynamic-based lambdas on whether or not the SAM type extends java.io.Serializable. Fixes https://github.com/scala/scala-dev/issues/120
* | | | | | Upgrade asm to 5.1Lukas Rytz2016-07-202-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constructor of scala.tools.asm.Handle now takes an additional boolean parameter to denote whether the owner is an interface.
* | | | | | Merge pull request #5257 from szeiger/wip/final-tuplesLukas Rytz2016-07-208-17/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7301 Make tuple classes final
| * | | | | | SI-7301 Make tuple classes finalStefan Zeiger2016-07-078-17/+13
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | This includes undoing the special case for `-Xfuture` introduced in https://github.com/scala/scala/pull/2299 and updating tests to take the new errors into account.
* | | | | | Merge pull request #5261 from som-snytt/issue/9827Stefan Zeiger2016-07-191-1/+69
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | SI-9827 MatchIterator advances itself
| * | | | | SI-9827 MatchIterator advances itselfSom Snytt2016-07-181-1/+69
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To avoid caveats about calling `next` (or `hasNext`) before using `MatchData` methods on `MatchIterator`, just do it internally as necessary. Note `MatchIterator` behavior in the docs. Added tests showing what people cried about.
* | | | | Merge pull request #5265 from szeiger/issue/6947Adriaan Moors2016-07-181-3/+3
|\ \ \ \ \ | | | | | | | | | | | | SI-6947 Better type parameter names for Map classes
| * | | | | SI-6947 Better type parameter names for Map classesStefan Zeiger2016-07-071-3/+3
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Type parameter names are currently assigned pretty much alphabetically without any meaning. This change renames all key parameters in Map classes from `A` to `K` and all value parameters from `B` to `V` to make them more meaningful. Derived names are renamed accordingly (e.g. `V1` instead of `B1` for an upper bound on `V`, `W` instead of `C` for a new value type). As a side-effect this solves the documentation problem in SI-6947. Due to using `B` both as a type parameter for `foldLeft[B]` in `GenTraversableOnce[A]` and in `Map[A, B]` which extends `GenTraversableOnce[(A, B)]`, the signature of `Map.foldLeft` was rendered in scaladoc as def foldLeft[B](z: B)(op: (B, (A, B)) ⇒ B): B Now you get an unambiguous version: def foldLeft[B](z: B)(op: (B, (K, V)) ⇒ B): B
* | | | | Merge pull request #5246 from jodersky/javadocAdriaan Moors2016-07-184-2/+53
|\ \ \ \ \ | | | | | | | | | | | | SI-4826 Retain javadoc comments in scaladoc [ci: last-only]
| * | | | | Retain javadoc comments in scaladocJakob Odersky2016-07-154-2/+53
| | |/ / / | |/| | | | | | | | | | | | | | | | | | * Hook into java parser to generate doc comments * Generate empty trees for java implementation bodies
* | | | | Merge pull request #5285 from szeiger/wip/sbt-bootstrapAdriaan Moors2016-07-182-3/+10
|\ \ \ \ \ | | | | | | | | | | | | Switch the bootstrap build over to sbt
| * | | | | Switch the bootstrap build over to sbtStefan Zeiger2016-07-152-3/+10
| | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All of the individual ant builds that occured during `bootstrap` are replaced by equivalent sbt builds. - Allow extra dashes in version suffix when using SPLIT - Clean up ScriptCommands - Building an extra `locker` for stability testing with ant was not necessary but sbt also drops `strap`, so we need to build again with `quick` to get the equivalent of `strap`. The script for checking stability is invoked directly from the bootstrap script, not from sbt. - `STARR` and `locker` build output is still logged to `logs/builds`, the main build runs log directly to the main console with colored output. - Allow `—show-log` option on partest command line in sbt - Normalize inferred LUB in `run/t7747-repl.scala` - Add `normalize` feature from `ReplTest` to `InteractiveTest` - Normalize inferred LUBs in `presentation/callcc-interpreter`
* | | | | Merge pull request #5273 from retronym/ticket/9855Adriaan Moors2016-07-183-3/+29
|\ \ \ \ \ | | | | | | | | | | | | SI-9855 Fix regression in extractor pattern translation
| * | | | | SI-9855 Fix regression in extractor pattern translationJason Zaugg2016-07-143-3/+29
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In faa5ae6, I changed the pattern matchers code generator to use stable references (`Ident`-s with the singleton type, rather than the widened type) to the synthetic vals used to store intermediate results ("binders"). In the case where the scrutinee matched the unapply parameter type of some extractor pattern, but the pattern subsequently failed, this led to an regression. It turns out that this was due to the way that the type of the binder was mutated to upcast to the exact type of a subsequent pattern in `ensureConformsTo`: https://github.com/scala/scala/blob/953559988/src/compiler/scala/tools/nsc/transform/patmat/MatchTranslation.scala#L165-L174 This was added in 32c57329a as a workaround for the problem caused in t6664.scala, when the binder type was `KList with KCons`, and the code generator wasn't able to find the case field accessors for `KCons` in the decls. The change to use stable references meant that this mutation was now observed in another part of the tree, as opposed to the 2.11.8 situation, where we had used the original, sharper type of the binder eagerly to assign to the `Ident` that referred to it. This led to a tree: Assign(Ident(x3), Ident(x1).setType(x1.tpe) Now that we instead refer generate: Assign(Ident(x3), Ident(x1).setType(stableTypeFor(x1)) and we don't typecheck this until after the mutation of `x1.symbol.info`, we can get a type error. This commit removes this mutation of the binder type altogether, and instead uses `aligner.wholeType`, which is based on the result type of the `Apply(TypeTree(MethodType(params, resultType))` that encodes a typechecked constructor pattern. In `t6624.scala`, this is `KCons`, the case class that has the extractors as its decls.
* | | | | Merge pull request #5275 from dwijnand/somexStefan Zeiger2016-07-182-6/+6
|\ \ \ \ \ | | | | | | | | | | | | Deprecated and rename Some#x to Some#value
| * | | | | Deprecated and rename Some#x to Some#valueDale Wijnand2016-07-152-6/+6
| | |/ / / | |/| | |
* / | | | SI-9691 BufferedIterator should expose a headOptionChristopher Davenport2016-07-151-0/+28
|/ / / / | | | | | | | | | | | | This exposes a new API to the BufferedIterator trait. It will return the next element of an iterator as an Option. The return will be Some(value) if there is a next value, and None if there is not a next element.
* | | | Merge pull request #5264 from lrytz/t8561Lukas Rytz2016-07-131-22/+15
|\ \ \ \ | | | | | | | | | | SI-8561 named subclasses for known Manifest / ClassTag instances
| * | | | SI-8561 named subclasses for known Manifest / ClassTag instancesLukas Rytz2016-07-061-22/+15
| | |/ / | |/| | | | | | | | | | | | | | | | | | This helps keeping ClassTag serialization stable under accidental changes (like changing the order of definitions, which would change the name of the anonymous classes).
* | | | Merge pull request #5234 from som-snytt/review/printersLukas Rytz2016-07-133-5/+20
|\ \ \ \ | | | | | | | | | | Avoid triple-quoting triple quotes in printer
| * | | | Constant print control in unicodeSom Snytt2016-06-163-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Since octal escape is deprecated, use unicode escape for string representation of constants.
| * | | | Refactor triple quote quotingSom Snytt2016-06-161-4/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To quote a triple quote, only quote one quote. Refactors the code for legibility. Adds test for other inline cruft like control chars.
| * | | | Avoid triple-quoting triple quotesSom Snytt2016-06-161-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The boolean test for triples was inadvertently flipped. Adds test for pretty printed multiline strings
* | | | | Merge pull request #5269 from lrytz/t9849Lukas Rytz2016-07-132-0/+23
|\ \ \ \ \ | | | | | | | | | | | | SI-9849 set privateWithin on default getters
| * | | | | SI-9849 set privateWithin on default gettersLukas Rytz2016-07-122-0/+23
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A default getter get the same access flag (private / protected) as the method whose default it implements. However, we forgot to set the privateWithin flag, which defines the scope in a qualified private / protected modifier. For a private[p], the default getter was therefore public, which is less restricted (a private[p] method has privateWithin set to p, but the private flag is not set). For a protected[p], the default getter was protected, which is more restricted.