summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Fix non-exhaustive match in macro code parsingJason Zaugg2016-01-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | Before: ``` ⚡ qscala -deprecation Welcome to Scala 2.12.0-20160126-000825-1e302b76aa (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_66). Type in expressions for evaluation. Or try :help. scala> import reflect.macros.blackbox.Context; import language.experimental.macros import reflect.macros.blackbox.Context import language.experimental.macros scala> def impl(c: Context) = {println(c.universe.showRaw(c.parse("val then = 0"))); c.literalUnit}; def m: Unit = macro impl; <console>:13: warning: method literalUnit in trait ExprUtils is deprecated: Use quasiquotes instead def impl(c: Context) = {println(c.universe.showRaw(c.parse("val then = 0"))); c.literalUnit}; def m: Unit = macro impl; ^ impl: (c: scala.reflect.macros.blackbox.Context)c.Expr[Unit] defined term macro m: Unit scala> m <console>:16: error: exception during macro expansion: scala.MatchError: pos: source-<macro>,line-1,offset=4 then is now a reserved word; usage as an identifier is deprecated WARNING (of class scala.tools.nsc.reporters.StoreReporter$Info) at scala.reflect.macros.contexts.Parsers$class.scala$reflect$macros$contexts$Parsers$class$$$anonfun$1(Parsers.scala:17) ```
* SI-9398 Treat case classes as one-element ADTs for analysisJason Zaugg2016-01-291-0/+2
| | | | | | | | Currently, exhaustivity analysis only runs for scrutinees with a sealed type. This commit treats any case class as a one-element, sealed type to enable additional analysis, such as in the new test case.
* SI-9630 Fix spurious warning related to same-named case accessorsJason Zaugg2016-01-292-7/+11
| | | | | | | | | | | | | Hash consing of trees within pattern match analysis was broken, and considered `x1.foo#1` to be the same tree as `x1.foo#2`, even though the two `foo`-s referred to different symbols. The hash consing was based on `Tree#correspondsStructure`, but the predicate in that function cannot veto correspondance, it can only supplement the default structural comparison. I've instead created a custom tree comparison method for use in the pattern matcher that handles the tree shapes that we use.
* Merge pull request #4735 from soc/SI-9437Lukas Rytz2016-01-264-6/+33
|\ | | | | SI-9437 Emit and support parameter names in class files
| * SI-9437 Emit and support parameter names in class filesSimon Ochsenreither2016-01-254-6/+33
| | | | | | | | | | | | | | | | JEP 118 added a MethodParameters attribute to the class file spec which holds the parameter names of methods when compiling Java code with `javac -parameters`. We emit parameter names by default now.
* | -YoptTrace takes a package/Class.method parameterLukas Rytz2016-01-252-2/+3
| |
* | Merge remote-tracking branch 'upstream/2.12.x' into opt/elimBoxesLukas Rytz2016-01-24402-23823/+3880
|\ \
| * | Add partial appearance update of inheritence graphs in scaladocFelix Mulder2016-01-2314-5628/+89
| |/ | | | | | | | | | | | | | | This commit updates color and shape of the inheritence graphs. Also adds a dropshadow on hover instead of opacity change. Graphviz broke upon trying to include svg buttons instead of png. Looking for a solution.
| * SD-70 Don't share footnotes across multiple calls to universe.showRawLukas Rytz2016-01-192-26/+24
| | | | | | | | | | | | | | | | | | Before this commit, multiple invocations of universe.showRaw used a shared weak map that caches footnotes. If the two printed objects have equal components printed as footnotes, e.g., an equal TypeRef, the result of the second invocation depends on whether the object has been collected (and removed from the weak map) or not. See https://github.com/scala/scala-dev/issues/70#issuecomment-171701671
| * Merge pull request #4870 from ruippeixotog/issue/9507Jason Zaugg2016-01-191-3/+4
| |\ | | | | | | SI-9507 Make ArrayStack an IndexedSeqOptimized
| | * SI-9507 Make ArrayStack an IndexedSeqOptimizedRui Gonçalves2015-11-271-3/+4
| | | | | | | | | | | | Just like `ArraySeq`, `ArrayBuffer` and all other collections that use an array as underlying data structure, `ArrayStack` should also be an instance of `IndexedSeq` and `IndexedSeqOptimized`. As expected by both of the traits, `ArrayStack` has constant-time random element access and length computation.
| * | Merge pull request #4903 from som-snytt/issue/9622Jason Zaugg2016-01-181-9/+10
| |\ \ | | | | | | | | SI-9622 Native method may be private
| | * | SI-9622 Native method may be privateSom Snytt2016-01-131-9/+10
| | | | | | | | | | | | | | | | | | | | | | | | This was lost in a refactor. https://github.com/scala/scala/commit/290f687fb6ab91b6aef62d871036ddc3829f12b4
| * | | SI-8700 Exhaustiveness warning for enums from Java sourceSimon Ochsenreither2016-01-144-13/+10
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Until now, the warning was only emitted for enums from Java class files. This commit fixes it by - aligning the flags set in JavaParsers with the flags set in ClassfileParser (which are required by the pattern matcher to even consider checking exhaustiveness) - adding the enum members as childs to the class holding the enum as done in ClassfileParser so that the pattern matcher sees the enum members when looking for the sealed children of a type
| * | add mobile CSS rules for updated scaladoc lookFelix Mulder2016-01-045-86/+270
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit addresses the need for an improved mobile viewing experience. Specifically it introduces CSS media queries to adjust sizing and indentation of elements on mobile devices. This includes the following changes: - replace absolute font sizing with relative font sizing - fix font-resizing issues for mobile by fixing viewport - hide related links when viewport too small - fix missing trigram from heaven on Android - remove indentation on annotations e.g. `@throws` and place associated text on a separate line - fix bottom scoll-bar appearing on code-snippets - add spacing between entity icons in browser - add dynamic top offset for entity description - fix long entity names corrupting style - remove "EXPERIMENTAL" button from shortcomment divs on mobile
| * | SI-8289 Scaladoc: Make the order of subclasses deterministicKato Kazuyoshi2015-12-312-6/+10
| | |
| * | add new look to scaladocFelix Mulder2015-12-2274-538/+1313
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds a new look to scaladoc without changing its behaviour. Features in this commit: - New scaladoc look - SVG icons instead of png for HiDPI displays - Better layout of existing features - Better title-bar colors for each entity type: trait, object, class
| * | Merge pull request #4872 from szeiger/wip/sbt-osgi-2.12Lukas Rytz2015-12-181-0/+10
| |\ \ | | | | | | | | Create a full Scala distribution from sbt [2.12]
| | * | Build man pages and scala-dist.jar from sbtStefan Zeiger2015-11-261-0/+10
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - ManMaker is compiled in a new subproject “manual”. A simple command line runner complements the ant task so that it can be run from sbt. - Another new subproject “scala-dist” is responsible for building the scala-dist.jar artifact. Conflicts: build.sbt
| * | Merge pull request #4875 from slothspot/ticket/9454Lukas Rytz2015-12-182-9/+14
| |\ \ | | | | | | | | [SI-9454] Add isAlive method into sys.process.Process trait
| | * | [SI-9454] Add isAlive method into sys.process.Process traitDmitry Melnichenko2015-12-112-9/+14
| | | |
| * | | Remove unused imports and other minor cleanupsSimon Ochsenreither2015-12-18202-589/+388
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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 #4729 from retronym/topic-trait-defaults-moduleLukas Rytz2015-12-189-69/+86
| |\ \ \ | | | | | | | | | | Desugar module var and accessor in refchecks/lazyvals
| | * | | Avoid tree sharing in lazy val translationJason Zaugg2015-11-232-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `cond` tree is used in two places, so make it a by-name parameter to create distinct Trees. Also, remove a dangling comment.
| | * | | Desugar module var and accessor in refchecks/lazyvalsJason Zaugg2015-10-089-65/+84
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than leaving it until mixin. The broader motivation is to simplify the mixin phase of the compiler before we get rid of implementatation classes in favour of using JDK8 default interface methods. The current code in mixin is used for both lazy val and modules, and puts the "slow path" code that uses the monitor into a dedicated method (`moduleName$lzyCompute`). I tracked this back to a3d4d17b77. I can't tell from that commit whether the performance sensititivity was related to modules or lazy vals, from the commit message I'd say the latter. As the initialization code for a module is just a constructor call, rather than an arbitraryly large chunk of code for a lazy initializer, this commit opts to inline the `lzycompute` method. During refchecks, mixin module accessors are added to classes, so that mixed in and defined modules are translated uniformly. Trait owned modules get an accessor method with an empty body (that shares the module symbol), but no module var. Defer synthesis of the double checked locking idiom to the lazyvals phase, which gets us a step closer to a unified translation of modules and lazy vals. I had to change the `atOwner` methods to to avoid using the non-existent module class of a module accessor method as the current owner. This fixes a latent bug. Without this change, retypechecking of the module accessor method during erasure crashes with an accessibility error selecting the module var. In the process, I've tweaked a tree generation utility method to wvoid synthesizing redundant blocks in module desugaring.
| * | | | Merge pull request #4265 from retronym/ticket/9110Lukas Rytz2015-12-181-1/+2
| |\ \ \ \ | | | | | | | | | | | | SI-9110 Pattern `O.C` must check `$outer eq O` for a top level O
| | * | | | SI-9110 Pattern `O.C` must check `$outer eq O` for a top level OJason Zaugg2015-11-261-1/+2
| | | |_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The outer check was not being generated when the prefix was a top level module. The enclosed test shows that we in fact must synthesize the outer check in that case. Perhaps the bug was introduced by neglecting to consider that a module can inherit member classes.
| * | | | SI-9583: Update SystemProperties.empty to return a mutable.Map to fix buildersShane Delmore2015-12-101-1/+1
| | |_|/ | |/| |
| * | | Merge pull request #4865 from SethTisue/intellij-readme-improvementsLukas Rytz2015-12-101-7/+14
| |\ \ \ | | | | | | | | | | IntelliJ README improvements
| | * | | IntelliJ README improvementsSeth Tisue2015-11-251-7/+14
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | * fix typo (`withing`) * fix repeated text about bootstrapping * fix bad Markdown (no blank line before bullet list) * generally rewrite/reformat/overhaul
| * | | Merge commit '5e99f82' into merge-2.11-to-2.12-nov-27Lukas Rytz2015-11-2712-28/+28
| |\ \ \
| | * | | Apply some static code analysis recommendationsJanek Bogucki2015-11-2614-31/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix a batch of code inspection recommendations generated by IntelliJ 14.1.5. Categories of fix, Unnecessary public modifier in interface Replace filter+size with count Replace filter+nonEmpty with exists Replace filter+headOption with find Replace `if (x != null) Some(x) else None` with Option(x) Replace getOrElse null with orNull Drop redundant semicolons Replace anon fun with PF Replace anon fun with method
| | * | | Merge pull request #4855 from szeiger/wip/sbt-osgiLukas Rytz2015-11-241-0/+10
| | |\ \ \ | | | | | | | | | | | | Create a full Scala distribution from sbt
| | | * | | [nomerge] Build man pages and scala-dist.jar from sbtStefan Zeiger2015-11-241-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - ManMaker is compiled in a new subproject “manual”. A simple command line runner complements the ant task so that it can be run from sbt. - Another new subproject “scala-dist” is responsible for building the scala-dist.jar artifact.
| * | | | | Merge pull request #4866 from CaseyLeask/clarify-source-of-f-functionLukas Rytz2015-11-271-1/+1
| |\ \ \ \ \ | | | | | | | | | | | | | | Clarify source of f function in TailCalls flatMap
| | * | | | | Clarify source of f functionCasey Leask2015-11-261-1/+1
| | | |_|/ / | | |/| | |
| * | | | | Update some phase listsSimon Ochsenreither2015-11-253-12/+7
| | | | | |
| * | | | | Remove unused cunit parameter / field in GenBCodeLukas Rytz2015-11-252-18/+7
| |/ / / /
| * | | | Merge pull request #4863 from retronym/topic/leaner-patmat-codegenLukas Rytz2015-11-241-1/+9
| |\ \ \ \ | | | | | | | | | | | | DRY-er trees in pattern matcher code gen.
| | * | | | DRY-er trees in pattern matcher code gen.Jason Zaugg2015-11-241-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than building a cascade of if/elses, push additional conditions into a conjunction in the condition of a single if/else. This is possible when emitting conditions for the list of arguments of a pattern. Here's an example of the improvement to post-pattern matcher trees: https://gist.github.com/retronym/0d8f7126157061d72b81 While we could try to rely on the optimizer to coalesce the repeated else clauses, it seems wasteful to emit the code in that way in the first place.
| * | | | | Merge commit '8eb1d4c' into merge-2.11-to-2.12-nov-24Lukas Rytz2015-11-2453-344/+377
| |\ \ \ \ \ | | | |/ / / | | |/| | |
| | * | | | Merge pull request #4860 from ↵Lukas Rytz2015-11-241-5/+5
| | |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | janekdb/2.11.x-scaladoc-fix-one-off-dot-restart-note Align DotRunner dot restart count with command option description
| | | * | | | Align DotRunner dot restart count with command option descriptionJanek Bogucki2015-11-231-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the command option description, val docDiagramsDotRestart = IntSetting( "-diagrams-dot-restart", "The number of times to restart a malfunctioning dot process before disabling diagrams (default: 5)", 5, None, _ => None ) Prior to this change dot was restarted four times instead of five. Maybe the intention of the option was to allow a total number of attempts to be specified but with 5 restarts we need 6 attempts. The local var was renamed to reflect this.
| | * | | | | Merge pull request #4849 from ↵Lukas Rytz2015-11-231-2/+2
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | janekdb/2.11.x-remove-lagged-scaladoc-setttings-notes Remove notes about -doc-title and -doc-version not being used
| | | * | | | | Remove notes about -doc-title and -doc-version not being usedJanek Bogucki2015-11-181-2/+2
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Confirmed these options are used by editing build-ant-macros.xml and viewing the output, <scaladoc docRootContent="${src.dir}/@{project}/${@{project}.docroot}" destdir="${build-docs.dir}/@{project}" - doctitle="${@{project}.description}" + doctitle="${@{project}.description} - test-title" docfooter="epfl" - docversion="${version.number}" + docversion="${version.number} - test-version"
| | * | | | | Merge pull request #4850 from ↵Lukas Rytz2015-11-231-1/+2
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | janekdb/2.11.x-add-missing-scaladoc-commands-to-help-output Add two missed scaladoc commands into scaladoc specific help section
| | | * | | | | Add two missed scaladoc commands into scaladoc specific help sectionJanek Bogucki2015-11-181-1/+2
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Prior to this change these scaladoc options were buried in the scalac section of the help text, -doc-external-doc -implicits-sound-shadowing With this change the options are listed in the scaladoc section. This will make the commands easier to discover.
| | * | | | | Merge pull request #4856 from ↵Lukas Rytz2015-11-231-11/+23
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | janekdb/2.11.x-scaladoc-excluded-classnames-more-data-like Refactor excluded qname test to be more data like
| | | * | | | | Refactor excluded qname test to be more data likeJanek Bogucki2015-11-201-11/+23
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This refactoring extracts data from code into a form which is closer to configuration data. This is a step change toward making this configurable.
| | * / / / / Fix List Scaladoc time & space formattingJanek Bogucki2015-11-221-13/+13
| | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Performance section got sucked into a wormhole and popped up in the example tag. The laws of physics differ in the attributes block resulting in the loss of the line break between the Time and Space paragraphs. Fixed by moving the section out of the example tag.