summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3383 from adriaanm/merge-2.10.xAdriaan Moors2014-01-1822-12/+178
|\ | | | | Merge 2.10.x
| * Merge commit 'd5801b9eee' from 2.10.x into masterAdriaan Moors2014-01-171-0/+24
| |\ | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * Merge pull request #3328 from retronym/ticket/8111v2.10.4-RC2Jason Zaugg2014-01-121-0/+24
| | |\ | | | | | | | | Repair symbol owners after abandoned named-/default-args
| | | * SI-8111 Repair symbol owners after abandoned named-/default-argsJason Zaugg2014-01-061-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Names/Defaults eagerly transforms an application with temporaries to maintain evaluation order, and dutifully changes owners of symbols along the way. However, if this approach doesn't work out, we throw away this and try a auto-tupling. However, we an still witness symbols owned by the temporaries. This commit records which symbols are owned by the context.owner before `transformNamedApplication`, and rolls back the changes before `tryTupleApply`. Perhaps a better approach would be to separate the names/defaults applicability checks from the evaluation-order-preserving transform, and only call the latter after we have decided to go that way.
| | * | [nomaster] SI-8114 Binary compat. workaround for erasure bug SI-7120Jason Zaugg2014-01-091-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't backport SI-7120 to 2.10.x as it changes erased signatures, which can lead to interop problems between 2.10.3 and 2.10.4. But, we can detect one of the nasty symptoms -- a bridge method with the same signature as its target -- and treat that. This commit detects duplicate bridges in the ASM (only) backend and removes them.
| * | | Merge commit 'aefe3fb844' into merge-2.10.xAdriaan Moors2014-01-172-0/+12
| |\| |
| | * | SI-6563 Test case for already-fixed crasherJason Zaugg2014-01-062-0/+12
| | |/ | | | | | | | | | Progressed to working in SI-7636 / c4bf1d5.
| | * [nomaster] codifies the state of the art wrt SI-8104Eugene Burmako2013-12-286-0/+98
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As it was discovered in SI-8104, whiteboxity doesn’t apply equally to type parameters and type members of materialized type classes. During implicit search and subsequent type inference, whitebox type parameters are consistently erased to wildcards, whereas whitebox type members sometimes remain as is and get in the way of signature conformance checks. Unfortunately, 2.10.x can’t make use of type parameter whiteboxity, because it requires fundep materializers that were only merged into 2.11: https://github.com/scala/scala/pull/2499, and therefore Si-8104 seems to be a hard blocker for 2.10.x at the moment. Stay tuned for updates.
| * | Merge commit '97b9b2c06a' from 2.10.x into masterAdriaan Moors2014-01-1719-12/+142
| |\| | | | | | | | | | | | | | | | | | | | | | | | | Check files updated: test/files/presentation/t8085*.check Conflicts: build.xml src/compiler/scala/tools/nsc/ast/parser/Parsers.scala src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
| | * SI-8085 Fix BrowserTraverser for package objectsJason Zaugg2013-12-1810-11/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A source file like: import foo.bar package object baz Is parsed into: package <empty> { import foo.bar package baz { object `package` } } A special case in Namers compensates by adjusting the owner of `baz` to be `<root>`, rather than `<empty>`. This wasn't being accounted for in `BrowserTraverser`, which underpins `-sourcepath`, and allows the presentation compiler to load top level symbols from sources outside those passes as the list of sources to compile. This bug did not appear in sources like: package p1 package object p2 { ... } ... because the parser does not wrap this in the `package <empty> {}` This goes some way to explaining why it has gone unnoticed for so long.
| | * Test demonstrating SI-8085Mirco Dotta2013-12-186-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The presentation compiler sourcepath is now correctly set-up. * Amazingly enough (for me at least), the outer import in the package object seem to be responsible of the faulty behavior. In fact, if you move the import clause *inside* the package object, the test succeed! The test's output does provide the correct hint of this: ``` % diff /Users/mirco/Projects/ide/scala/test/files/presentation/t8085-presentation.log /Users/mirco/Projects/ide/scala/test/files/presentation/t8085.check @@ -1,3 +1,2 @@ reload: NodeScalaSuite.scala -prefixes differ: <empty>.nodescala,nodescala -value always is not a member of object scala.concurrent.Future +Test OK ``` Notice the ``-prefixes differ: <empty>.nodescala,nodescala``. And compare it with the output when the import clause is placed inside the package object: ``` % diff /Users/mirco/Projects/ide/scala/test/files/presentation/t8085-presentation.log /Users/mirco/Projects/ide/scala/test/files/presentation/t8085.check @@ -1,4 +1,2 @@ reload: NodeScalaSuite.scala -reload: NodeScalaSuite.scala -open package module: package object nodescala Test OK ``` Notice now the ``-open package module: package object nodescala``!
| | * Report error on code size overflow, log method name.Adriaan Moors2013-12-122-0/+27
| | | | | | | | | | | | | | | | | | | | | We used to silently skip class files that would exceed the JVM's size limits. While rare, this should still be an error. While I was at it, also included the name of the offending method.
| | * Merge pull request #3261 from adriaanm/ticket-6426Adriaan Moors2013-12-112-12/+0
| | |\ | | | | | | | | Revert ", importable _."
| | | * Revert "SI-6426, importable _."Adriaan Moors2013-12-102-12/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d2316df920ffa4804fe51e8f8780240c46efa982. We can't make `_` an illegal identifier -- it's legal in Java, so we must be able to name these Java underscores.
| | * | Merge pull request #3253 from retronym/ticket/8062Adriaan Moors2013-12-113-0/+9
| | |\ \ | | | |/ | | |/| Fix inliner cycle with recursion, separate compilation
| | | * SI-8062 Fix inliner cycle with recursion, separate compilationJason Zaugg2013-12-103-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICodeReaders, which decompiles JVM bytecode to ICode, was not setting the `recursive` attribute of `IMethod`. This meant that the inliner got into a cycle, repeatedly inlining the recursive call. The method name `filter` was needed to trigger this as the inliner heuristically treats that as a more attractive inlining candidate, based on `isMonadicMethod`. This commit: - refactors the checking / setting of `virtual` - adds this to ICodeReaders - tests the case involving `invokevirtual` I'm not sure how to setup a test that fails without the other changes to `ICodeReader` (for invokestatic and invokespecial).
* | | | Merge pull request #3381 from retronym/topic/debug-friendlinessEugene Burmako2014-01-182-0/+2
|\ \ \ \ | |/ / / |/| | | Fix compilation under -Ydebug
| * | | Avoid cycles in Symbol toString under -YdebugJason Zaugg2014-01-172-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first of two commits to restore workingness to the compiler under `-Ydebug`. `ResetAttrs` is now called during case class unapply synthesis, after the UnTyper was recently banished. But, this class has some low-level tracing that is triggered under `-Ydebug` (irrespective of any `-Ylog` settings.) This tracing code calls `Symbol#toString`, which, in an attempt to discriminate primary from secondary constructors, accesses the info of its owner. This is sufficient to hit a dreaded `CyclicReferenceError`. The enclosed test compiles a case class under this option to show that things now compile. It still spews out unwanted output; this will be removed in the next commit.
* | | | Merge pull request #3377 from VladimirNik/sprinter-eol-fixAdriaan Moors2014-01-171-2/+7
|\ \ \ \ | | | | | | | | | | Fix EOL-printing in Printers test suite
| * | | | Problem with EOL in tests for Printers is fixedVladimirNik2014-01-171-2/+7
| |/ / /
* | | | Merge pull request #3373 from densh/topic/std-liftable-refinementAdriaan Moors2014-01-171-1/+49
|\ \ \ \ | | | | | | | | | | A few minor changes to standard liftable instances and liftable support
| * | | | Test edge cases of literal liftingDen Shabalin2014-01-161-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously in some corner situation proper Liftable instance might not have been resolved. In particular q"${true}" and q"${""}" used to fail.
| * | | | Lift Some, None, Nil, Left, Right not just supertypesDenys Shabalin2014-01-161-1/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously leaf concrete types were not lifted which could have caused weird problems when types is too precise: val s1 = Some(2) q"$s1" // used to fail
* | | | | Merge pull request #3380 from retronym/ticket/8157Adriaan Moors2014-01-172-0/+8
|\ \ \ \ \ | | | | | | | | | | | | Make overloading, defaults restriction PolyType aware
| * | | | | SI-8157 Make overloading, defaults restriction PolyType awareJason Zaugg2014-01-172-0/+8
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Named/Default args levies an implementation restriction that only one overloaded alternative may declare defaults. But, this restriction failed to consider polymorphic methods. Rather than matching on MethodType, this commit uses `Type#paramms`, which handles PolyTypes and curried MethodTypes in one fell swoop.
* | | | | Merge pull request #3283 from paulp/pr/dotless-targsAdriaan Moors2014-01-173-0/+18
|\ \ \ \ \ | |/ / / / |/| | | | Dotless type application for infix operators.
| * | | | Dotless type application for infix operators.Paul Phillips2013-12-173-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have an aesthetic expresion like def f(xs: Iterator[Int]) = ( xs takeWhile (_ < 1000) map (_ * -1) filter (_ % 2 == 0) flatMap (x => List(x, x)) reduceOption (_ + _) maxBy (_.toString) ) And then for whatever reason you have to perform explicit type application in the midst of that expression, it's aggravating in the extreme that it has (had) to be rewritten in its entirety to accommodate that change. So now you can perform type application in the middle of it. For reasons not entirely clear to me postfix operators are excluded. The discussion as well as the approval for the infix variation of it can be found at: https://groups.google.com/forum/#!msg/scala-language/eJl1wnkEz9M/hR984-lqC5EJ
* | | | | Merge pull request #3322 from rklaehn/issue/6253Ichoran2014-01-163-0/+189
|\ \ \ \ \ | | | | | | | | | | | | SI-6253 HashSet should implement union
| * | | | | SI-6253 HashSet should implement unionRüdiger Klaehn2014-01-163-0/+189
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements of HashSet.union that reuses the two trees as much as possible when calculating the union of two sets. This leads to significant performance improvements as well as to much better structural sharing. There is a comprehensive correctness test for union since there was not a single test for HashSet.union before. In addition, there are some tests of the desirable properties of the new implementation (structural sharing and efficiency regarding calls of key.hashCode). The other operations diff and intersect, which are conceptually very similar to union, are also implemented along with comprehensive test cases for both correctness and structural sharing. Note that while it appears that there is some code duplication between the three methods, they are sufficiently different that it is not possible to merge them into one without sacrificing performance.
* | | | | | Merge pull request #3278 from magarciaEPFL/backendish48Adriaan Moors2014-01-162-0/+17
|\ \ \ \ \ \ | | | | | | | | | | | | | | improvements to GenBCode
| * | | | | | overzealous assert in BCodeBodyBuilder rejected throw nullMiguel Garcia2013-12-161-0/+7
| | | | | | |
| * | | | | | overzealous assert in GenBCodeMiguel Garcia2013-12-151-0/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The assert in question was aimed at ruling out gotos (ie "jumping-applys") in actual argument position of a jumping-apply. But the assert in question went overboard to also rule out a LabelDef in actual argument position. This commit removes the assert in question altogether. The unwanted behaviors, and only those, are rule out by the test added in this commit and the existing tests for SI-6089. See also https://issues.scala-lang.org/browse/SI-7749
* | | | | | | Merge pull request #3319 from Ichoran/issue/4370Adriaan Moors2014-01-161-0/+123
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Range bug: Wrong result for Long.MinValue to Long.MaxValue by In...
| * | | | | | | SI-4370 Range bug: Wrong result for Long.MinValue to Long.MaxValue by ↵Rex Kerr2014-01-151-0/+123
| | |_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Int.MaxValue Fixed by rewriting the entire logic for the count method. This is necessary because the old code was making all kinds of assumptions about what numbers were, but the interface is completely generic. Those assumptions still made have been explicitly specified. Note that you have to make some or you end up doing a binary search, which is not exactly fast. The existing routine is 10-20% slower than the old (broken) one in the worst cases. This seems close enough to me to not bother special-casing Long and BigInt, though I note that this could be done for improved performance. Note that ranges that end up in Int ranges defer to Range for count. We can't assume that one is the smallest increment, so both endpoints and the step need to be Int. A new JUnit test has been added to verify that the test works. It secretly contains an alternate BigInt implementation, but that is a lot slower (>5x) than Long.
* / | | | | | SI-8148 fix anonymous functions with placeholdersDenys Shabalin2014-01-161-0/+5
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quasiquotes used to fail to generate proper fresh identifiers for anonymous functions like: q"_ + _" Due to improper initialization of FreshNameCreator in quasiquote parser which was erroneously not preserved throughout parsing of the code snippet but re-created on every invocation.
* | / / / / Repairs unexpected failure of test t6200.scalaRex Kerr2014-01-151-3/+3
| |/ / / / |/| | | | | | | | | | | | | | Added extra ()'s to get rid of deprecation warning for inferring unit arg.
* | | | | Merge pull request #3318 from rklaehn/issue/6196Ichoran2014-01-152-0/+136
|\ \ \ \ \ | | | | | | | | | | | | SI-6196 - Set should implement filter
| * | | | | SI-6200 - HashMap should implement filterRüdiger Klaehn2014-01-151-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the exact same algorithm as in SI-6196, with only slight differences due to the two type arguments of HashMap. Filter is tested by the new comparative collection test by @Ichoran, but there is nevertheless a small correctness test in t6200 in addition to tests of the new desirable behavior.
| * | | | | SI-6196 - Set should implement filterRüdiger Klaehn2014-01-151-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements a version of filter and filterNot that reuses as much as possible from the existing tree instead of building an entirely new one like the builder-based filter does. This results in significant performance improvements on average. Adds a test of basic correctness of filter and filterNot as well as of the desirable properties of the new filter implementation. This is a collaboration between me and @Ichoran
* | | | | | Merge pull request #3316 from Ichoran/topic/big-decimal-correctnessAdriaan Moors2014-01-155-19/+264
|\ \ \ \ \ \ | | | | | | | | | | | | | | Quasi-comprehensive BigDecimal soundness/correctness fix.
| * | | | | | Quasi-comprehensive BigDecimal soundness/correctness fix.Rex Kerr2014-01-145-19/+264
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes issues SI-6153, SI-6173, SI-6456, SI-6699, and SI-8116, along with a number of other similar possible issues. Relevant changes include * Changes to avoid heap explosion when working with BigInt - to isWhole - to hashCode - to equals - to BigInt's equals * Changes to enable equality matching hashCode - Only for sufficiently small BigInt - For identical values with different precision * Changes to isValidDouble - Takes precision into account now - New methods added to test whether even if the Double is not represented exactly, it's a representation of a certain type - New companion methods added to allow intended expansion of Double (binary/decimal difference) * Changes to constructor - Null arguments are not allowed (these can throw NPEs later at awkward/unexpected times) * New JUnit test to test all these things * Fixed existing tests to expect new behavior * Modified scaladocs to explain the issues * Deprecated problematic methods * Made application of MathContext more consistent (it is where you expect it and not where you don't) These changes are coordinated, for the most part, hence the monolithic commit.
* | | | | | | Merge pull request #3304 from non/bug/stream-flatten2-8100Adriaan Moors2014-01-152-0/+9
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8100 - prevent possible SOE during Stream#flatten.
| * | | | | | | SI-8100 - prevent possible SOE during Stream#flatten.Erik Osheim2013-12-242-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit changes stream flatten to avoid allocating a stack frame for every stream item. Previously, flattening a stream whose elements are mostly empty would result in a StackOverflowException. This commit also adds a test demonstrating the problem.
* | | | | | | | Merge pull request #3293 from soc/SI-7469Adriaan Moors2014-01-152-2/+2
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Remove misc. @deprecated elements
| * | | | | | | | SI-7469 Remove misc. @deprecated elementsSimon Ochsenreither2014-01-092-2/+2
| | | | | | | | |
* | | | | | | | | Merge pull request #3285 from som-snytt/issue/8015-FF-NLsAdriaan Moors2014-01-156-0/+39
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Count lines by EOLs
| * | | | | | | | | SI-8015 Unprintables in messagesSom Snytt2014-01-081-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The line content to display should include the whole line, inclusive of embedded line breaks, and any control chars should be displayed in unicode escape.
| * | | | | | | | | SI-8015 Count lines by EOLsSom Snytt2014-01-086-0/+39
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Source lines were counted by "line break chars", including FF. Clients of `pos.line` seem to all expect the ordinary line num, so that is what they get. Unicode processing now precedes line ending processing.
* | | | | | | | | Merge pull request #3260 from soc/SI-8035Adriaan Moors2014-01-1521-165/+217
|\ \ \ \ \ \ \ \ \ | |_|_|_|/ / / / / |/| | | | | | | | Deprecate automatic () insertion in argument lists
| * | | | | | | | SI-8035 Deprecate automatic () insertion in argument listsSimon Ochsenreither2014-01-0921-165/+217
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This promotes the () insertion warning from -Ywarn-adapted-args to a deprecation warning. -Xfuture tunrs it into a compiler error. Auto tupling remains unchanged for now. The tests have been fixed the following way: - Warnings caused by general sloppiness (Try(), Future(), ...) have been fixed. - Warnings which raise interesting questions (x == (), ...) received an updated checkfile for now.