summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* generalizes macroExpandEugene Burmako2013-01-096-89/+263
| | | | | | | | | Changes macroExpand to accommodate expansion schemes different from the currently supported one. As a bonus, which follows clarification of the macro expansion logic, this refactoring fixes suppression of macro expansions, which previously didn't work with delayed expansion.
* typedPrimaryConstrBody now returns supercallEugene Burmako2013-01-091-1/+5
| | | | | | | | | | | | | Previously this method returned the entire block with supercall being potentially wrapped in early defs. However when implementing type macros, I found it more convenient to have typedPrimaryConstrBody to only return the supercall itself. This doesn't make any difference for our current codebase, since the only time anyone cares about the return value, it's only to inspect its tpe. Therefore I'm submitting this patch in a preparatory pull request to reduce the surface of changes in the upcoming type macros pull request.
* more precise errors for macrosEugene Burmako2013-01-092-5/+13
|
* parentTypes => typedParentTypesEugene Burmako2013-01-093-6/+6
| | | | | I felt really uncomfortable having to stare at `parentTypes`, when everyone else in Typers.scala is named typedSomething.
* changes isTermMacro checks to something more universalEugene Burmako2013-01-097-15/+26
| | | | | | | | | | Previously I wanted to be as precise as possible, but as the experience with type macros shows, a lot of isTermMacro checks should also extend to include type macros. Therefore I'm changing the checks to isMacro. This doesn't make any difference for existing code, but will reduce the amount of changes in the upcoming type macro pull request.
* fixes printing of AppliedTypeTreeEugene Burmako2013-01-091-8/+12
|
* adds Trees.replace(Tree, Tree)Eugene Burmako2013-01-092-9/+13
| | | | | Currently dead code. Has proven to be useful to implement type macros, therefore I'm moving it to scala.reflect.internal.Trees.
* makes macro override error more consistentEugene Burmako2013-01-094-5/+5
|
* refactors handling of macros in replEugene Burmako2013-01-093-15/+27
| | | | | | | | Macros now have a dedicated member handler, so that the logic of their processing doesn't get mixed up with vanilla DefHandler. I've also factored out an abstract MacroHandler to provides a basis to build the upcoming type macro handler upon.
* SI-5903 extractor macros do workEugene Burmako2013-01-098-0/+72
| | | | | | | | | Apparently it is already possible to use macros to customize pattern matching as described in the comments to the aforementioned JIRA issue. What's even better - with the incoming addition of c.introduceTopLevel it becomes possible to generate arbitrarily complex unappliers, even with heterogeneous types of arguments varying from expansion to expansion
* adds c.macroRoleEugene Burmako2013-01-093-0/+24
| | | | | | | | | | | Currently there's only one flavor of macros - def macros, and the plan was to gradually introduce additional flavors, such as type macros and macro annotations. However as shown by the experience with type macros, it makes sense to distinguish subflavors of macros that tell us in which context the macro gets expanded. For def macros we have the only role - expansion of an application. But for type macros there are multiple.
* Merge pull request #1871 from adriaanm/merge-2.10.xAdriaan Moors2013-01-0840-128/+404
|\ | | | | Merge 2.10.x
| * Merge branch '2.10.x'Adriaan Moors2013-01-0840-128/+404
|/| | | | | | | | | | | | | | | | | | | | | | | | | Patches applied: - rename of `dropRepeatedParamType` to `dropIllegalStarTypes` -- required since 8886d22cd6 - fixed test/files/neg/t6406-regextract.flags -- how could this have worked before? Conflicts: src/compiler/scala/tools/nsc/interpreter/TypeStrings.scala src/library/scala/collection/LinearSeqOptimized.scala src/library/scala/util/Properties.scala test/files/run/streams.check test/files/run/streams.scala
| * Merge pull request #1843 from JamesIry/SI-6915_2.10.xAdriaan Moors2013-01-073-3/+3
| |\ | | | | | | SI-6915 Updates copyright properties to 2002-2013
| | * SI-6915 Updates copyright properties to 2002-2013James Iry2013-01-043-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The .scala header files had the right copyright dates but properties used to generate the information in e.g. "scala -version" hadn't been updated. review @adriaanm
| * | Merge pull request #1842 from adriaanm/backport-1821Paul Phillips2013-01-062-1/+6
| |\ \ | | | | | | | | Backport 1821
| | * | avoid reflect overhead of certain array instantiationsAdriaan Moors2013-01-041-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the manifests for Any, Object/AnyRef, AnyVal, Null and Nothing now have their `newArray` methods overridden to avoid reflective overhead of array instantiation. (backport of 45ef0514e, part 2)
| | * | proper elementClass for WrappedArrayAdriaan Moors2013-01-041-1/+1
| | | | | | | | | | | | | | | | (backport of 45ef0514e, part 1)
| * | | Merge pull request #1834 from paulp/issue/6897Paul Phillips2013-01-062-1/+10
| |\ \ \ | | | | | | | | | | SI-6897, lubs and varargs star.
| | * | | SI-6897, lubs and varargs star.Paul Phillips2012-12-312-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | Don't allow lubs to calculate refinement types which contain a varargs star outside of legal varargs star position.
| * | | | Merge pull request #1835 from paulp/issue/6896Paul Phillips2013-01-063-11/+21
| |\ \ \ \ | | | | | | | | | | | | SI-6896, spurious warning with overloaded main.
| | * | | | SI-6896, spurious warning with overloaded main.Paul Phillips2012-12-313-11/+21
| | |/ / / | | | | | | | | | | | | | | | | | | | | Make sure there's no legit main signature before issuing any warnings about missing main methods.
| * | | | Merge pull request #1840 from paulp/issue/6911Paul Phillips2013-01-064-73/+122
| |\ \ \ \ | | | | | | | | | | | | SI-6911, regression in generated case class equality.
| | * | | | SI-6911, regression in generated case class equality.Paul Phillips2013-01-034-73/+122
| | | |/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Caught out by the different semantics of isInstanceOf and pattern matching. trait K { case class CC(name: String) } object Foo extends K object Bar extends K Foo.CC("a") == Bar.CC("a") That expression is supposed to be false, and with this commit it is once again.
| * | | | Merge pull request #1841 from adriaanm/rebase-6827-2.10.xAdriaan Moors2013-01-043-2/+49
| |\ \ \ \ | | |_|_|/ | |/| | | Fix Iterator#copyToArray (fixes SI-6827).
| | * | | Fix Iterator#copyToArray (fixes SI-6827).Erik Osheim2013-01-043-2/+49
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As pointed out in #scala, when using a non-zero start it's possible to get an ArrayIndexOutOfBoundsException due to an incorrect bounds check. This patch fixes this, as well as another potential bounds error, and adds test cases. Incorporates some other suggestions by Som-Snytt to ensure that callers will get useful error messages in cases where the start parameter is wrong (negative or out-of-array-bounds). Review by @som-snytt.
| * | | Merge pull request #1739 from jedesah/Array_optPaul Phillips2013-01-043-0/+29
| |\ \ \ | | |/ / | |/| | SI-5017 Poor performance of :+ operator on Arrays
| | * | SI-5017 Poor performance of :+ operator on ArraysJean-Remi Desjardins2012-12-233-0/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Control performance of :+ and +: operator on my machine were 700-800 ms After adding size hint on the implementation in SeqLike, it went down to 500-600 ms But with specialixed implementation in ArrayOps, brings it down to 300-400 ms Unfortunatly, this method will only be called when the Array object is being referenced directly as it's type, but that should be the case enough times to justify the extra method. I ended up removing the sizeHint in SeqLike because it made the execution of the "benchmark" slower when the Array was being manipulated as a Seq. Side note: Interestingly enough, the benchmark performed better on my virtualized Fedora 17 with JDK 7 than natively on Mac OS X with JDK 6
| * | | Merge pull request #1822 from paulp/issue/6194Paul Phillips2013-01-033-2/+15
| |\ \ \ | | |_|/ | |/| | SI-6194, repl crash.
| | * | SI-6194, repl crash.Paul Phillips2012-12-273-2/+15
| | | | | | | | | | | | | | | | | | | | | | | | Always a bad idea to use replaceAll on unknown strings, as we saw here when windows classpaths arrived containing escape-requiring backslashes.
| * | | Merge pull request #1824 from paulp/pr/partest-likes-deprecationPaul Phillips2012-12-319-5/+8
| |\ \ \ | | | | | | | | | | Remove -deprecation from partest default options.
| | * | | Remove -deprecation from partest default options.Paul Phillips2012-12-279-5/+8
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | Who knows why it was ever like this; it's not like anyone sees the deprecation warnings. In PR #1807 there is now a test which depends on partest not making this move, so it's a good time to finally expunge it.
| * | | Merge pull request #1720 from soc/SI-6746Paul Phillips2012-12-301-1/+1
| |\ \ \ | | | | | | | | | | SI-6746 Fixes MANIFEST.MF package entry (s.r.makro -> s.r.macros)
| | * | | SI-6746 Fixes MANIFEST.MF package entry (s.r.makro -> s.r.macros)Simon Ochsenreither2012-12-061-1/+1
| | | | |
| * | | | Merge pull request #1792 from ybr/minordocimprovementPaul Phillips2012-12-281-1/+1
| |\ \ \ \ | | | | | | | | | | | | Stream.zip naturalsEx example does not compile => remove extra zip call
| | * | | | Stream.zip naturalsEx example does not compile => remove extra zip callybr2012-12-201-1/+1
| | | | | |
| * | | | | Merge pull request #1828 from paulp/pr/stream-lengthComparePaul Phillips2012-12-286-23/+71
| |\ \ \ \ \ | | |_|_|/ / | |/| | | | SI-6415, Stream#lengthCompare
| | * | | | LinearSeq lengthCompare without an iterator.Paul Phillips2012-12-283-22/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Had to fix up an iffy test: not only was it testing undefined behavior, it demanded just the right numbers be printed in a context where all negative or positive numbers are equivalent. It's the ol' "get them coming and going" trick.
| | * | | | SI-6415, overly eager evaluation in Stream.Jean-Remi Desjardins2012-12-284-13/+57
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The lengthCompare method in LinearSeqOptimized was looking one step further than it needed to in order to give the correct result, which was creating some unwanted side effects related to Streams.
| * | | | Merge pull request #1801 from paulp/issue/6829Paul Phillips2012-12-265-3/+121
| |\ \ \ \ | | | | | | | | | | | | SI-6829, NPE during erroneous compilation.
| | * | | | SI-6829, SI-6788, NPEs during erroneous compilation.Paul Phillips2012-12-245-3/+121
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | Have to intercept trees which have a null type due to errors before they leave the warm confines of 'def typed' because from that point everything assumes tree.tpe != null.
| * | | | Merge pull request #1799 from paulp/pr/check-thread-accessPaul Phillips2012-12-231-1/+0
| |\ \ \ \ | | | | | | | | | | | | Remove stray debugging output line.
| | * | | | Remove stray debugging output line.Paul Phillips2012-12-221-1/+0
| |/ / / / | | | | | | | | | | | | | | | I finally reached my "CHECK THREAD ACCESS" limit.
| * | | | Merge pull request #1687 from scalamacros/topic/unchecked-pattern-matchPaul Phillips2012-12-201-1/+5
| |\ \ \ \ | | | | | | | | | | | | fixes the unchecked warning in quick.comp
| | * | | | SI-6338 fixes the unchecked warning in quick.compEugene Burmako2012-12-061-1/+5
| | | |/ / | | |/| | | | | | | | | | | | | | | | | All those months when I thought it was yet another spurious error in the new pattern matcher...
* | | | | Merge pull request #1817 from scalamacros/topic/introduce-top-levelv2.11.0-M1Eugene Burmako2013-01-0638-51/+430
|\ \ \ \ \ | | | | | | | | | | | | adds c.introduceTopLevel
| * | | | | Made Symbol#associatedFile always return non-nullPaul Phillips2013-01-054-24/+26
| | | | | | | | | | | | | | | | | | | | | | | | So we don't have to clutter everything with null checks.
| * | | | | adds c.introduceTopLevelEugene Burmako2013-01-0534-27/+404
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The first in the family of mutators for the global symbol table, `introduceTopLevel` is capable of creating synthetic top-level classes and modules. The addition of nme.EMPTY_PACKAGE_NAME is necessary to let programmers insert definitions into the empty package. That's explicitly discouraged in the docs, but at times might come in handy. This patch introduce workarounds to avoid incompatibilities with SBT. First of all SBT doesn't like VirtualFiles having JFile set to null. Secondly SBT gets confused when someone depends on synthetic files added by c.introduceTopLevel. Strictly speaking these problems require changes to SBT, and that will be done later. However the main target of the patch is paradise/macros, which needs to be useful immediately, therefore we apply workarounds.
* | | | | | Merge pull request #1847 from JamesIry/SI-6916_masterPaul Phillips2013-01-064-5/+27
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6916 makes FlatHashTable#remove a Boolean not Option[A]
| * | | | | | SI-6916 makes FlatHashTable#remove a Boolean not Option[A]James Iry2013-01-044-5/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Makes FlatHashTable#remove return a boolean instead of Option[A]. Updates HashSet accordingly. Adds a test to make sure remove works as advertised.