summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1118 from scalamacros/ticket/6201Josh Suereth2012-08-113-3/+15
|\ | | | | SI-6201 minor fixes in key points
| * SI-6201 minor fixes in key pointsEugene Burmako2012-08-113-3/+15
| | | | | | | | | | | | | | | | Fixes several oversights that led to 6201. RootPackage should have been static, refactored implementation of hasSymbolWhich shouldn't have checked hasSymbol. Full discussion is here: http://groups.google.com/group/scala-internals/browse_thread/thread/9500348f273a8aa.
* | Merge pull request #1105 from rklaehn/SI-6197Josh Suereth2012-08-113-1/+27
|\ \ | | | | | | Only create a HashTrieSet if necessary.
| * | Added test to check that removing all but one element from a HashTrieSet ↵Ruediger Klaehn2012-08-112-0/+21
| | | | | | | | | | | | yields a HashSet1 as it should
| * | Only create a HashTrieSet if necessary.Ruediger Klaehn2012-08-091-1/+6
| | | | | | | | | | | | If allow HashTrieSets with one element, you can get a degenerate tree that is six levels deep yet contains only one element by first building a large tree and then removing elements
* | | Merge pull request #1097 from rklaehn/SI-6198Josh Suereth2012-08-114-12/+38
|\ \ \ | |_|/ |/| | Si 6198
| * | Added test for SI-6198Ruediger Klaehn2012-08-112-0/+24
| | | | | | | | | | | | This tests that ListSet.tail is O(1) as well as testing that a HashSetCollision1 is turned back into a HashSet1 when removing all but one element
| * | Create a HashSet1 in case ks1 contains just one entryRuediger Klaehn2012-08-091-3/+5
| | | | | | | | | | | | Create HashSetCollision1 only if there is more than one element
| * | Renamed elem to head and next to tailRuediger Klaehn2012-08-091-9/+9
| |/ | | | | | | both head and tail are now O(1) with very low overhead like you would expect for a list-like data structure
* | Merge pull request #1111 from scalamacros/ticket/6212Josh Suereth2012-08-106-53/+49
|\ \ | | | | | | refines api.FlagSets
| * | refines api.FlagSetsEugene Burmako2012-08-106-53/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the current vision of flags, they should only be used to construct trees, because tests are subsumed by the numerous isXXX methods that we have. Hence we need to remove `hasFlag` and the flags that don't make sense being added to tree modifiers manually. A good example of that is MODULE. There's an isModule check, so hasFlag MODULE is redundant. On the other hand, you don't need MODULE to construct a ModuleDef so it's redundant in this department as well.
* | | Merge pull request #1108 from rklaehn/SI-5879Josh Suereth2012-08-101-14/+18
|\ \ \ | | | | | | | | Ensure that a.merged(b)(null) always chooses a in case of collisions
| * | | Ensure that a.merged(b)(null) always chooses a in case of collisionsRuediger Klaehn2012-08-091-14/+18
| | |/ | |/| | | | | | | Moved definition of liftMerger to companion object and replaced null with a default merger so merge works predictably if you pass null as a merger. Maybe we should just not allow null as a merge function at all.
* | | Merge pull request #1113 from adriaanm/copyrightJosh Suereth2012-08-104-4/+4
|\ \ \ | | | | | | | | some more copyright cleanup for 2012
| * | | some more copyright cleanup for 2012Adriaan Moors2012-08-104-4/+4
| | | | | | | | | | | | | | | | contributed by Carlo Dapor -- thanks!
* | | | Merge pull request #1103 from dcsobral/si/6119bpJosh Suereth2012-08-101-1/+1
|\ \ \ \ | | | | | | | | | | SI-6119 Fix mispelling on take documentation. (backport)
| * | | | SI-6119 Fix mispelling on take documentation.Daniel C. Sobral2012-08-091-1/+1
| | |_|/ | |/| |
* | | | Merge pull request #1091 from paulp/topic/patmat-error-messagesJosh Suereth2012-08-1010-23/+155
|\ \ \ \ | |_|/ / |/| | | Better pattern matcher error message.
| * | | Better pattern matcher error message.Paul Phillips2012-08-0810-23/+155
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For the common case when someone hasn't quite grokked the significance of lower case in a pattern match. I'd like to make all the unreachables errors, not warnings, but there may be a bug or two to clear out first. class A { def badEquals(x: Any, y: Any) = x match { case y => true case _ => false } } a.scala:3: warning: patterns after a variable pattern cannot match (SLS 8.1.1) If you intended to match against parameter y of method badEquals, you must use backticks, like: case `y` => case y => true ^ a.scala:4: warning: unreachable code due to variable pattern 'y' on line 3 case _ => false ^ two warnings found
* | | | Merge pull request #1104 from odersky/2.10.xAdriaan Moors2012-08-101-3/+5
|\ \ \ \ | |_|/ / |/| | | Made inliner work for @inline methods that access private variables.
| * | | Made inliner work for @inline methods that access private variables.Martin Odersky2012-08-091-3/+5
|/ / / | | | | | | | | | We need to disable the previous "potentiallyPublished" logic for this because that one disables inlining as long as the inlined method has a reference to a field with a $. But making fields public in @inline method will generate fields with $. We need to complement this with reverting the previous publication logic completely. I leave that to Vlad or Miguel.
* | | Merge pull request #1094 from scalamacros/ticket/6204Adriaan Moors2012-08-096-21/+50
|\ \ \ | | | | | | | | fixes to existential-related reification problems
| * | | accommodates reflection meeting feedbackEugene Burmako2012-08-091-1/+1
| | | |
| * | | SI-6204 reifier no longer causes cyclic errorsEugene Burmako2012-08-092-9/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When reifying certain trees/types reifier might decide that it needs to introduce auxiliary symbols to represent non-locatable components of types For example, when reifying a refined type we need to reify the symbols that correspond to its members (aka RefinedType.decls). Since these symbols are not stored in pickles, we can't do the usual staticClass(scala.Int) stuff, and are forced to actually create corresponding symbols inside the reificode (by "create" I mean literally create, by using newXXXSymbol methods). It looks like a generally good idea to not only create those symbols naked, but to also export their type signatures and annotations. However this brings problems with type inference. Say, a type of a method A depends on a type tag. To get a type of a type tag, the compiler needs to expand the corresponding macro (when the macro is being expanded, symbol A is marked as LOCKED). While reification macro expands, it might want to reify certain symbol definitions (as explained above). If one of these definitions is a class that contains method A, we're in trouble, since reifying the corresponding ClassInfoType will eventually call A.info, which will produce a cyclic reference error, because A is LOCKED. An obvious solution is to check whether a reified symbol definition is locked. If the symbol is locked, then the reifier bails (e.g. by reifying NoType instead of the actual type signature of the symbol). Being obvious this solution is also incorrect as illustrated by SI-6204. Sure we can check whether a symbol itself is locked, but we cannot check whether or not we reify someone who refers to the locked symbol. As of such I'm telling the reifier to bail whenever it needs to reify a symbol definition for a symbol that is not yet complete. Therefore reification can no longer cause inference of method result types, which eliminates the underlying problem. This is a harsh measure, but taking into account that we have an RC planned within a week, stability trumps completeness.
| * | | SI-5756 correctly reifies local module classesEugene Burmako2012-08-093-1/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike module classes that are going to be pickled (which are reified as `<their module reification>.moduleClass), module classes of local modules need to be reified as symbol defs. Otherwise we get a stack overflow: 1) Local modules are deemed to be free terms, 2) All free symbols are reified together with their type signature (so that they can be a) inspected by anyone interested, b) compiled at runtime), 3) Reifying a type signature of a module involves reifying its module class, 4) Reifying a module class involves reifying a module and calling its module class, <ad infinitum> This stack overflow doesn't happen for locatable modules, because they don't need to have their type signatures reified (these signatures can later be loaded from pickles if it becomes necessary).
| * | | an important fixup for macro universe APIEugene Burmako2012-08-091-11/+11
| | |/ | |/| | | | | | | | | | | | | It seems that this.type doesn't cut it for stuff declared in a trait. Downgrading this.type to Symbol and Type correspondingly in SymbolContextApi and TreeContextApi.
* | | Merge pull request #1099 from lrytz/no-xzAdriaan Moors2012-08-091-12/+27
|\ \ \ | | | | | | | | Allow skipping the xz archives
| * | | Allow skipping the xz archivesLukas Rytz2012-08-091-12/+27
| | | | | | | | | | | | | | | | Using 'ant -Darchives.skipxz=true'
* | | | Merge pull request #1095 from gkossakowski/inliner-access-levelsVlad Ureche2012-08-096-76/+103
|\ \ \ \ | | | | | | | | | | Moved inline logic before pickler.
| * | | | Moved inline logic before pickler.Grzegorz Kossakowski2012-08-096-76/+103
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The test case failed due to separate compilation. The problem was that we don't pickle the fact that the field was made public. Original patch by @odersky. Cleaned up by me. Changes I made: * removed stale test-case * reduced whitespace changes Supersedes #1089. Review by @odersky and @moors.
* | | | Merge pull request #1060 from adriaanm/ticket-5739bAdriaan Moors2012-08-084-47/+170
|\ \ \ \ | | | | | | | | | | SI-5739 (bis) vals for subpatterns when -g:patmatvars
| * | | | SI-5739 (bis) vals for subpatterns unless -optimizeAdriaan Moors2012-08-084-47/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To facilitate debugging pattern matches, we store the values for sub-patterns of extractor (synthetic or user-defined) patterns in local variables. When performing an optimized build, and when possible, we don't do store but inline them directly. For soundness, SI-5158, SI-6070, we must always store the values of mutable case class fields. (Specifying -optimize is the only way to suppress emitting these local variables. An unoptimized build will always generate them, which was deemed the right default during the meeting.) (updated flags for t4425 to get consistent runs on optimized and non-optimized partest runs by always passing -optimize)
* | | | | Merge pull request #1088 from adriaanm/ticket-6205Adriaan Moors2012-08-082-3/+22
|\ \ \ \ \ | | | | | | | | | | | | SI-6205 make pt fully defined before inferTypedPattern
| * | | | | SI-6205 make pt fully defined before inferTypedPatternAdriaan Moors2012-08-082-3/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | refines my fix for SI-2038 (#981) by making pt fully defined before calling inferTypedPattern, instead of making the result of inferTypedPattern fully defined I finally realized my mistake by diffing the -Ytyper-debug output of compiling the variants with: ``` x match {case Holder(k: A[kt]) => (k: A[kt])} ``` and ``` (x: Any) match {case Holder(k: A[kt]) => (k: A[kt])} ```
* | | | | | Merge pull request #1064 from adriaanm/ticket-6145Adriaan Moors2012-08-083-12/+35
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | SI-6145 lax typing of args to synthetic case-labels
| * | | | | SI-6145 lax typing of args to synthetic case-labelsAdriaan Moors2012-08-073-12/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use wildcard for the expected type of the arguments of a jump to a label synthesized by the pattern matcher... except during erasure: we must take the expected type into account as it drives the insertion of casts! It's ok since we're typing the translation of well-typed code. The only "type errors" we catch are skolem mismatches. (after erasure the existential types that before caused problems have disappeared.) It's necessary to balance GADT magic, SI-6145, CPS type-driven transforms and other existential trickiness. I've exhausted all other semi-clean approaches I could think of: - the right thing to do -- packing existential types -- runs into limitations in subtyping existential types, - casting breaks SI-6145 (and it's an unnecessary cast at run time), - not casting breaks GADT typing as it requires sneaking ill-typed trees past typer
* | | | | | Merge pull request #1087 from hubertp/2.10.x-issue/5687Adriaan Moors2012-08-083-1/+72
|\ \ \ \ \ \ | | | | | | | | | | | | | | Fixes SI-5687.
| * | | | | | Fixes SI-5687.Hubert Plociniczak2012-08-083-1/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recover from erroneous type alias override to report more useful error message.
* | | | | | | Merge pull request #1073 from adriaanm/ticket-6183Adriaan Moors2012-08-081-2/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6183 don't crash on type error in outer test
| * | | | | | | SI-6183 don't crash on type error in outer testAdriaan Moors2012-08-071-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unfortunately without test case since the report was hard to minimize since it was a crash on erroneous code, I figured a backstop against a crash should suffice
* | | | | | | | Merge pull request #1056 from heathermiller/try-based-futuresAdriaan Moors2012-08-0812-349/+327
|\ \ \ \ \ \ \ \ | |_|_|_|/ / / / |/| | | | | | | Bases futures on Try instead of Either
| * | | | | | | Fix test for ExecutionContext.preparephaller2012-08-081-1/+1
| | | | | | | |
| * | | | | | | Doc fix on exec ctx prepare method, fix to testsHeather Miller2012-08-084-4/+6
| | | | | | | |
| * | | | | | | Added tests, removal of unnecessary methods, fixes prepareHeather Miller2012-08-075-29/+27
| | | | | | | |
| * | | | | | | Merge branch 'try-based-futures' of https://github.com/heathermiller/scala ↵Heather Miller2012-08-053-3/+78
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | into try-based-futures
| | * | | | | | | SI-6185 - add "prepare" hook to ExecutionContextphaller2012-08-053-3/+78
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables important abstractions to be built on top of futures, such as Twitter's "Local" for handling data local to a callback chain.
| * | | | | | | | Temporarily skips failing test due to optimizer bug SI-6188Heather Miller2012-08-052-6/+6
| |/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | Also swaps the arguments to method transform on Try, so as to mirror transform on scala.concurrent.Future.
| * | | | | | | Basing Futures on Try instead of EitherHeather Miller2012-08-0411-332/+235
| | | | | | | |
* | | | | | | | Merge pull request #1079 from scalamacros/ticket/5947Adriaan Moors2012-08-0823-31/+611
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | reflection now correctly supports inner classes and modules
| * | | | | | | | SI-5947 works around getDeclaredClassesEugene Burmako2012-08-0821-11/+597
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our name mangling scheme w.r.t stuff nested into objects conflicts with JVM's ideas of beauty, which messes up getDeclaredClasses. Scala reflection needs getDeclaredClasses to convert between Scala and Java, so the situation looked grim. Greg suggested a workaround described in: https://issues.scala-lang.org/browse/SI-4023?focusedCommentId=54759#comment-54759. Luckily the workaround worked!