summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* SI-7249 Reign in overzealous Function0 optimization.Jason Zaugg2013-03-132-0/+8
| | | | | | | | | | | | The fix for SI-1247 went too far, and could result in premature evaluation of the expression that yields the Function0. This commit checks that said expression is safe to inline. If not, a wrapper `() => ....` is still required. The optimization is still enabled in sitations like the original test case, run/t1247.scala.
* Merge pull request #2234 from scalamacros/ticket/7240Paul Phillips2013-03-123-0/+51
|\ | | | | SI-7240 fixes language feature lookup
| * SI-7240 fixes language feature lookupEugene Burmako2013-03-123-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As I discovered today, Definitions.getMember have a fallback clause, which accounts for the phases which have inner classes flattened. This fallback uses nme.flattenedName to compute a flattened name, but unfortunately nme.flattenedName produces a TermName, not a TypeName, which means that the fallback will commence search in a wrong namespace with predictable results. The commit also changes another usage of nme.flattenedName in a type name context. That one was correctly converting a TermName result to TypeName, so this is not a bugfix, but just a refactoring for the sake of being consistent.
* | Merge pull request #2222 from scalamacros/ticket/6725Paul Phillips2013-03-124-0/+21
|\ \ | | | | | | SI-6725 `f` interpolator now supports %n tokens
| * | SI-6725 `f` interpolator now supports %n tokensEugene Burmako2013-03-094-0/+21
| |/ | | | | | | | | | | | | | | | | | | | | | | Currently the `f` interpolator supports format specifiers which specify conversions for formatted arguments. However Java formatting is not limited to argument-related conversions as explained in: http://docs.oracle.com/javase/6/docs/api/java/util/Formatter.html#detail. Conversions which don't correspond to any arguments are `%` (used to emit verbatim `'%'` characters) and `n` (used to emit platform-specific line separators). Of those only the former is supported, and this patch fixes the oversight.
* | Merge pull request #2227 from mergeconflict/2.10.x-SI-7132Paul Phillips2013-03-122-10/+15
|\ \ | | | | | | SI-7132 - don't discard Unit type in interpreter
| * | SI-7132 - don't discard Unit type in interpreterDan Rosen2013-03-092-10/+15
| | |
* | | Merge pull request #2221 from scalamacros/ticket/5710Adriaan Moors2013-03-114-0/+32
|\ \ \ | | | | | | | | SI-5710 has fixed itself
| * | | SI-5710 has fixed itselfEugene Burmako2013-03-094-0/+32
| | |/ | |/| | | | | | | My job here is only to submit tests.
* | | Merge pull request #2223 from scalamacros/ticket/7235Adriaan Moors2013-03-112-0/+18
|\ \ \ | | | | | | | | reifier is now aware of SI-7235
| * | | reifier is now aware of SI-7235Eugene Burmako2013-03-092-0/+18
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-7235 is caused by a long-standing todo in typedRefinement, which leads to originals of compound type trees swallowing their stats. I'm not sure how exactly to fix SI-7235, but what I am sure about is that we shouldn't silently discard stats during reification. This patch introduces a new implementation restrictions, which now reports that reify of compound type trees with non-empty stats isn't going to work.
* | | Merge pull request #2199 from retronym/ticket/7214Adriaan Moors2013-03-051-0/+57
|\ \ \ | | | | | | | | SI-7214 outer check based on dealiased pattern type.
| * | | SI-7214 outer check based on dealiased pattern type.Jason Zaugg2013-03-051-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Typed Pattern (_: T) is more than `.isInstanceOf`: if `T` is a path dependent type, the scrutinee's $outer reference is also compared against the prefix of `T`. The code that synthesises this is split into two places. `needsOuterCheck` determines whether to add this check, based on the type `T`, and the type of the scrutinee. If it gives the go-ahead, `treeCondStrategy.outerCheck` synthesizes the check. The new test case demonstrates the problems caused by the failure to dealias in `needsOuterCheck`: it could either wrongly lead to synthesis of an outer test (which would crash), or wrongly omit the outer test (meaning overly liberal matching.) A simple `dealias` remedies this. `dealiasWiden` is *not* appropriate here; we need to keep hold of singleton types. I'll also note that there is already a little slack between these methods, as commented: > ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix` > by `Select(q, > outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix` > if there's an outer accessor, otherwise the condition becomes `true` > TODO: can we improve needsOuterTest so there's always an outerAccessor? So this is probably a fragile area that warrants a careful review with a view to design improvements.
* | | | Merge pull request #2198 from retronym/ticket/7215Paul Phillips2013-03-051-0/+6
|\ \ \ \ | | | | | | | | | | SI-7215 Fix transpose of an empty Array[Array[T]].
| * | | | SI-7215 Fix transpose of an empty Array[Array[T]].Jason Zaugg2013-03-051-0/+6
| |/ / /
* | | | Merge pull request #2175 from retronym/ticket/7185Paul Phillips2013-03-052-0/+46
|\ \ \ \ | |_|/ / |/| | | SI-7185 Avoid NPE in TreeInfo.isExprSafeToInline
| * | | SI-7185 Avoid NPE in TreeInfo.isExprSafeToInlineJason Zaugg2013-03-022-0/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We got there typechecking code with a redundant layer of Block. We can't express that in source code, so we test this with manual tree construction and with XML literals, which as reported produce such trees.
* | | | Merge pull request #2184 from adriaanm/revert-pr-2083Adriaan Moors2013-03-018-2071/+0
|\ \ \ \ | | | | | | | | | | Revert SI-6240 synchronization for runtime reflection
| * | | | Revert SI-6240 synchronization for runtime reflectionAdriaan Moors2013-03-018-2071/+0
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reverts #2083: - 387b2590db runtime reflection: death from thousand threads - 73d079fb38 removes the assertion in missingHook - f4dd56ca5d synchronizes names - dd148de5a8 synchronizes pendingVolatiles - 4cbb9357c5 synchronizes toolboxes - 07bcb6176a SI-7045 reflection now auto-initializes selfType - bebd62d566 optimizes Scala reflection GIL - 735634f1d6 initializes lazy vals and inner objects in advance - 5b37cfb19a introduces GIL to Scala reflection - 981da8edfc cleans up initialization of runtime reflection - b2c2493b22 reflection no longer uses atPhase and friends - a9dca512d8 synchronizes symbols - 0262941b3c removes the crazy extraneous log - 21d5d3820b moves Symbol#SymbolKind to Symbols
* | | | Merge pull request #2179 from adriaanm/merge-2.10.1Adriaan Moors2013-03-015-40/+78
|\ \ \ \ | |/ / / |/| | | Merge 2.10.1 into 2.10.x
| * | | Merge 2.10.1 into 2.10.x.Adriaan Moors2013-02-275-40/+78
| |\ \ \
| | * | | 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 #2152 from retronym/topic/annotatedRetyping-2.10.1Adriaan Moors2013-02-212-0/+68
| | |\ \ \ | | | | | | | | | | | | SI-7163 backport of annotated retyping to 2.10.1
| | | * | | Fix typing idempotency bug with Annotated treesLukas Rytz2013-02-212-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.
| | * | | | SI-7128 Fix regression in copyToArray for empty arraysJason Zaugg2013-02-141-0/+3
| | |/ / /
| | * | | [nomaster] Revert "SI-6548 reflection now correctly enters jinners"Adriaan Moors2013-02-104-40/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 54a84a36d5b435a787d93ca48d45399136c7e162. This is necessary to maintain binary compatibility with 2.10.0. run/t6989.check had to be updated as it also (indirectly) tested SI-6548 Conflicts: test/files/lib/javac-artifacts.jar.desired.sha1 test/files/run/t6548.check test/files/run/t6548/Test_2.scala
* | | | | Merge pull request #2083 from scalamacros/ticket/6240Adriaan Moors2013-02-278-0/+2071
|\ \ \ \ \ | |/ / / / |/| | | | SI-6240 synchronization for runtime reflection
| * | | | runtime reflection: death from thousand threadsEugene Burmako2013-02-114-0/+2051
| | | | | | | | | | | | | | | | | | | | not anymore
| * | | | SI-7045 reflection now auto-initializes selfTypeEugene Burmako2013-02-112-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | selfType joins the happy family of flags, annotations and privateWithin, which automatically trigger initialization, when used within runtime reflection.
| * | | | removes the crazy extraneous logEugene Burmako2013-02-112-0/+6
| |/ / /
* | | | Merge pull request #2134 from scalamacros/topic/resetattrs-thisPaul Phillips2013-02-272-0/+12
|\ \ \ \ | | | | | | | | | | resetAttrs now always erases This.tpe
| * | | | resetAttrs now always erases This.tpeEugene Burmako2013-02-172-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The symbol of This, if it points to a package class, isn't touched, just as usual, so that our Select(Select(Select(...))) => This(...) optimization works fine with attr reset. However the tpe is now erased, so that subsequent reflective compilation doesn't spuriously fail when seeing that some subtrees of a tree being compiled are typed. Erasing the tpe doesn't pose even a tiniest problem, because, as it can be seen in typedThis, type is trivially reconstructed from the symbol.
* | | | | Merge pull request #2149 from khernyo/issue/7074Grzegorz Kossakowski2013-02-252-0/+24
|\ \ \ \ \ | | | | | | | | | | | | SI-7074 Fix xml attribute sorting
| * | | | | SI-7074 Fix xml attribute sortingSzabolcs Berecz2013-02-242-0/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Sorting the attributes of an xml element could drop some of the attributes. It was caused by the incorrect use of MetaData#copy() to concatenate "smaller" with the rest of the attributes. The MetaData#copy() method is similar to the following hypothetical method on a List: def copy(other: List): List = head :: other The fix prepends all elements of "smaller" to the rest of the attributes in the proper order.
* | | | | | Merge pull request #2159 from scalamacros/topic/7112-followup-210xJames 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.
* / / / / SI-7171 Consider prefix when assessing type finality.Jason Zaugg2013-02-221-0/+22
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
* / / / 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 #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 #2100 from paulp/pr/fix-super-varargs-savedJames Iry2013-02-093-0/+30
|\ \ \ \ | | | | | | | | | | Fixing binary compat for $super regression
| * | | | Fix for paramaccessor alias regression.Paul Phillips2013-02-083-0/+30
| | |/ / | |/| | | | | | | | | | | | | | A binary incompatibility with 2.10.0 revealed a bug I had introduced in c58647f5f2.
* | | | Merge pull request #2094 from scalamacros/ticket/6591James Iry2013-02-0835-79/+224
|\ \ \ \ | |/ / / |/| | | SI-6591 Reify and path-dependent types
| * | | accommodates pull request feedbackEugene Burmako2013-02-082-0/+30
| | | | | | | | | | | | | | | | https://github.com/scala/scala/pull/2072
| * | | term and type reftrees are now reified uniformlyEugene Burmako2013-02-0823-77/+83
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Top-level (i.e. owned by a package) => Ident(symbol) Nested (i.e. owned by an object or a package object) => Select(owner, symbol) Inner (i.e. owned by a static class) => selectTerm/selectType(owner, name) Non-locatable (i.e. everything else) => see GenTrees.scala for more details Changes w.r.t the previous approaches: * Top-level refs are no longer reified as Select(This(package), symbol). Proposed reification scheme is as resistant to resetAttrs as previous one, but is at the same time much shorter. * Refs to definitions from package objects are no longer Ident(symbol). Otherwise reflective compilation of things like `_ :: _` fails. * Contents of Predef._ and scala._ are no longer treated specially. This increases the size of reificode, but is more hygienic.
| * | | SI-6591 Reify and path-dependent typesDmitry Bushev2013-02-0812-4/+113
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reification scheme changed. Now Select an SelectFromTypeTree trees reified appropriately, as Select and SelectFromTypeTree accordingly. Packages and Predef object was excluded in order not to break the existing reification scheme and not to break tests which rely on it. Reified free terms can contain flag <stable> to make reified values become stable identifiers. For example in the case of reify_newimpl_15.scala class C { type T reify { val v: List[T] = List(2) } } class C reified as free term C$value, and List[C.T] becomes List[C$value().T], so C$value.apply() need to pass stability test isExprSafeToInline at scala.reflect.internal.TreeInfo. For this purpose special case for reified free terms was added to isExprSafeToInline function. test run/reify_newipl_30 disabled due to SI-7082 test t6591_4 moved to pending due to SI-7083
* | | | Merge pull request #2095 from hubertp/ticket/5675James Iry2013-02-086-9/+9
|\ \ \ \ | | | | | | | | | | SI-5675 Discard duplicate feature warnings at a position
| * | | | SI-5675 Discard duplicate feature warnings at a positionJason Zaugg2013-02-086-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When -feature has not been enabled, we were double counting identical feature warnings that were emitted at the same position. Normal error reporting only reports the first time a warning appears at a position; feature warning counter incrementing should behave the same way. @hubertp: Fixed .check files that were broken in the original commit.