summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2134 from scalamacros/topic/resetattrs-thisPaul Phillips2013-02-271-9/+48
|\ | | | | resetAttrs now always erases This.tpe
| * adds some comments to resetAttrsEugene Burmako2013-02-261-5/+41
| |
| * resetAttrs now always erases This.tpeEugene Burmako2013-02-171-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix SI-7107: scala now thinks every exception is polymorphicGrzegorz Kossakowski2013-02-251-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We need to force info of the `cls` in `parseExceptions` because we pass `cls` to `addThrowsAnnotation` which in turn calls `Symbol.isMonomorphicType` that relies on a symbol being initialized to give right answers. In the future we should just clean up implementation of `isMonomorphicType` method to not rely on a symbol being initialized as there's no inherent reason for that in most cases. In cases where there's reason for that we should just force the initialization. This patch does not come with a test-case because it's hard to reproduce not initialized symbols in partest reliably.
* | Merge pull request #2149 from khernyo/issue/7074Grzegorz Kossakowski2013-02-251-1/+1
|\ \ | | | | | | SI-7074 Fix xml attribute sorting
| * | SI-7074 Fix xml attribute sortingSzabolcs Berecz2013-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #2157 from retronym/ticket/7171James Iry2013-02-221-2/+2
|\ \ \ | | | | | | | | SI-7171 Consider prefix when assessing type finality.
| * | | SI-7171 Consider prefix when assessing type finality.Jason Zaugg2013-02-221-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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 #2120 from adriaanm/patmat-refactorAdriaan Moors2013-02-229-3862/+3951
|\ \ \ \ | | | | | | | | | | refactor the pattern matcher into smaller files
| * | | | please ant with filenames, add commentsAdriaan Moors2013-02-216-21/+37
| | | | |
| * | | | remove unused importsAdriaan Moors2013-02-157-263/+206
| | | | |
| * | | | [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 #2143 from heathermiller/docs/linearization-typoJames Iry2013-02-222-2/+2
|\ \ \ \ \ | |_|/ / / |/| | | | Fixed error in reflection API docs about linearization order on method baseClasses
| * | | | Fixed error in reflection API docs about linearization order on method ↵Heather Miller2013-02-192-2/+2
| | | | | | | | | | | | | | | | | | | | baseClasses
* | | | | Merge pull request #2133 from som-snytt/typos-2.10.xPaul Phillips2013-02-221-1/+1
|\ \ \ \ \ | |_|_|/ / |/| | | | Shadowed Implict typo (fixes no issue)
| * | | | Shadowed Implict typo (fixes no issue)Som Snytt2013-02-161-1/+1
| | |_|/ | |/| |
* | | | Merge pull request #2118 from lrytz/annotatedRetypingJames Iry2013-02-191-9/+5
|\ \ \ \ | |_|/ / |/| | | Fix typing idempotency bug with Annotated trees
| * | | Fix typing idempotency bug with Annotated treesLukas Rytz2013-02-121-9/+5
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #2129 from gkossakowski/issues/SI-7130-StatisticsJames Iry2013-02-191-1/+1
|\ \ \ | | | | | | | | Fix SI-7130: Memory leaked caused by Statistics
| * | | Fix SI-7130: Memory leaked caused by StatisticsGrzegorz Kossakowski2013-02-141-1/+1
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in the ticket, we were leaking memory by holding reference to Global through by-name argument that was captured by an instance of a class stored in global HashMap `qs`. The fix is simple: do not register quantities in HashMap unless statistics is enabled. This way, if Statistics is disabled we do not store any references. We still leak memory in case of statistics being enabled.
* | | Merge pull request #2136 from vigdorchik/scannersJames Iry2013-02-191-21/+13
|\ \ \ | | | | | | | | SI-7143 Fix scanner docComment production.
| * | | SI-7143 Fix scanner docComment: docBuffer and docPos are initializedEugene Vigdorchik2013-02-191-21/+13
| |/ / | | | | | | | | | | | | in different places and as a result can get out of sync and as a result the invariant that docComment has a position is broken.
* | | Merge pull request #2130 from vigdorchik/relax_docJames Iry2013-02-194-31/+34
|\ \ \ | | | | | | | | 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-154-31/+34
| |/ /
* | | Merge pull request #2131 from jozic/scaladoc-cleanupJames Iry2013-02-193-8/+8
|\ \ \ | | | | | | | | make Future scaladoc examples up-to-date and compilable
| * | | make Future scaladoc examples up-to-date and compilableEugene Platonov2013-02-153-8/+8
| |/ /
* / / SI-5744 evidence params are now SYNTHETICUladzimir Abramchuk2013-02-164-11/+4
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-1/+5
|\ \ | |/ |/| 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/+1
| | | | | | | | | | | | | | This shows up when a protected[pack] class has a constructor with a default argument. Regressed in f708b87 / SI-2296.
| * SI-7091 Add a diagnostic for the "no acc def buf" error.Jason Zaugg2013-02-101-1/+4
| |
* | Merge pull request #2113 from scalamacros/topic/silencePaul Phillips2013-02-111-1/+1
|\ \ | | | | | | silences t6323a
| * | silences t6323aEugene Burmako2013-02-111-1/+1
| | | | | | | | | | | | | | | | | | 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-112-8/+15
|\ \ \ | | | | | | | | SI-6514 Avoid spurious dead code warnings
| * | | SI-6514 Avoid spurious dead code warningsJason Zaugg2013-02-102-8/+15
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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-111-1/+8
|\ \ \ | | | | | | | | SI-6225 Fix import of inherited package object implicits
| * | | SI-6225 Fix import of inherited package object implicitsJason Zaugg2013-02-091-1/+8
| | | | | | | | | | | | | | | | | | | | 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/+2
|\ \ \ \ | | | | | | | | | | SI-6935 Added readResolve in BoxedUnit
| * | | | SI-6935 Added readResolve in BoxedUnitVinicius Miana2013-02-081-0/+2
| |/ / / | | | | | | | | | | | | | | | | 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-2/+6
|\ \ \ \ | | | | | | | | | | 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-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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