summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2170 from rkuhn/wip-duration-sleep-∂πJames Iry2013-02-261-2/+3
|\ | | | | relax time constraint in duration-tck.scala (for Windows)
| * relax time constraint in duration-tck.scala (for Windows VMs)Roland2013-02-261-2/+3
| |
* | Merge pull request #2169 from JamesIry/master_SI-7181Grzegorz Kossakowski2013-02-265-75/+226
|\ \ | | | | | | SI-7181 Eliminate unnecessary duplicates of finally blocks
| * | SI-7181 Eliminate unnecessary duplication of finally blocksJames Iry2013-02-263-75/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main body of a try and each exception handler were getting a copy of the finally block for the "normal" flow case (i.e. where they don't throw an uncaught exception or use "return" to exit early). But that's not necessary. With this commit the try body and each exception handler can all jump to the same copy of the finally block on a normal exit. A byte code test is included to ensure we're getting fewer copies of the finally block. inline-ex-handlers.check is updated because the icode is a bit different without the extra finally block copies.
| * | SI-7181 Prepare to remove duplicated finally blocksJames Iry2013-02-252-0/+101
| |/ | | | | | | | | | | | | As a first step towards fixing 7181, this commit improves the comments and variable names around generating try/catch/finally blocks in GenICode and adds a test verifying the current functionality of try/catch/finally blocks
* | SI-7006 Simplify jump-only block destination determinationJames Iry2013-02-252-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | With proper reachability analysis, the code for finding the final destination of jump-only blocks was more complicated than needed. This commit simplifies and speeds up that process using a standard Tortoise and Hare algorithm on a Map from jump-only blocks to their immediate destinations. Test t7006 is increased a bit to make sure we don't get stuck on infinite loops and to make sure we're deleting all but the essential jump.
* | SI-7006 Eliminate unreachable blocksJames Iry2013-02-253-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | GenASM was doing a bunch of stuff to eliminate unreachable exception handlers, but it was still leaving behind other unreachable blocks, for instance a finally block associated with an exception handler that got removed would still be left lying around. ASM would in turn turn those into a big pile of NOPs, which just take up space uselessly. This commit replaces all the logic for eliding exception handlers with a single unreachable block remover that catches unused exception handlers and a whole lot more.
* | SI-7006 Recognize more jump only blocksJames Iry2013-02-251-1/+1
|/ | | | | | | | | | | | | | | During ASM code emission we would recognize a block that consisted of ICode-only artifacts (ENTER_SCOPE, EXIT_SCOPE, and LOAD_EXCEPTION) followed by a jump. But we weren't using the same logic to recognize all jump-only blocks. So jump-elision wasn't removing them. And that in fact was why the ASM code emission had to do its special case. This commit makes all jump-only block recognition use the same logic: a jump-only block is one that has 0 or more ICode-only instructions followed by a JUMP. It does't necessarily have to start with a JUMP. There's now a debugWarning if the old NOP emitting code is triggered and test t6102 is enhanced to error if that warning occurs.
* Merge pull request #2161 from scalamacros/topic/7112-followup-masterJames Iry2013-02-241-1/+1
|\ | | | | fixes the test for SI-7112
| * fixes the test for SI-7112Eugene Burmako2013-02-231-1/+1
| | | | | | | | | | | | | | | | | | Freshly released Java 1.6.0_41 for OSX fails with "IllegalAccessError: tried to access class JavaSimpleEnumeration_1 from class sun.proxy.$Proxy6", and rightfully so, because that class isn't public. I think I will avoid the usual "how could this even work before" in this commit message.
* | Merge pull request #2125 from retronym/ticket/7120Paul Phillips2013-02-236-0/+52
|\ \ | | | | | | SI-7120 Erasure must honor typeref prefixes
| * | SI-7120 Erasure must honor typeref prefixesJason Zaugg2013-02-146-0/+52
| | | | | | | | | | | | | | | | | | | | | Erasure was discarding these, which led to unnecessarily wide types in quite particular circumstances. This showed up as a double definition error in the reported bug when the bridge method clashed with the erased signature.
* | | Merge remote-tracking branch 'origin/2.10.x' into masterPaul Phillips2013-02-237-0/+62
|\ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: SI-7171 Consider prefix when assessing type finality. please ant with filenames, add comments Fixed error in reflection API docs about linearization order on method baseClasses Shadowed Implict typo (fixes no issue) remove unused imports Conflicts: src/reflect/scala/reflect/internal/Types.scala
| * | | SI-7171 Consider prefix when assessing type finality.Jason Zaugg2013-02-227-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Type#isFinalType` determines if a type could have a non-bottom subtype. This property is exploited by the pattern matcher to flag impossible patterns. This check was ignoring the type's prefix, and incorrectly deemed that `T#A` in `trait T { final class A }` was a final type. But it could have been subtyped by `U#A` where `U` <:< `T`, or, more simply, by `T.this.A`. Now, type finality requires that the prefix is stable. The existing test cases in neg/patmat-type-check.scala still correctly flag incompatiblities. `isFinalType` is also used by some code that massages pattern matches post specialization. That is actually either broken or obsolete under virtpatmat, I've opened SI-7172 to invesigate that. It is also used by GenICode to determine whether to emit the appropriate equality checks that are correct in the face of boxing. It is possible that this change will force the slow path in some rare cases, but it won't affect correctness.
* | | | Merge pull request #2147 from JamesIry/master_SI-7015Grzegorz Kossakowski2013-02-222-0/+60
|\ \ \ \ | |_|_|/ |/| | | SI-7015 Removes redundant aconst_null; pop; aconst_null creation
| * | | SI-7015 Cleanup from review of null duplicationJames Iry2013-02-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Based on feedback on https://github.com/scala/scala/pull/2147 * Assertion in GenICode#adaptNullRef reports the erroneous type * Test makes the Null type explicit for greater clarity
| * | | SI-7015 Removes redundant aconst_null; pop; aconst_null creationJames Iry2013-02-212-0/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an effort to adapt methods and field accesses of type Null to other types, we were always emitting aconst_null pop aconst_null The problem is we were doing that even when the JVM was in a position to know it had null value, e.g. when the user had written a null constant. This commit fixes that and includes a test to show that the resulting byte code still works even without repeating ourselves and/or repeating ourselves. This commit also makes the scala.runtim.Null$ constructor private. It was a sealed abstract class which prevented subclassing in Scala, but it didn't prevent subclassing in Java. A private constructor takes care of that hole so now the only value of type Null$ should be null. Along the way I found some other questionable things in adapt and I've added TODO's and issue https://issues.scala-lang.org/browse/SI-7159 to track.
* | | | Merge pull request #2154 from ↵James Iry2013-02-222-4/+4
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | viktorklang/wip-SI7164-nonfatal-notimplementederror SI-7164 - Removing NotImplementedError as Fatal from s.u.c.NonFatal
| * | | | SI-7164 - Removing NotImplementedError as Fatal from s.u.c.NonFatalViktor Klang2013-02-212-4/+4
| |/ / /
* | | | Merge pull request #2151 from adriaanm/merge-2.10.xPaul Phillips2013-02-2213-13/+154
|\ \ \ \ | | | | | | | | | | Merge 2.10.x into master
| * \ \ \ Merge 2.10.x into master.Adriaan Moors2013-02-2013-13/+154
| |\ \ \ \ | | |/ / / | |/| / / | | |/ / | | | | | | | | | | | | | | | | Conflicts: build.number src/compiler/scala/tools/nsc/doc/base/MemberLookupBase.scala src/compiler/scala/tools/nsc/typechecker/Macros.scala test/files/presentation/doc/doc.scala
| | * | Merge pull request #2118 from lrytz/annotatedRetypingJames Iry2013-02-194-0/+82
| | |\ \ | | | | | | | | | | Fix typing idempotency bug with Annotated trees
| | | * | Additional test case for Lukas' fix to annotated originals.Jason Zaugg2013-02-182-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | This was inspired by the regression that Mark encountered when upgrading SBT from 2.10.0 to 2.10.1-RC1.
| | | * | Fix typing idempotency bug with Annotated treesLukas Rytz2013-02-122-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | typedAnnotated transforms an Annotated tree into a Typed tree. The original field of the result is set to the Annotated tree. The bug was that typedAnnotated was using the untyped Annotated tree as original, but also set its type. When re-typing later on the same Annotated tree, the typer would consider it as alreadyTyped. This is incorrect, the typer needs to convert Annotated trees to Typed. Also, the Annotated tree only had its type field set, but its children were still untyped. This crashed the compiler lateron, non-typed trees would get out of the typing phase.
| | * | | Merge pull request #2130 from vigdorchik/relax_docJames Iry2013-02-192-9/+7
| | |\ \ \ | | | | | | | | | | | | SI-7134: don't require doc.Settings in base api of scaladoc.
| | | * | | SI-7134: don't require doc.Settings in base api of scaladoc.Eugene Vigdorchik2013-02-152-9/+7
| | | | | |
| | * | | | unit test ide-t1000567 exercises SI-5063, aka #1000567.François Garillot2013-02-194-0/+26
| | | | | |
| | * | | | SI-5744 evidence params are now SYNTHETICUladzimir Abramchuk2013-02-162-0/+28
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The macro def <-> macro impl correspondence check compares names of the corresponding parameters in def and impl and reports an error if they don't match. This was originally designed to avoid confusion w.r.t named arguments (which ended up being never implemented as described in SI-5920). Sometimes parameter names are generated by the compiler, which puts the user in a tough position. Luckily, there's an escape hatch built it, which omits the name correspondence check if one of the parameters is SYNTHETIC. Everything went well until we realized that evidences generated by context bounds aren't SYNTHETIC, which led to the bug at hand. Marking auto-generated evidence parameters SYNTHETIC was only the first step, as the correspondence checker uses parameter symbols, not parameter trees. Why's that a problem? Because SYNTHETIC doesn't get propagated from def trees to their underlying symbols (see ValueParameterFlags). Unfortunately one cannot just change ValueParameterFlags, because that would break printouts generated in TypeDiagnostics, which is designed to not print synthetic symbols. Thus we modify methodTypeErrorString in TypeDiagnostics to always print synthetic symbols. Therefore now we propagate all paramSym.flags when doing correspondent sweeps to keep them in sync between def trees and their underlying symbols. This fixes the problem.
| | * | | Merge pull request #2115 from retronym/ticket/7091Adriaan Moors2013-02-121-0/+7
| | |\ \ \ | | | |/ / | | |/| | SI-7091 Don't try to put a protected accessor in a package.
| | | * | SI-7091 Don't try to put a protected accessor in a package.Jason Zaugg2013-02-111-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This shows up when a protected[pack] class has a constructor with a default argument. Regressed in f708b87 / SI-2296.
* | | | | Merge pull request #2141 from paulp/pr/overriding-methodsPaul Phillips2013-02-222-0/+12
|\ \ \ \ \ | | | | | | | | | | | | Fix and optimization in overriding logic.
| * | | | | Fix and optimization in overriding logic.Paul Phillips2013-02-192-0/+12
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given: trait Foo { def f: Int = 5 } trait Bar extends Foo { def f: Int } I noticed allOverriddenSymbols for the abstract f defined in Bar was returning the method from Foo, even though an abstract method cannot override a concrete one. There were other bits of code which accidentally depended on this outcome. Now allOverriddenSymbols for Bar is empty. The optimization is that whether or not a symbol overrides any other symbols is known at creation time and does not change. We now spend a lot less time looking for overridden symbols in base classes by storing that value, "isOverridingSymbol".
* | | | | Merge pull request #2145 from paulp/pr/value-class-extractorsPaul Phillips2013-02-223-0/+39
|\ \ \ \ \ | |_|/ / / |/| | | | Boxing cleanup: erasure, post-erasure, value classes.
| * | | | Boxing cleanup: erasure, post-erasure, value classes.Paul Phillips2013-02-203-0/+39
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces extractors for value class trees. Puts them to work to make the value class tree manipulations believable. Eliminated some boxing code in erasure which had been marked "maybe subsumed by posterasure?" after deciding that it had been subsumed by posterasure. Added some same-bytecode tests involving value class boxing (actually the lack thereof.)
* | | | SI-6642 Refactor mutable.TreeSet to use RedBlackTree instead of AVLJames Iry2013-02-131-0/+145
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was no reason to have mutable.TreeSet use AVLTree while immutable.TreeSet and immutable.HashSet used RedBlackTree. In particular that would have meant duplicating the iteratorFrom logic unnecessarily. So this commit refactors mutable.TreeSet to use RedBlackTree for everything, including iteratorFrom. It also adds a test to make sure TreeSet works as expected. AVLTree should be dead code since it's private[scala.collection.mutable] and only used by mutable.TreeSet, but to be safe it's only deprecated in this commit.
* | | | SI-6642 Adds iteratorFrom, keysIteratorFrom, and valuesIteratorFromJames Iry2013-02-131-0/+69
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds the ability to efficiently create an iterator that starts at a given key or element of a sorted set or map. Similar work is done for key and value only iterators on maps. The bulk of the work is in RedBlackTree. Most of the rest is pushing the new api methods throughout the appropriate spots in the collection API. This commit leaves undone some similar work possible on mutable TreeSets
* | | Merge remote-tracking branch 'scala/2.10.x' into patmat-refactor-masterAdriaan Moors2013-02-125-0/+63
|\| | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Implicits.scala
| * | Merge pull request #2113 from scalamacros/topic/silencePaul Phillips2013-02-111-0/+6
| |\ \ | | | | | | | | silences t6323a
| | * | silences t6323aEugene Burmako2013-02-111-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | Tag materialization notices enabled with -Xlog-implicits are now echoes not printlns. Therefore, they go into stderr, not stdout, getting logged by partest and not spamming stdout of partest.
| * | | Merge pull request #2111 from retronym/2.10.xJames Iry2013-02-111-0/+11
| |\ \ \ | | | | | | | | | | SI-6514 Avoid spurious dead code warnings
| | * | | SI-6514 Avoid spurious dead code warningsJason Zaugg2013-02-101-0/+11
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `deadCode.expr` stores the method symbol most recently encountered in `handleMonomorphicCall`, and uses this to avoid warnings for arguments to label jumps and `Object#synchronized` (which sneakily acts by-name without advertising the fact in its type.) But this scheme was insufficient if the argument itself contains another method call, such as `matchEnd(throw e(""))`. This commit changes the single slot to a stack, and also grants exemption to `LabelDef` trees. They were incorrectly flagged in the enclosed test case after I made the the first change.
| * | | Merge pull request #2098 from retronym/ticket/6225James Iry2013-02-111-0/+20
| |\ \ \ | | | | | | | | | | SI-6225 Fix import of inherited package object implicits
| | * | | SI-6225 Fix import of inherited package object implicitsJason Zaugg2013-02-091-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | The prefix in the ImplicitInfo must be com.acme.`package`.type, rather than com.acme.
| * | | | Merge pull request #2097 from ViniciusMiana/SI-6935James Iry2013-02-111-0/+14
| |\ \ \ \ | | | | | | | | | | | | SI-6935 Added readResolve in BoxedUnit
| | * | | | SI-6935 Added readResolve in BoxedUnitVinicius Miana2013-02-081-0/+14
| | |/ / / | | | | | | | | | | | | | | | | | | | | When deserializing Unit, it would return an instance of Object, but not a Scala Unit. By adding readResolve, the deserialization of Unit will work.
| * | | | Merge pull request #2096 from ViniciusMiana/SI-6370James Iry2013-02-111-0/+12
| |\ \ \ \ | | |_|_|/ | |/| | | SI-6370 changed ListMap apply0 method to produce correct error message
| | * | | SI-6370 changed ListMap apply0 method to produce correct error message when ↵Vinicius Miana2013-02-081-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | a key is not found Current implementation of apply0 relies on tail method to iterate over all keys. When the list gets to its end, tail produces an 'empty map' message in its exception, which is thrown by ListMap. This change checks if the collection is empty before calling tail and provides a more appropriate key not found message. Signed-off-by: Vinicius Miana <vinicius@miana.com.br>
* | | | | Merge pull request #2057 from paulp/pr/revert-6355Paul Phillips2013-02-123-2/+27
|\ \ \ \ \ | | | | | | | | | | | | SI-6355, weakend implementation restriction on applyDynamic.
| * | | | | SI-6355, weakend implementation restriction on applyDynamic.Paul Phillips2013-02-123-2/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I realized one can successfully call an overloaded applyDynamic, under conditions such as these: def applyDynamic[T1](m: String)(x1: T1): Any = 1 def applyDynamic[T1, T2](m: String)(x: T1, y: T2): Any = 2 def applyDynamic[T1, T2, T3](m: String)(x: T1, y: T2, z: T3): Any = 3 So I weakened the overloading restriction to allow overloading if each method has a distinct number of type parameters. This very likely still allows the creation of uncallable overloads, but an overly restrictive rule is worse. If the overload cannot be called, it will still be discovered at the call site.
* | | | | | Maintenance of Predef.Paul Phillips2013-02-1275-298/+320
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Deprecates much of Predef and scala.Console, especially: - the read* methods (see below) - the set{Out,Err,In} methods (see SI-4793) 2) Removed long-deprecated: - Predef#exit - Predef#error should have gone, but could not due to sbt At least the whole source base has now been future-proofed against the eventual removal of Predef#error. The low justification for the read* methods should be readily apparent: they are little used and have no call to be in global namespace, especially given their weird ad hoc semantics and unreasonably tempting names such as readBoolean(). 3) Segregated the deprecated elements in Predef from the part which still thrives. 4) Converted all the standard Predef implicits into implicit classes, value classes where possible: - ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value) - SeqCharSequence, ArrayCharSequence (non-value) Non-implicit deprecated stubs prop up the names of the formerly converting methods.