summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* [refactor] move some logic-related codeAdriaan Moors2013-02-123-352/+358
|
* [refactor] better name for symbolicCaseAdriaan Moors2013-02-121-16/+6
|
* [refactor] make hash-consing more robustAdriaan Moors2013-02-122-21/+23
|
* drop Cond in favor of PropAdriaan Moors2013-02-123-129/+93
| | | | | | | | | | This brings the optimizations and the analyses closer together. In the future we may consider using a solver in the optimizations. For now, implication is checked ad-hoc using hash-consing and equality/subset tests... NOTE: prepareNewAnalysis resets said hash-consing, so must be called before approximating a match to propositions
* [refactor] prepare migration from Cond to PropAdriaan Moors2013-02-121-52/+52
| | | | | There's no change in behavior. Remove `modelNull` boolean in favor of subclassing.
* [refactor] type analysis consolidationAdriaan Moors2013-02-122-21/+19
| | | | move instanceOfTpImplies out of CodeGen into TypeAnalysis
* [refactor] move PatternMatching.scala to transform.patmatAdriaan Moors2013-02-129-3806/+4032
|
* re-align 2.10.x's pattern matcher with master'sAdriaan Moors2013-02-121-93/+37
| | | | | | | | | | | | | | | | | The diff was mostly code cleanup, so most of that was propagated from master to 2.10.x. The remaining diff is encapsulated in compatibility stubs (see below). (There was also the on/off potential for the 2.10.x "new" pattern matcher. The old one is gone in 2.11, so no turning off new patmat, of course.) The stubs: ``` protected final def dealiasWiden(tp: Type) = tp.dealias // 2.11: dealiasWiden protected final def mkTRUE = CODE.TRUE_typed // 2.11: CODE.TRUE protected final def mkFALSE = CODE.FALSE_typed // 2.11: CODE.FALSE protected final def hasStableSymbol(p: Tree) = p.hasSymbol && p.symbol.isStable // 2.11: p.hasSymbolField && p.symbol.isStable protected final def devWarning(str: String) = global.debugwarn(str) // 2.11: omit ```
* Merge pull request #2113 from scalamacros/topic/silencePaul Phillips2013-02-112-1/+7
|\ | | | | silences t6323a
| * silences t6323aEugene Burmako2013-02-112-1/+7
| | | | | | | | | | | | 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-113-8/+26
|\ \ | | | | | | SI-6514 Avoid spurious dead code warnings
| * | SI-6514 Avoid spurious dead code warningsJason Zaugg2013-02-103-8/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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 #2102 from retronym/topic/tree-checker-leniancyJames Iry2013-02-111-0/+3
|\ \ \ | | | | | | | | Tolerate symbol sharing between accessor/field.
| * | | Tolerate symbol sharing between accessor/field.Jason Zaugg2013-02-091-0/+3
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recently, TreeCheckers (-Ycheck) was extended to report on references to symbols that were not in scope, which is often a sign that some substitution or ownership changes have been omitted. But, accessor methods directly use the type of the underlying field, without cloning symbols defined in that type, such as quantified types in existentials, at the new owner. My attempt to change this broke pos/existentials.scala. Instead, I'll just look the other way in TreeCheckers.
* | | Merge pull request #2098 from retronym/ticket/6225James Iry2013-02-112-1/+28
|\ \ \ | | | | | | | | SI-6225 Fix import of inherited package object implicits
| * | | SI-6225 Fix import of inherited package object implicitsJason Zaugg2013-02-092-1/+28
| | | | | | | | | | | | | | | | | | | | 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-112-0/+16
|\ \ \ \ | | | | | | | | | | SI-6935 Added readResolve in BoxedUnit
| * | | | SI-6935 Added readResolve in BoxedUnitVinicius Miana2013-02-082-0/+16
| |/ / / | | | | | | | | | | | | | | | | 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-112-2/+18
|\ \ \ \ | | | | | | | | | | 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-082-2/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #2099 from retronym/ticket/6158Paul Phillips2013-02-111-1/+1
|\ \ \ \ \ | |_|_|_|/ |/| | | | SI-6158 Restore compile error output under partest --show-log
| * | | | SI-6158 Restore compile error output under partest --show-logJason Zaugg2013-02-091-1/+1
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seems like the ifs and elses didn't quite survive e830a7ce9. Before: ./test/partest --show-log test/files/run/foo.scala Testing individual files testing: [...]/files/run/foo.scala [FAILED] Now: ./test/partest --show-log test/files/run/foo.scala Testing individual files testing: [...]/files/run/foo.scala [FAILED] foo.scala:1: error: expected class or object definition askdfjskl ^ one error found 1 of 1 tests failed (elapsed time: 00:00:01)
* | | | Merge pull request #2100 from paulp/pr/fix-super-varargs-savedJames Iry2013-02-096-4/+121
|\ \ \ \ | |_|_|/ |/| | | Fixing binary compat for $super regression
| * | | Fix for paramaccessor alias regression.Paul Phillips2013-02-084-1/+31
| | | | | | | | | | | | | | | | | | | | A binary incompatibility with 2.10.0 revealed a bug I had introduced in c58647f5f2.
| * | | Expanded bytecode testing code.Paul Phillips2013-02-082-3/+90
| |/ / | | | | | | | | | | | | def sameMethodAndFieldSignatures compares two classes to verify they have all the same methods and fields, and no others.
* | | Merge pull request #2094 from scalamacros/ticket/6591James Iry2013-02-0844-105/+309
|\ \ \ | |/ / |/| | SI-6591 Reify and path-dependent types
| * | accommodates pull request feedbackEugene Burmako2013-02-085-17/+68
| | | | | | | | | | | | https://github.com/scala/scala/pull/2072
| * | term and type reftrees are now reified uniformlyEugene Burmako2013-02-0824-82/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0821-20/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0814-17/+27
|\ \ \ | | | | | | | | SI-5675 Discard duplicate feature warnings at a position
| * | | SI-5675 Discard duplicate feature warnings at a positionJason Zaugg2013-02-0814-17/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-083-13/+67
|\ \ \ \ | | | | | | | | | | SI-7096 SubstSymMap copies trees before modifying their symbols
| * | | | SI-7096 SubstSymMap copies trees before modifying their symbolsLukas Rytz2013-02-083-13/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0820-73/+265
|\ \ \ \ \ | | | | | | | | | | | | Booking more progress on SI-6666
| * | | | | Class symbols can't be contravariant.Jason Zaugg2013-02-044-1/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-023-9/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0212-82/+146
| | | | | | | | | | | | | | | | | | | | | | | | 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-025-4/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-083-3/+56
|\ \ \ \ \ \ | |_|_|_|/ / |/| | | | | [backport] SI-6478 Fixing JavaTokenParser ident
| * | | | | [backport] SI-6478 Fixing JavaTokenParser identJames Roper2013-02-073-3/+56
| | |/ / / | |/| | | | | | | | | | | | | | | | | | Backport of 256934160007079f473131469af2df4d023c2cfc from PR https://github.com/scala/scala/pull/1466
* | | | | Merge pull request #2035 from scalamacros/ticket/6989Eugene Burmako2013-02-087-17/+332
|\ \ \ \ \ | | | | | | | | | | | | 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-047-17/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-085-5/+25
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-5824 Fix crashes in reify with _*
| * | | | | | SI-5824 Fix crashes in reify with _*Evgeny Kotelnikov2013-02-075-5/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-073-106/+9
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6961 no structural sharing in list serialization
| * | | | | | | SI-6961 no structural sharing in list serializationAleksandar Prokopec2013-02-073-106/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-0710-50/+192
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6187 Make partial functions re-typable