summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* assorted typo fixes, cleanup, updating of commentsSeth Tisue2016-10-2411-36/+36
| | | | | | just in time for Halloween. "boostrap" is definitely the most adorable typo evah -- and one of the most common, too. but we don't want to scare anybody.
* SI-9516 remove now-unneeded codeSeth Tisue2016-10-241-3/+3
| | | | now that STARR includes the relevant fix
* Merge pull request #5466 from dragos/issue/remove-println-SI-8717Lukas Rytz2016-10-211-4/+4
|\ | | | | Replace println with log calls in BrowsingLoaders
| * Replace println with log calls in BrowsingLoadersIulian Dragos2016-10-191-4/+4
| | | | | | | | | | | | | | This alternative symbol loader is used in the presentation compiler and may generate output even when the compiler should be silent. See SI-8717 for more context, even though this does not really fix the ticket.
* | Merge pull request #5451 from lifuhuang/patch-1Lukas Rytz2016-10-211-3/+3
|\ \ | | | | | | Replace deprecated conforms
| * | Replace deprecated conformsLifu Huang2016-10-091-3/+3
| | | | | | | | | Replace deprecated conforms with identity.
* | | Merge pull request #5393 from som-snytt/issue/nowarn-thistype-discardLukas Rytz2016-10-214-21/+11
|\ \ \ | | | | | | | | No warn when discarding r.f(): r.type
| * | | No warn when discarding r.f(): r.typeSom Snytt2016-09-104-21/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The paradigm is `def add(x: X): Unit = listBuffer += x`. The value that is discarded is not new information. Also cleans up the recent tweaks to help messaging. Adds newlines in case they ask for multiple helps.
* | | | Merge pull request #5371 from chrisokasaki/issue/9906Seth Tisue2016-10-201-0/+19
|\ \ \ \ | | | | | | | | | | SI-9906: override ListBuffer.last/lastOption to run in O(1) time
| * | | | SI-9906: override ListBuffer.last/lastOption to run in O(1) timechrisokasaki2016-08-301-0/+19
| | | | | | | | | | | | | | | | | | | | Also update scaladocs for those two methods.
* | | | | Merge pull request #5400 from sjrd/rewrite-traversablelike-stringprefixSeth Tisue2016-10-201-12/+59
|\ \ \ \ \ | | | | | | | | | | | | Rewrite TraversableLike.stringPrefix not to blow up code size in Scala.js.
| * | | | | Rewrite TraversableLike.stringPrefix not to blow up code size in Scala.js.Sébastien Doeraene2016-09-151-12/+59
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The commit 30876fe2dd8cbe657a6cad6b11bbc34f10c29b36 changed `TraversableLike.stringPrefix` to report nicer results for inner classes and method-local classes. The changes included calls to `String.split()`, `Character.isDigit()` and `Character.isUpperCase()`. This was particularly bad for Scala.js, because those methods bring with them huge parts of the JDK (the `java.util.regex.*` implementation on the one hand, and the Unicode database on the other hand), which increased generated code size by 6 KB after minimification and gzip for an application that does not otherwise use those methods. This sudden increase is tracked in the Scala.js bug tracker at https://github.com/scala-js/scala-js/issues/2591. This commit rewrites `TraversableLike.stringPrefix` in a very imperative way, without resorting to those methods. The behavior is (mostly) preserved. There can be different results when `getClass().getName()` contains non-ASCII lowercase letters and/or digits. Those will now be recognized as user-defined instead of likely compiler-synthesized (which is a progression). There still are false positives for ASCII lowercase letters, which cause the `stringPrefix` to be empty (as before). Since the new implementation is imperative anyway, at least I made it not allocate anything but the result `String` in the common case where the result does not contain any `.`.
* | | | | Merge pull request #5439 from som-snytt/issue/fields-fieldwidthSeth Tisue2016-10-201-7/+7
|\ \ \ \ \ | | | | | | | | | | | | Shorten fields phase description
| * | | | | Don't clip descrip when -YdebugSom Snytt2016-09-301-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Ydebug is supposed to show everything about the phases, including full description (if otherwise clipped) and any phases that are not "enabled" by options.
| * | | | | Shorten fields phase descriptionSom Snytt2016-09-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes fields fit the field width, which is fitting. `s/including/add` seems sufficient. Possibly, "synthesize" is an extravagance for "add", but "add" is used previously in that column. Resolve, load, translate, add, synthesize, replace, erase, move, eliminate, remove, generate. Would love to learn a word that says what typer does, if the word "type" is too redundant or overloaded, besides the food metaphor. Also "meat-and-potatoes" implies basic, simple, not fussy or fancy. There are many devices, like the heart or a Ferrari engine, that are fundamental without being unfussy.
* | | | | | Merge pull request #5450 from adriaanm/dev240Seth Tisue2016-10-201-2/+10
|\ \ \ \ \ \ | | | | | | | | | | | | | | Repl prints '\n' as newline, not "^J"
| * | | | | | Repl prints '\n' as newline, not "^J"Adriaan Moors2016-10-081-2/+10
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | Work around a weird bug in JLine. Fix https://github.com/scala/scala-dev/issues/240
* | | | | | Merge pull request #5463 from adriaanm/merge-2.11-to-2.12Seth Tisue2016-10-205-16/+28
|\ \ \ \ \ \ | | | | | | | | | | | | | | Merge 2.11 to 2.12
| * \ \ \ \ \ Merge 2.11.x into 2.12.xAdriaan Moors2016-10-181-5/+13
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix conflict in #5453: ``` - def help: String = { + override def help: String = { ```
| | * \ \ \ \ \ Merge pull request #5453 from som-snytt/issue/9832-2.11Adriaan Moors2016-10-181-5/+13
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-9832 -Xlint:help shows default
| | | * | | | | | SI-9832 -Xlint:help shows defaultSom Snytt2016-10-111-5/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conclude help method with the default list. Extra words are supplied for underscore.
| | * | | | | | | Merge pull request #5345 from milessabin/topic/si-7046-backportAdriaan Moors2016-10-188-12/+76
| | |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | [nomerge] Partial fix for SI-7046
| | | * | | | | | | Partial fix for SI-7046Miles Sabin2016-08-158-12/+76
| | | | | | | | | |
| | * | | | | | | | Merge pull request #5341 from milessabin/topci/si-9760-backportAdriaan Moors2016-10-181-1/+0
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-9760 Fix for higher-kinded GADT refinement
| | | * | | | | | | | SI-9760 Fix for higher-kinded GADT refinementMiles Sabin2016-08-151-1/+0
| | | |/ / / / / / /
| * | | | | | | | | Merge 2.11.x into 2.12.x, including #5239, #5240Adriaan Moors2016-10-182-2/+6
| |\| | | | | | | |
| | * | | | | | | | Merge pull request #5240 from som-snytt/issue/9336-paste-tabAdriaan Moors2016-10-181-2/+5
| | |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-9336 Enable paste detect in jline
| | | * | | | | | | | SI-9336 Enable paste detect in jlineSom Snytt2016-06-211-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When the next char is available immediately after a tab, the tab is taken raw instead of invoking completion.
| | * | | | | | | | | Merge pull request #5239 from martijnhoekstra/doc_capitalizeAdriaan Moors2016-10-181-0/+1
| | |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Doc: capitalize doesn't handle non-BMP characters
| | | * | | | | | | | | doc: capitalize only works on BMP charactersMartijn Hoekstra2016-06-211-0/+1
| | | |/ / / / / / / /
| | * | | | | | | | | Merge pull request #5218 from retronym/ticket/9806Jason Zaugg2016-10-181-2/+2
| | |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | SI-9806 Fix incorrect codegen with optimizer, constants, try/catch
| | | * | | | | | | | | SI-9806 Fix incorrect codegen with optimizer, constants, try/catchJason Zaugg2016-06-071-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constant optimizer phase performs abstract interpretation of the icode representation of the progam in order to eliminate dead code. For each basic block, the possible and impossible states of each local variable is computed for both a normal and an exceptional exit. A bug in this code incorrectly tracked state for exception exits. This appears to have been an oversight: the new state was computed at each instruction, but it was discarded rather than folded through the intepreter.
| | * | | | | | | | | | Avoid tripping cyclic errors under -Ytyper-debugJason Zaugg2016-10-071-1/+1
| | | |_|_|/ / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Manually tested with: ``` % cat sandbox/test.scala package p { object X { def f(i: Int) = ??? ; def f(s: String) = ??? } object Main { val res = X.f(3.14) } } % qscalac -Ytyper-debug sandbox/test.scala |-- p EXPRmode-POLYmode-QUALmode (site: package <root>) | \-> p.type |-- object X BYVALmode-EXPRmode (site: package p) | |-- super EXPRmode-POLYmode-QUALmode (silent: <init> in X) | | |-- this EXPRmode (silent: <init> in X) | | | \-> p.X.type | | \-> p.X.type | |-- def f BYVALmode-EXPRmode (site: object X) | | |-- $qmark$qmark$qmark EXPRmode (site: method f in X) | | | \-> Nothing | | |-- Int TYPEmode (site: value i in X) | | | \-> Int | | |-- Int TYPEmode (site: value i in X) | | | \-> Int | | \-> [def f] (i: Int)Nothing | |-- def f BYVALmode-EXPRmode (site: object X) | | |-- $qmark$qmark$qmark EXPRmode (site: method f in X) | | | \-> Nothing | | |-- String TYPEmode (site: value s in X) | | | [adapt] String is now a TypeTree(String) | | | \-> String | | |-- String TYPEmode (site: value s in X) | | | [adapt] String is now a TypeTree(String) | | | \-> String | | \-> [def f] (s: String)Nothing | \-> [object X] p.X.type |-- object Main BYVALmode-EXPRmode (site: package p) | |-- X.f(3.14) EXPRmode (site: value res in Main) | | |-- X.f BYVALmode-EXPRmode-FUNmode-POLYmode (silent: value res in Main) | | | |-- X EXPRmode-POLYmode-QUALmode (silent: value res in Main) | | | | \-> p.X.type | | | \-> (s: String)Nothing <and> (i: Int)Nothing | | |-- 3.14 BYVALmode-EXPRmode (silent: value res in Main) | | | \-> Double(3.14) | | [search #1] start `<?>`, searching for adaptation to pt=Double => String (silent: value res in Main) implicits disabled | | [search #2] start `<?>`, searching for adaptation to pt=(=> Double) => String (silent: value res in Main) implicits disabled | | [search #3] start `<?>`, searching for adaptation to pt=Double => Int (silent: value res in Main) implicits disabled | | 1 implicits in companion scope | | [search #4] start `<?>`, searching for adaptation to pt=(=> Double) => Int (silent: value res in Main) implicits disabled | | 1 implicits in companion scope | | second try: <error> and 3.14 | | [search #5] start `p.X.type`, searching for adaptation to pt=p.X.type => ?{def f(x$1: ? >: Double(3.14)): ?} (silent: value res in Main) implicits disabled | | [search #6] start `p.X.type`, searching for adaptation to pt=(=> p.X.type) => ?{def f(x$1: ? >: Double(3.14)): ?} (silent: value res in Main) implicits disabled sandbox/test.scala:4: error: overloaded method value f with alternatives: (s: String)Nothing <and> (i: Int)Nothing cannot be applied to (Double) val res = X.f(3.14) ^ ```
| * | | | | | | | | | Merge 2.11.x into 2.12.xAdriaan Moors2016-10-182-9/+9
| |\| | | | | | | | | | | |_|_|_|_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | Including PRs #5199, #5405
| | * | | | | | | | In ProcessBuilder docs, replace .lines w/ .lineStreamPaul Kernfeld2016-09-162-9/+9
| | | |_|/ / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | ProcessBuilder.lines is deprecated
| | * | | | | | | Merge pull request #5236 from som-snytt/issue/triple-backportLukas Rytz2016-07-131-1/+1
| | |\ \ \ \ \ \ \ | | | |_|/ / / / / | | |/| | | | | | [nomerge] Avoid triple-quoting triple quotes
| | | * | | | | | Avoid triple-quoting triple quotesSom Snytt2016-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The boolean test for triples was inadvertently flipped. Adds test for pretty printed multiline strings
* | | | | | | | | Fix typo in GenTraversableLikeBoris Korogvich2016-10-201-1/+1
|/ / / / / / / /
* | | | | | | | Merge remote-tracking branch 'origin/2.12.0' into merge/2.12.0-to-2.12.xJason Zaugg2016-10-1413-109/+146
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | |
| * | | | | | | Detect clash of mixedin val and existing member.Adriaan Moors2016-10-122-14/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before, we looked only at the result type, which was silly. This was originally motivated by a hack to get to the error about conflicting paramaccessors. The error detection for that can now be formulated more directly. Fixes scala/scala-dev#244
| * | | | | | | Merge pull request #5429 from lrytz/sd224Adriaan Moors2016-10-117-18/+41
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Default -Xmixin-force-forwarders to true
| | * | | | | | | Default -Xmixin-force-forwarders to trueLukas Rytz2016-09-302-6/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also eliminates the warning when a mixin forwarder cannot be implemented because the target method is a java-defined default method in an interface that is not a direct parent of the class. The test t5148 is moved to neg, as expected: It was moved to pos when disabling mixin forwarders in 33e7106. Same for the changed error message in t4749.
| | * | | | | | | Explicit SerialVersionUID for all ClassTags / ManifestsLukas Rytz2016-09-304-10/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looking at the class hierarchy around ClassTag and Manifest, the only class that had a serialVersionUID is AnyValManifest, where the hierarchy is something like: trait ClassTag // extends Serializable |- class GenericClassTag |- trait Manifest |- class ClassTypeManifest |- class SingletonTypeManifest |- ... |- abstract class AnyValManifest // has SerialVersionUID |- class DoubleManifest |- ... Note that AnyValManifest is an abstract class, so the SerialVersionUID annotation does not help there. This commit adds explicit SerialVersionUID annotations to (hopefully) all subclasses of ClassTag, to make sure they are stable under compatible changes (such as changing -Xmixin-force-forwarders).
| | * | | | | | | Error message for super calls to indirect java parent interfacesLukas Rytz2016-09-301-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Super calls to indirect java parent interfaces cannot be emitted, an error message is emitted during SuperAccessors. The error message was missing if the super call was non-qualified, resulting in an assertion failure in the backend.
| * | | | | | | | Merge pull request #5442 from adriaanm/t9943Adriaan Moors2016-10-111-2/+2
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-9943 sealed class does not yield SAM type
| | * | | | | | | | SI-9943 final/sealed class does not yield SAM typeAdriaan Moors2016-10-041-2/+2
| | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cannot subclass such a class. (Well, we could subclass a sealed class in the same compilation unit. We ignore this for simplicity.) This is a bit of a sneaky fix for this bug, but our hand is pretty much forced by other constraints, in this intersection of overload resolution involving built-in function types and SAMs, and type inference for higher-order function literals (#5307). Luckily, in this particular issue, the overloading clash seems accidental. The `sealed` `<:<` class is not a SAM type as it cannot be subclassed outside of `Predef`. For simplicity, we don't consider where the SAM conversion occurs and exclude all sealed classes from yielding SAM types. Thanks to Miles for pointing out that `final` was missing in my first iteration of this fix.
| * | | | | | | | Merge pull request #5452 from lrytz/sd242Adriaan Moors2016-10-101-2/+1
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix the interface flag when re-writing a closure call to the body method
| | * | | | | | | | Fix the interface flag when re-writing a closure call to the body methodLukas Rytz2016-10-091-2/+1
| | |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When re-writing a closure invocation to the body method, the `itf` flag of the invocation instruction was incorrect: it needs to be true if the method is defined in an interface (including static methdos), not if the method is invoked through `INVOKEINTERFACE`. JDK 8 doesn't flag this inconsistency and executes the bytecode, but the verifier in JDK 9 throws an `IncompatibleClassChangeError`. Similar fixes went into e619b03.
| * | | | | | | | SI-9946 don't null field in lazy accessors that turn out to be liveJason Zaugg2016-10-074-73/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a non-transient lazy val is the only user of a private field in a class, the field is nulled out at the end of the lazy initializer. This is tested in the existing test `run/lazy-leaks.scala`. The analysis of which fields could be nulled out was recently moved from `mixin` to the new `fields` phase. This introduced a regression as a reference from an inner- or companion-classes had not yet been processed by `explicitouter` to publicise private fields. This commit delays the analysis to mixin (after explicit outer has done its work.) Navigating from `foo$lzycompute()` to `foo()` to `foo` is a little dirty now. I'm not sure whether there is a more robust way to structure things.
| * | | | | | | | SI-9946 make nullification of lazy val dependencies module awareJason Zaugg2016-10-071-1/+1
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If a non-transient lazy val is the only user of a private field in a class, the field is nulled out at the end of the lazy initializer. This is tested in the existing test `run/lazy-leaks.scala`. The analysis of which fields could be nulled out was recently moved from `mixin` to the new `fields` phase. This introduced a regression as a it didn't account for the richer pallete of trees and symbols at that juncture. This commit excludes references to private member modules from collection of private fields, thus avoiding a later compiler crash in the backend due to a nonsense tree trying to null out the module symbol. It might make sense to null out the module var, but I've opted to limit the scope of this analysis to paramaccessors and regular fields.