summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit 'cc6fea6' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-046-2/+94
|\ | | | | | | | | | | Conflicts: build.sbt scripts/jobs/integrate/bootstrap
| * Merge pull request #4927 from szeiger/issue/9572Jason Zaugg2016-02-012-0/+13
| |\ | | | | | | SI-9572 Check for illegal tuple sizes in the parser
| | * SI-9572 Check for illegal tuple sizes in the parserStefan Zeiger2016-01-282-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds explicit checks with syntax errors for tuple literals and types of more than 22 elements. An alternative approach to fixing SI-9572 would be to revert to the old failure mode of Scala 2.10 where references to arbitrary `scala.TupleXY` would be generated in the parser, which then leads to “type/object not found” errors in the typechecker. This fix here is more intrusive but arguably provides a better user experience. Methods `stripParens` and `makeBinop` are moved from `TreeBuilder` to `Parsers` because they can now generate syntax errors. New methods `makeSafeTupleType` and `makeSafeTupleTerm` implement the error checking on top of `makeTupleType` and `makeTupleTerm`. They are overridden with no-op versions in the quasiquotes parser because it also overrides `makeTupleType` and `makeTupleTerm` in a way that supports arbitrary tuple sizes.
| * | SI-9534 Use BoxedUnit in all cases for creating Array[Unit]Stefan Zeiger2016-01-271-1/+11
| |/ | | | | | | | | | | | | | | Calling `wrap` or one of the higher-dimension Array factory methods on the `Manifest` for `Unit` led to an exception because it tried to use `void` as a primitive type. Unlike all other primitive Scala types, `Unit` needs to be boxed. The basic `newArray` method was not affected by this bug because it was already special-cased. The fix is to also special-case `arrayClass`.
| * Trim complexity in CommentFactoryBaseJanek Bogucki2016-01-252-0/+69
| | | | | | | | | | | | | | | | | | | | 1. Replace option handling with library call 2. Remove NumberFormatException catch presumed to be copy/paste legacy 3. It's Scaladoc 4. Parse trailing whitespace regex once instead of per line 5. Use string interpolation where it improves readability 6. Add missed alternative to block grammar production rule 7. Add regression test for tag requirement warnings
| * Merge pull request #4899 from som-snytt/issue/9616Jason Zaugg2016-01-193-12/+81
| |\ | | | | | | [backport] SI-9616 False positive in unused import warning
| | * [backport] SI-9616 False positive in unused import warningSom Snytt2016-01-073-12/+81
| | | | | | | | | | | | This is a minimal backport of the fix for SI-9383.
* | | Merge commit 'bf599bc' into merge/2.11.x-to-2.12.x-20160203Jason Zaugg2016-02-037-4/+155
|\| | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/backend/opt/ConstantOptimization.scala src/compiler/scala/tools/nsc/transform/Constructors.scala src/compiler/scala/tools/nsc/typechecker/Contexts.scala src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala src/scaladoc/scala/tools/nsc/doc/html/resource/lib/jquery.layout.js
| * | disable flaky presentation compiler test on WindowsSeth Tisue2016-01-151-0/+6
| | | | | | | | | | | | see https://github.com/scala/scala-dev/issues/72 for details
| * | SI-9605 Searching does not use binary search for ArrayRui Gonçalves2016-01-121-0/+48
| |/ | | | | | | Binary search should be used for every `IndexedSeqLike` instance and not only for `IndexedSeq`. According the Scaladoc, it is `IndexedSeqLike` that guarantees "constant-time or near constant-time element access and length computation".
| * Merge pull request #4862 from retronym/ticket/9567Lukas Rytz2015-12-183-0/+66
| |\ | | | | | | SI-9567 Fix pattern match on 23+ param, method local case class
| | * SI-9567 Fix pattern match on 23+ param, method local case classJason Zaugg2015-11-252-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Typechecking constructor patterns of method local case classes was only working because of the existence of the unapply method in the companion, which is used if navigation to the case class companion object fails. We now support defintion of, and pattern matching on, case classes with more than 22 parameters. These have no `unapply` method in the companion, as we don't have a large enough tuple type to return. So for such case classes, the fallback that we inadvertently relied on would no longer save us, and we'd end up with a compile error advising that the identifier in the constructor pattern was neither a case class nor an extractor. This is due to the propensity of `Symbol#companionXxx` to return `NoSymbol` when in the midst of typechecking. That method should only be relied upon after typechecking. During typechecking, `Namers#companionSymbolOf` should be used instead, which looks in the scopes of enclosing contexts for symbol companionship. That's what I've done in this commit.
| | * SI-9567 Fix latent bugs in patmat's reasoning about mutabilityJason Zaugg2015-11-251-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Under -optimize, the pattern matcher tries to avoid local variables in favour of directly accessing to non-var case class accessors. However, the code that analysed the patterns failed to account properly for repeated parameters, which could either lead to a compiler crash (when assuming that the n-th subpattern must have a corresponding param accessor), or could lead to a correctness problem (when failing to eagerly the bound elements from the sequence.) The test case that tried to cover seems only to have been working because of a separate bug (the primary subject of SI-9567) related to method-local case classes: they were treated during typechecking as extractors, rather than native case classes. The subsequent commit will fix that problem, but first we must pave the way with this commit that emits local vals for bound elements of case class repeated params.
| * | Merge pull request #4876 from ruippeixotog/issue/9581Seth Tisue2015-12-151-0/+30
| |\ \ | | | | | | | | SI-9581 Fix overflow on Vector take and drop methods
| | * | SI-9581 Fix overflow on Vector take and drop methodsRui Gonçalves2015-12-061-0/+30
| | |/ | | | | | | | | | | | | | | | Fixes the index/length comparison in `Vector#take` and `Vector#drop` so that they handle all possible integer values. Given the collection's invariants `startIndex >= endIndex` and `0 >= startIndex, endIndex`, it is sufficient to change the arithmetic in the comparison as done in this commit to avoid overflows. As cases when `n <= 0` are handled beforehand, `endIndex - n` cannot overflow, contrary to `startIndex + n`. If without the danger of overflows the condition yields true, on the other hand, `startIndex + n` cannot overflow as it is smaller than `endIndex` (as the previous formulation of the condition shows).
| * / Make all of partest work in the sbt buildStefan Zeiger2015-12-041-4/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | - Fix the scoping of files/lib/*.jar. These files were not on the classpath when running partest from sbt. - Pass the same standard Java options to partest as from the command line. This requires new versions of scala-partest and scala-partest-interface. - Fix the classpath scanning in jvm/innerClassEnclMethodJavaReflection. It only worked for JARs and relative directories but not for absolute directory paths (which are produced by sbt).
* | SI-9599 Multiple @todo formatted with comma on separate linepeterz2016-01-292-0/+13
| |
* | Merge pull request #4917 from retronym/ticket/9629Jason Zaugg2016-01-292-0/+29
|\ \ | | | | | | SI-9629 Emit missing 'pattern must be a value' error
| * | SI-9629 Emit missing 'pattern must be a value' errorJason Zaugg2016-01-252-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | The error used to only be emitted for top-level patterns. This commit moves it into `typedInternal` so it works for nested patterns. It uses the typer mode to know when to fire.
* | | SI-9398 Treat case classes as one-element ADTs for analysisJason Zaugg2016-01-2914-12/+33
| | | | | | | | | | | | | | | | | | | | | | | | 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-299-0/+101
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-267-0/+161
|\ \ \ | | | | | | | | SI-9437 Emit and support parameter names in class files
| * | | SI-9437 Emit and support parameter names in class filesSimon Ochsenreither2016-01-257-0/+161
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Rename junit tests to end in *Test to make them run in ANTLukas Rytz2016-01-254-7/+5
| | | | | | | | | | | | | | | | | | | | | | | | Our ANT script only runs junit tests that match *Test.class. https://github.com/scala/scala/blob/1081e718f8f8e174dbf615e42b157e187d3d3886/build.xml#L1467
* | | | Rewrite test: no local for underscoreLukas Rytz2016-01-255-49/+19
| | | |
* | | | Rewrite test: no null in patmatLukas Rytz2016-01-255-40/+13
| | | |
* | | | Rewrite test: no type test on primitives in patmatLukas Rytz2016-01-255-34/+19
| | | |
* | | | Rewrite test for SI-7006Lukas Rytz2016-01-255-61/+24
| | | |
* | | | Rewrite test for inlining higher-order functionsLukas Rytz2016-01-253-92/+20
| | | |
* | | | Rewrite test for inlining from sealed classLukas Rytz2016-01-254-56/+29
| | | |
* | | | Rewrite copy propagation testLukas Rytz2016-01-253-191/+73
| | | |
* | | | Rewrite test for SI-5313Lukas Rytz2016-01-253-67/+92
| | | |
* | | | Rewrite test for SI-6955Lukas Rytz2016-01-252-33/+28
| | | |
* | | | Rewrite test for SI-6956Lukas Rytz2016-01-252-31/+58
| | | |
* | | | Merge remote-tracking branch 'upstream/2.12.x' into opt/elimBoxesLukas Rytz2016-01-24154-392/+768
|\ \ \ \ | | |/ / | |/| |
| * | | Add partial appearance update of inheritence graphs in scaladocFelix Mulder2016-01-231-1/+0
| |/ / | | | | | | | | | | | | | | | | | | | | | 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-193-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #4903 from som-snytt/issue/9622Jason Zaugg2016-01-181-0/+4
| |\ \ | | | | | | | | SI-9622 Native method may be private
| | * | SI-9622 Native method may be privateSom Snytt2016-01-131-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | This was lost in a refactor. https://github.com/scala/scala/commit/290f687fb6ab91b6aef62d871036ddc3829f12b4
| * | | Merge pull request #4898 from soc/SI-8700Lukas Rytz2016-01-1410-0/+72
| |\ \ \ | | | | | | | | | | SI-8700 Exhaustiveness warning for enums from Java source
| | * | | SI-8700 Exhaustiveness warning for enums from Java sourceSimon Ochsenreither2016-01-1410-0/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
| * | | | Fix problems with a locale-dependent decimal mark in StringContextTestMichał Pociecha2016-01-131-16/+36
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | Depending on the current locale one can get 3,400000e+00 instead of 3.400000e+00 so the expected result should take this into account. It's a similar change to one I made some time ago in 2.11.x: https://github.com/scala/scala/pull/4204
| * | | Make StringContextTest pass on WindowsLinas Medziunas2016-01-131-3/+2
| |/ / | | | | | | | | | | | | | | | One assertion in StringContextTest."f interpolator baseline"() was relying on platform specific newline encoding, making it fail when run on Windows.
| * | Merge pull request #4875 from slothspot/ticket/9454Lukas Rytz2015-12-181-0/+1
| |\ \ | | | | | | | | [SI-9454] Add isAlive method into sys.process.Process trait
| | * | [SI-9454] Add isAlive method into sys.process.Process traitDmitry Melnichenko2015-12-111-0/+1
| | | |
| * | | Remove unused imports and other minor cleanupsSimon Ochsenreither2015-12-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Language imports are preceding other imports - Deleted empty file: InlineErasure - Removed some unused private[parallel] methods in scala/collection/parallel/package.scala This removes hundreds of warnings when compiling with "-Xlint -Ywarn-dead-code -Ywarn-unused -Ywarn-unused-import".
| * | | Merge pull request #4729 from retronym/topic-trait-defaults-moduleLukas Rytz2015-12-186-4/+57
| |\ \ \ | | | | | | | | | | Desugar module var and accessor in refchecks/lazyvals
| | * | | Desugar module var and accessor in refchecks/lazyvalsJason Zaugg2015-10-086-4/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0/+27
| |\ \ \ \ | | | | | | | | | | | | 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-0/+27
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.