summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | | 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-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 #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
| | |/ / / | |/| | |
* | | | | Merge pull request #2137 from ↵James Iry2013-02-194-0/+26
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | huitseeker/issue/value-protected-in-inherited-1000567 SI-5013 / #1000567 : added presentation test for fixed bug
| * | | | | unit test ide-t1000567 exercises SI-5063, aka #1000567.François Garillot2013-02-194-0/+26
| | | | | |
* | | | | | Merge pull request #2135 from heathermiller/futures-cleanupsJames Iry2013-02-193-1331/+0
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Removing disabled, unneeded futures tests
| * | | | | Removing disabled, unneeded futures testsHeather Miller2013-02-173-1331/+0
| | | | | |
* | | | | | 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 #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 #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-0837-79/+242
|\ \ \ \ \ | |/ / / / |/| | | | 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-0814-4/+131
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0813-14/+24
|\ \ \ \ \ | | | | | | | | | | | | SI-5675 Discard duplicate feature warnings at a position
| * | | | | SI-5675 Discard duplicate feature warnings at a positionJason Zaugg2013-02-0813-14/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0816-37/+202
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | 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 Catch VerifyErrors in the making in early defs.Jason Zaugg2013-02-022-4/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we did for self/super calls, add a backstop into explicitouter and lambdalift to check when we try to get an outer pointer to an under-construction instance.
| * | | | | | | Broader checks for poisonous this references.Jason Zaugg2013-02-0210-49/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces more VerifyErrors with implementation restrictions.
| * | | | | | | Add a test case from the comments of SI-6666.Jason Zaugg2013-02-022-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This one lands in the new implementation restriction which beats the VerifyError.
| * | | | | | | 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-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 _*