summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* 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 #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.
* | | Merge pull request #2092 from lrytz/t7096James Iry2013-02-082-0/+38
|\ \ \ | | | | | | | | SI-7096 SubstSymMap copies trees before modifying their symbols
| * | | SI-7096 SubstSymMap copies trees before modifying their symbolsLukas Rytz2013-02-082-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I removed some strange code in a06d31f6a2 and replaced it by something incorrect: SubstSymMap should never have side-effects: otherwise, calling 'tpe1 <: tpe2' for instance would modify the symbols in annotations of tpe2. SubstSymMap now always creates new trees before changing them.
* | | | Merge pull request #2017 from retronym/ticket/6666James Iry2013-02-086-0/+139
|\ \ \ \ | | | | | | | | | | Booking more progress on SI-6666
| * | | | Class symbols can't be contravariant.Jason Zaugg2013-02-042-0/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | During development of the fix for SI-6666, I encountered: % test/files/pos/t4842.scala test/files/pos/t4842.scala:10: error: contravariant class Bar occurs in covariant position in type ()this.Bar of constructor Bar this(new { class Bar { println(Bar.this); new { println(Bar.this) } }; new Bar } ) // okay I had incorrectly set the INCONSTRUCTOR flag on the class symbol `Bar`. (It isn't directly in the self constructor call, as it is nested an intervening anonymous class.) But, this flag shares a slot with CONTRAVARIANT, and the variance validation intepreted it as such. ClassSymbol already has this code to resolve the ambiguous flags for display purposes: override def resolveOverloadedFlag(flag: Long) = flag match { case INCONSTRUCTOR => "<inconstructor>" // INCONSTRUCTOR / CONTRAVARIANT / LABEL case EXISTENTIAL => "<existential>" // EXISTENTIAL / MIXEDIN case IMPLCLASS => "<implclass>" // IMPLCLASS / PRESUPER case _ => super.resolveOverloadedFlag(flag) } This commit overrides `isContravariant` to reflect the same logic.
| * | | | SI-6666 Account for nesting in setting INCONSTRUCTORJason Zaugg2013-02-024-1/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This flag is calcualed in Namers, and assigned to class and module class symbols that are defined in self/super-calls, and in early definitions. For example, class D is INCONSTRUCTOR in each case below: class C extends Super({class D; ()}) class C(a: Any) { def this(a: Any) = this({class D; ()}) } new { val x = { class D; () } with Super(()) But, the calculation of this flag failed to account for nesting, so it was not set in cases like: class C(a: Any) { def this(a: Any) = this({val x = {class D; ()}; x}) } This patch searches the enclosing context chain, rather than just the immediate context. The search is terminated at the first non term-owned context. In the following example, this avoids marking `E` as INCONSTRUCTOR; only `D` should be. class C extends Super({class D { class E }; ()}) This closes SI-6259 and SI-6506, and fixes one problem in the recently reopened SI-6957.
| * | | | Move a test from pos to run to highlight bytecode deficiencies.Jason Zaugg2013-01-281-0/+56
| | | | | | | | | | | | | | | | | | | | We'll address them in subsequent commits.
* | | | | Merge pull request #2091 from JamesIry/2.10.x_SI-6478James Iry2013-02-082-0/+52
|\ \ \ \ \ | |_|_|_|/ |/| | | | [backport] SI-6478 Fixing JavaTokenParser ident
| * | | | [backport] SI-6478 Fixing JavaTokenParser identJames Roper2013-02-072-0/+52
| | |/ / | |/| | | | | | | | | | | | | | Backport of 256934160007079f473131469af2df4d023c2cfc from PR https://github.com/scala/scala/pull/1466
* | | | Merge pull request #2035 from scalamacros/ticket/6989Eugene Burmako2013-02-083-0/+299
|\ \ \ \ | | | | | | | | | | SI-6989 privateWithin is now populated in reflect
| * | | | introduces an exhaustive java-to-scala testEugene Burmako2013-02-053-17/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally composed to accommodate pull request feedback, this test has uncovered a handful of bugs in FromJavaClassCompleter, namely: * SI-7071 non-public ctors get lost * SI-7072 inner classes are read incorrectly I'm leaving the incorrect results of FromJavaClassCompleters in the check file, so that we get notified when something changes there.
| * | | | SI-6989 privateWithin is now populated in reflectEugene Burmako2013-02-043-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | Runtime reflection in JavaMirrors previously forgot to fill in privateWithin when importing Java reflection artifacts. Now this is fixed.
* | | | | Merge pull request #2085 from scalamacros/ticket/5824Eugene Burmako2013-02-082-0/+9
|\ \ \ \ \ | | | | | | | | | | | | SI-5824 Fix crashes in reify with _*
| * | | | | SI-5824 Fix crashes in reify with _*Evgeny Kotelnikov2013-02-072-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | Reification crashes if "foo: _*" construct is used. This happens besause type tree is represented either with TypeTree, or with Ident (present case), and `toPreTyperTypedOrAnnotated' only matches of the former. The fix is to cover the latter too. A test is included.
* | | | | | Merge pull request #2093 from adriaanm/ticket-6961James Iry2013-02-072-82/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6961 no structural sharing in list serialization
| * | | | | | SI-6961 no structural sharing in list serializationAleksandar Prokopec2013-02-072-82/+0
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Revert list serialization back to what it was in 2.9.x and before. Partial revert of a6fcd70b60 e234978dfd, which fixed SI-5374. The ListBuffer part of the fix remains in place.
* | | | | | Merge pull request #2090 from adriaanm/rebase-pr-2011James Iry2013-02-074-25/+55
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6187 Make partial functions re-typable
| * | | | | | SI-6187 Make partial functions re-typableJason Zaugg2013-02-074-25/+55
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - `New(tpe)` doesn't survive a `resetAttrs` / typecheck; use a name instead. - Abandon the tree attachment that passed the default case from `typer` to `patmat`; this tree eluded the attribute reset performed in the macro. Instead, add it to the match. Apart from making the tree re-typable, it also exposes the true code structure to macros, which is important if they need to perform other code transformations. - Install original trees on the declared types of the parameters of the `applyOrElse` method to ensure that references to them within the method pick up the correct type parameter skolems upon retypechecking. - Propagate `TypeTree#original` through `copyAttrs`, which is called during tree duplication / `TreeCopiers`. Without this, the original trees that we installed were not visible anymore during `ResetAttrs`. We are not able to reify partial functions yet -- the particular sticking point is reification of the parentage which is only available in the `ClassInfoType`.
* | | | | | Merge pull request #2088 from retronym/ticket/6146James Iry2013-02-072-0/+91
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6146 More accurate prefixes for sealed subtypes.
| * | | | | | SI-6146 More accurate prefixes for sealed subtypes.Jason Zaugg2013-02-072-0/+91
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When analysing exhaustivity/reachability of type tests and equality tests, the pattern matcher must construct a set of sealed subtypes based on the prefix of the static type of and the set of sealed descendent symbols of that type. Previously, it was using `memberType` for this purpose. In simple cases, this is sufficient: scala> class C { class I1; object O { class I2 } }; object D extends C defined class C defined module D scala> typeOf[D.type] memberType typeOf[C#I1].typeSymbol res0: u.Type = D.I1 But, as reported in this bug, it fails when there is an additional level of nesting: scala> typeOf[D.type] memberType typeOf[c.O.I2 forSome { val c: C }].typeSymbol res5: u.Type = C.O.I2 This commit introduces `nestedMemberType`, which uses `memberType` recursively up the prefix chain prefix chain. scala> nestedMemberType(typeOf[c.O.I2 forSome { val c: C }].typeSymbol, typeOf[D.type], typeOf[C].typeSymbol) res6: u.Type = D.O.Id
* | | | | | | Merge pull request #2084 from scalamacros/ticket/6113Adriaan Moors2013-02-072-0/+7
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6113 typeOf now works for type lambdas
| * | | | | | | SI-6113 typeOf now works for type lambdasEugene Burmako2013-02-072-0/+7
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's not a problem to have an abstract type symbol in a ground type tag if that symbol is defined in the type being reified. This mechanics was already built in for existentials, now we extend it to include type params of poly types. Credit goes to @katefree
* | | | | | | Merge pull request #2069 from retronym/ticket/6888James Iry2013-02-072-0/+22
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | SI-6888 Loosen criteria for $outer search.
| * | | | | | SI-6888 Loosen criteria for $outer search.Jason Zaugg2013-02-052-0/+22
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to cater for nested classes with names that end with '$', which lead to ambiguity when unmangling expanded names. In: class X { object $ } We end up with: orginalName(X$$$$$outer) = $$$outer This change modifies `outerSource` to consider that to be and outer accessor name. It is a piecemeal fix, and no doubt there are other nasty surprises in store for those inclined to flash their $$$ in identifier names, but the method changed is not used widely and this solves the reported problem. SI-2806 remains open to address the deeper problem.
* | | | | | Merge pull request #2068 from scalamacros/ticket/7064Adriaan Moors2013-02-077-32/+80
|\ \ \ \ \ \ | | | | | | | | | | | | | | [nomaster] SI-7064 Reflection: forward compat for 2.10.1
| * | | | | | [nomaster] verifies compat with 2.10.0Eugene Burmako2013-02-052-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes sure that the compiler understands the 2.10.0 format of super constructor calls after the recent revert from the typemacro-compatible format.
| * | | | | | [nomaster] Revert "refactors handling of parent types"Eugene Burmako2013-02-051-18/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 40063b0009d55ed527bf1625d99a168a8faa4124. Conflicts: src/compiler/scala/tools/nsc/ast/parser/Parsers.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala
| * | | | | | [nomaster] Revert "introduces global.pendingSuperCall"Eugene Burmako2013-02-054-14/+14
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0ebf72b9498108e67c2133c6522c436af50a18e8. Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala src/reflect/scala/reflect/internal/Trees.scala
* | | | | | [nomaster] Revert "SI-5017 Poor performance of :+ operator on Arrays"James Iry2013-02-062-15/+0
| |/ / / / |/| | | | | | | | | | | | | | This reverts commit 02b2da63409af6a28824cbb74d00d0ec04518c8d.
* | | | | Merge pull request #2051 from adriaanm/ticket-7039Adriaan Moors2013-02-042-0/+12
|\ \ \ \ \ | | | | | | | | | | | | SI-7039 unapplySeq result type independent of subpattern count
| * | | | | SI-7039 unapplySeq result type independent of subpattern countAdriaan Moors2013-02-012-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a bug in the implementation of the `unapplySeq` part of the spec below. An `unapply` method with result type `R` in an object `x` matches the pattern `x(p_1, ..., p_n)` if it takes exactly one argument and, either: - `n = 0` and `R =:= Boolean`, or - `n = 1` and `R <:< Option[T]`, for some type `T`. The argument pattern `p1` is typed in turn with expected type `T`. - Or, `n > 1` and `R <:< Option[Product_n[T_1, ..., T_n]]`, for some types `T_1, ..., T_n`. The argument patterns `p_1, ..., p_n` are typed with expected types `T_1, ..., T_n`. An `unapplySeq` method in an object `x` matches the pattern `x(p_1, ..., p_n)` if it takes exactly one argument and its result type is of the form `Option[S]`, where either: - `S` is a subtype of `Seq[U]` for some element type `U`, (set `m = 0`) - or `S` is a `ProductX[T_1, ..., T_m]` and `T_m <: Seq[U]` (`m <= n`). The argument patterns `p_1, ..., p_n` are typed with expected types `T_1, ..., T_m, U, ..., U`. Here, `U` is repeated `n-m` times.
* | | | | | Merge pull request #2040 from scalamacros/ticket/7008Adriaan Moors2013-02-0419-5/+203
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-7008 @throws annotations are now populated in reflect
| * | | | | reflecting @throws defined in Scala codeEugene Burmako2013-02-044-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per Jason's comment: How are Scala classes containing @throws annots treated? I can't figure out whether we pickle the annotation in addition to adding the exception to the signature. If we do, might we end up with duplicate annotations in runtime reflection? This warrants a test. See the context of the discussion here: https://github.com/scala/scala/pull/2040/files#r2874769. No, we won't end up with duplicates, because classes defined in Scala are loaded in a different completer. But I'll add a test - you can never have too many of those.
| * | | | | evicts javac-artifacts.jarEugene Burmako2013-02-0114-7/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, the usual _1, _2, _3... naming scheme also works for java files, which need to be compiled together with partests. This allows us to get rid of javac-artifacts.jar.
| * | | | | SI-7008 @throws annotations are now populated in reflectEugene Burmako2013-02-013-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Runtime reflection in JavaMirrors previously forgot to fill in @throws when importing Java reflection artifacts. Now this is fixed. Note that generic exception types used in `throws` specifications will be garbled (i.e. erased), because we don't use `getGenericExceptionTypes` in favor of just `getExceptionTypes` to stay compatible with the behavior of ClassfileParser. That's a bug, but a separate one and should be fixed separately. Also note that this commit updated javac-artifacts.jar, because we need to test how reflection works with javac-produced classfiles. The sources that were used to produce those classfiles can be found in the jar next to the classfiles.
* | | | | | Merge pull request #2001 from JamesIry/2.10.x_SI-5313Grzegorz Kossakowski2013-02-042-0/+66
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | SI-5313 Do not eliminate stores that potentially wipe referenes
| * | | | | SI-5313 Test clobbers on the back edge of a loopJames Iry2013-02-022-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I realized I was missing a test case for a local store early in a loop that was unused but turned out to be a clobber of a store later in the loop.
| * | | | | SI-5313 Eliminate more stores by replacing clobbers with null storesJames Iry2013-01-302-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an unused store clobbers a previous store, replace it with storing a null. Don't mark clobbers as "used" so that the original clobber and all following clobbers can still be eliminated.