summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* SI-8134 Address pull request feedbackJason Zaugg2014-02-021-6/+4
| | | | Aesthetics only.
* SI-5954 Add a TODO comment with an idea for future workJason Zaugg2014-01-211-0/+7
| | | | | | | | As the prophet once said: "'Tis better to never do at all than to have do and undo" Let's try that in 2.12.
* SI-5954 Invalidate TypeRef cache when opening package objectJason Zaugg2014-01-203-1/+12
| | | | | | | | | | | | | | | | | | | I noticed that the pos/5954d was tripping a println "assertion". This stemmed from an inconsistency between `TypeRef#{parents, baseTypeSeq}` for a package objects compiled from source that also has a class file from a previous compilation run. I've elevated the println to a devWarning, and changed `updatePosFlags`, the home of this evil symbol overwriting, to invalidate the caches in the symbols info. Yuck. I believe that this symptom is peculiar to package objects because of the way that the completer for packages calls `parents` during the Namer phase for package objects, before we switch the symbol to represent the package-object-from-source. But it seems prudent to defensively invalidate the caches for any symbol that finds its way into `updatePosFlags`.
* SI-8134 SI-5954 Fix companions in package object under separate comp.Jason Zaugg2014-01-203-32/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The tests cases enclosed exhibited two failures modes under separate compilation. 1. When a synthetic companion object for a case- or implicit-class defined in a package object is called for, `Namer#ensureCompanionObject` is used to check for an explicitly defined companion before decided to create a synthetic one. This lookup of an existing companion symbol by `companionObjectOf` would locate a symbol backed by a class file which was in the scope of the enclosing package class. Furthermore, because the owner of that symbol is the package object class that has now been noted as corresponding to a source file in the current run, the class-file backed module symbol is *also* deemed to be from the current run. (This logic is in `Run#compiles`.) Thinking the companion module already existed, no synthetic module was created, which would lead to a crash in extension methods, which needs to add methods to it. 2. In cases when the code explicitly contains the companion pair, we still ran into problems in the backend whereby the class-file based and source-file based symbols for the module ended up in the same scope (of the package class). This tripped an assertion in `Symbol#companionModule`. We get into these problems because of the eager manner in which class-file based package object are opened in `openPackageModule`. The members of the module are copied into the scope of the enclosing package: scala> ScalaPackage.info.member(nme.List) res0: $r#59116.intp#45094.global#28436.Symbol#29451 = value List#2462 scala> ScalaPackage.info.member(nme.PACKAGE).info.member(nme.List) res1: $r#59116.intp#45094.global#28436.Symbol#29451 = value List#2462 This seems to require a two-pronged defense: 1. When we attach a pre-existing symbol for a package object symbol to the tree of its new source, unlink the "forwarder" symbols (its decls from the enclosing package class. 2. In `Flatten`, in the spirit of `replaceSymbolInCurrentScope`, remove static member modules from the scope of the enclosing package object (aka `exitingFlatten(nestedModule.owner)`). This commit also removes the warnings about defining companions in package objects and converts those neg tests to pos (with -Xfatal-warnings to prove they are warning free.) Defining nested classes/objects in package objects still has a drawback: you can't shift a class from the package to the package object, or vice versa, in a binary compatible manner, because of the `package$` prefix on the flattened name of nested classes. For this reason, the `-Xlint` warning about this remains. This issue is tracked as SI-4344. However, if one heeds this warning and incrementatlly recompiles, we no longer need to run into a DoubleDefinition error (which was dressed up with a more specific diagnostic in SI-5760.) The neg test case for that bug has been converted to a pos.
* Merge pull request #3342 from xeno-by/topic/pres-compiler-macrosJason Zaugg2014-01-098-73/+58
|\ | | | | Presentation compiler friendliness for macros
| * Removes unnecessary generality in the macro engineEugene Burmako2014-01-085-62/+12
| | | | | | | | | | | | | | | | | | | | In Jan 2013, I submitted a number of pull requests that built up a foundation for the upcoming type macros pull request. Unfortunately, type macros ended up being rejected, but the extra generality introduced in advance still persisted in the compiler until now. This commit takes care of unused generality in the macro engine, keeping the internal implementation as well as the public API clean.
| * Use macro expandee, rather than expansion, in pres. compilerJason Zaugg2014-01-084-15/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The presentation compiler is primarily interested in trees that represent the code that one sees in the IDE, not the expansion of macros. This commit continues to expand macros, but adds a hook in which the presentation compiler discards the expansion, retaining instead the expandee. The expandee is attributed with the type of the expansion, which allows white box macros to work. In addition, any domain specific errors and warnings issued by the macro will still be reported, as a side-effect of the expansion. The failing test from the last commit now correctly resolves hyperlinks in macro arguments. Related IDE ticket: https://www.assembla.com/spaces/scala-ide/tickets/1001449# This facility is configured as follows: // expand macros as per normal -Ymacro-expand:normal // don't expand the macro, takes the place of -Ymacro-no-expand -Ymacro-expand:none // expand macros to compute type and emit warnings, // but retain expandee. Set automatically be the presentation // compiler -Ymacro-expand:discard This leaves to door ajar for a new option: // Don't expand blackbox macros; expand whitebox // but retain expandee -Ymacro-expand:discard-whitebox-only The existing test for SI-6812 has been duplicated. One copy exercises the now-deprecated -Ymacro-no-expand, and the other uses the new option.
| * SI-8064 Automatic position repair for macro expansionJason Zaugg2014-01-081-1/+25
| | | | | | | | | | - Replace NoPosition with the focus of the macro application - Focus all range positions, for example, those of spliced arguments
| * More robust hyperlink tests for the presentation compilerJason Zaugg2014-01-081-1/+1
| | | | | | | | Report null symbols in an civilised manner, rather than with a NPE.
* | Merge pull request #3332 from xeno-by/topic/existential-type-treeJason Zaugg2014-01-095-23/+33
|\ \ | | | | | | ExistentialTypeTree.whereClauses are now MemberDefs
| * | ExistentialTypeTree.whereClauses are now MemberDefsEugene Burmako2014-01-075-23/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Today’s flight back to Lausanne wasn’t as productive as the recent flight to Minsk (https://github.com/scala/scala/pull/3305), but I noticed one minor thingie: ExistentialTypeTree had an imprecise type specified for its whereClauses. This is now fixed. I didn’t increment PickleFormat.*Version numbers, because this change introduces only a miniscule incompatibility with what would have been a meaningless and most likely crash-inducing pickle anyway.
* | | Merge pull request #3336 from OlivierBlanvillain/patch-1Jason Zaugg2014-01-091-1/+1
|\ \ \ | | | | | | | | Fix typo in documentation
| * | | Fix typo in documentationOlivier Blanvillain2014-01-081-1/+1
| | | |
* | | | Merge pull request #3149 from soc/SI-7974Jason Zaugg2014-01-095-26/+53
|\ \ \ \ | | | | | | | | | | Fix broken 'Symbol-handling code in CleanUp
| * | | | SI-7974 Clean up and test 'Symbol-handling code in CleanUpSimon Ochsenreither2014-01-031-14/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Looks like the transformation did never happen because the pattern failed to match. Why did the pattern fail to match? Because the Symbol.apply we see in the tree claims to be a method while Symbol_apply defined in Definitions wants to be a value. This issue was caused because nonPrivateMember starts spitting out overloaded symbols after erasure. This issue has been fixed in the earlier commit, so what happens in this commit is adding tests and fixing documentation.
| * | | | SI-7974 Avoid calling nonPrivateMember after erasureSimon Ochsenreither2014-01-034-12/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One example were this would lead to subtle bugs otherwise is Symbol_apply, where after erasure an overloaded symbol containing Symbol#apply and UniquenessCache#apply is returned. // findMember considered harmful after erasure; e.g. // // scala> exitingErasure(Symbol_apply).isOverloaded // res27: Boolean = true
* | | | | Merge pull request #3269 from dotta/issue/si-4287Jason Zaugg2014-01-092-7/+15
|\ \ \ \ \ | | | | | | | | | | | | Issue/si 4287
| * | | | | SI-4827 Corrected positions assigned to constructor's default argMirco Dotta2014-01-082-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Default arguments are always retained on the <init> method (i.e., the class' constructor). Therefore, when the <init> parameters are created, we need to use `duplicateAndKeepPositions` to make sure that if a default argument is present, its opaque position is retained as well. This is necessary because when parameter accessors (i.e., `fieldDefs`) are created, all default arguments are discared ( as you can see in the code, the right-hand-side of a `field` is always an `EmptyTree`) - see changes in TreeGen.scala * When constructing the `fieldDefs`, it is important to adapt their range position to avoid overlappings with the positions of default arguments. It is worth noting that updating the field's end position to `vd.rhs.pos.start` would be incorrect, because `askTypeAt(pos)` could return the incorrect tree when the position is equal to `vd.rhs.pos.start` (because two nodes including that point position would exist in the tree, and `CompilerControl.locateTree(pos)` would return the first tree that includes the passed `pos`). This is why `1` is subtracted to `vd.rhs.pos.start`. Alternatively, we could have used `vd.tpt.pos.end` with similar results. However the logic would have become slightly more complex as we would need to handle the case where `vd.tpt` doesn't have a range position (for instance, this can happen if `-Yinfer-argument-types` is enabled). Therefore, subtracting `1` from `vd.rhs.pos.start` seemed the cleanest solution at the moment. - see changes in TreeGen.scala. * If the synthetic constructor contains trees with an opaque range position (see point above), it must have a transparent position. This can only happen if the constructor's parameters' positions are considered, which is why we are now passing `vparamss1` to `wrappingPos` - see changes in TreeGen.scala. * The derived primary constructor should have a transparent position as it may contain trees with an opaque range position. Hence, the `primaryCtor` position is considered for computing the position of the derived constructor - see change in Typers.scala. Finally, below follows the printing of the tree for test t4287, which you should compare with the one attached with the previous commit message: ``` [[syntax trees at end of typer]] // Foo.scala [0:63]package [0:0]<empty> { [0:37]class Baz extends [9:37][39]scala.AnyRef { [10:20]<paramaccessor> private[this] val f: [14]Int = _; [14]<stable> <accessor> <paramaccessor> def f: [14]Int = [14][14]Baz.this.f; <10:31>def <init>(<10:31>f: [17]<type: [17]scala.Int> = [23:31]B.a): [9]Baz = <10:31>{ <10:31><10:31><10:31>Baz.super.<init>(); <10:31>() } }; [6]<synthetic> object Baz extends [6][6]AnyRef { [6]def <init>(): [9]Baz.type = [6]{ [6][6][6]Baz.super.<init>(); [9]() }; [14]<synthetic> def <init>$default$1: [14]Int = [30]B.a }; [39:63]object B extends [48:63][63]scala.AnyRef { [63]def <init>(): [48]B.type = [63]{ [63][63][63]B.super.<init>(); [48]() }; [52:61]private[this] val a: [56]Int = [60:61]2; [56]<stable> <accessor> def a: [56]Int = [56][56]B.this.a } } ``` You should notice that the default arg of `Baz` constructor now has a range position. And that explains why the associated test now returns the right tree when asking hyperlinking at the location of the default argument.
* | | | | | Merge pull request #3338 from gourlaysama/t7491Jason Zaugg2014-01-091-6/+6
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7491 fix typo in scala.App documentation
| * | | | | | SI-7491 deprecate overriding App.main and clarify documentationAntoine Gourlay2014-01-081-6/+6
| | |_|/ / / | |/| | | | | | | | | | | | | | | | App.main should never be overridden, so let's enforce it.
* | | | | | SI-7859 fix AnyVal.scala scaladoc.xuwei-k2014-01-091-1/+1
| |_|_|_|/ |/| | | | | | | | | | | | | | Value class member need not be public in 2.11+
* | | | | Merge pull request #3235 from xeno-by/topic/macro-plugin-interfaceEugene Burmako2014-01-086-226/+455
|\ \ \ \ \ | |/ / / / |/| | | | new hooks in AnalyzerPlugins to enable macro experimentation
| * | | | hooks for naming and synthesis in Namers.scala and Typers.scalaEugene Burmako2013-12-307-49/+81
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Interestingly enough, despite of the implementation surface being quite noticeable, it is enough to hijack just `enterSym` and typechecking of stats for packages, templates and blocks in order to enable macro annotations. That and `ensureCompanionObject`, which I couldn't abstract away so far. An architectural note: given that a hooked method is called `X`, there are two implementations of this method. `pluginsX` is defined in AnalyzerPlugins.scala and lets macro plugins customize `X`. `standardX` is defined next to `X` and provides a default implementation. Finally `X` is changed to trivially forward to `pluginsX`. Existing and future callers of `X` now can be completely oblivious of the introduced hooks, because calls to `X` will continue working and will be correctly hooked. This makes the infrastructure more robust. The only downside is that in case when a macro plugin wants to call into the default implementation, it needs to call `standardX`, because `X` will lead to a stack overflow. However, in my opinion this not a big problem, because such failures are load and clear + for every `pluginsX` we actually provide documentation that says what is its standard impl is.
| * | | | unprivates important helpers in Namers.scalaEugene Burmako2013-12-305-33/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first of two commits that enable hooks necessary to implement macro annotations in an honest, hackless compiler plugin. This particular commit turns certain helpers into public methods. Of course, there is a probability that with the evolution of macro paradise, I will need more helper methods, and those will have to be called via reflection, but at least for now it's nice to have a reflection-less plugin :)
| * | | | manifests that Namers.mkTypeCompleter is flag-agnosticEugene Burmako2013-12-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When introducing `FlagAgnosticCompleter` and `FlagAssigningCompleter`, I have overlooked the completers created in namers. These completers only assign type signatures, not flags, because they are only created for symbols originating from sources and such symbols have their flags assigned based on modifiers and source def trees when they are entered.
| * | | | humane reporting of macro impl binding version errorsEugene Burmako2013-12-302-11/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Macro defs are linked to macro impls by the virtue of MacroImplBinding structures that are persisted between compilation runs serialized within instances of macroImpl annotations. Along with the evolution of our macro engine, we sometimes have to evolve the format of MacroImplBinding, which means that it has to be versioned. Version mismatches are checked upon every macro expansion, ensuring that macros that we expand were compiled with exactly the same version of the macro engine that we’re running. That’s all really cool apart from the fact that version mismatches result in aborting the entire compilation with an obscure message without giving a hint about the culprits. This commit improves the situation by providing pretty per-expansion compilation errors that tell the programmer what macro expansions are at fault and what macro engines were used to compile them.
| * | | | hooks for typecheck and expansion of macro defsEugene Burmako2013-12-304-10/+146
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Creates MacroPlugin, a sister interface of AnalyzerPlugin in the namer/typer extensibility interface. Exposes `pluginsTypedMacroBody`, `pluginsMacroExpand`, `pluginsMacroArgs` and `pluginsMacroRuntime` in the macro plugin interface. This will make it easy to prototype changes to the macro engine without disturbing scala/scala.
| * | | | unprivates important helpers in Macros.scalaEugene Burmako2013-12-301-119/+114
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first commit in a pull request that makes macro engine extensible by analyzer plugins. Such helpers as `macroArgs` and `macroExpandWithRuntime` have proven to be indispensable in macro paradise, so it’ll be important to have them available to macro plugins.
| * | | | removes some copy/paste from AnalyzerPluginsEugene Burmako2013-12-301-37/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Abstracts away the foldLeft-based iteration pattern behind CumulativeOp[T]. In order to avoid performance regressions, `pluginsPt` and `pluginsTyped` are special-cased for empty lists of analyzer plugins.
| * | | | gives a more specific signature to `computeMacroDefType`Eugene Burmako2013-12-302-13/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I guess having `computeMacroDefType` is the remnant from the times when we considered an immediate possibility of having non-defdef macros, for instance type macros, which would be TypeDefs. These happy early days are gone, type macros have been long buried, and the perspectives of extensions to the existing def macro scheme are unclear. Therefore let’s have maximally precise types right away and then think of generalization later on, once/if we get there.
| * | | | macroExpandApply => macroExpandEugene Burmako2013-12-302-19/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Back then, when we needed separate macro expanders for both applications and unapplications, it made sense to have two different methods that do macro expansions. However, after @paulp’s upgrade of the pattern matching engine, we no longer need a dedicated expander for unapply, so I’m removing it and renaming `macroExpandApply` to just `macroExpand`.
* | | | | Merge pull request #3289 from soc/SI-7492-reduxJason Zaugg2014-01-081-4/+4
|\ \ \ \ \ | | | | | | | | | | | | SI-7492 Make scala.runtime.MethodCache private[scala]
| * | | | | SI-7492 Make scala.runtime.MethodCache private[scala]Simon Ochsenreither2013-12-191-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These are internal implementation details which shouldn't be exposed to users (and might go away when support for invokedynamic is added).
* | | | | | Merge pull request #3331 from retronym/ticket/8120Jason Zaugg2014-01-081-1/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8120 Avoid tree sharing when typechecking patmat anon functions
| * | | | | | SI-8120 Avoid tree sharing when typechecking patmat anon functionsJason Zaugg2014-01-071-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When typechecking an empty selector `Match` corresponding to: { case ... => ... }: (A => B) We wrap it in a `Function` and typecheck: (x$1 => x$1 match { case ... => ... }) Local symbols in this expression (representing values bound by the pattern, or just definitions in the body or guard) are then owned by the anonymous function's symbol. However, if we ever discard this `Function` and start anew with the empty selector match, as happens during the fallback to use a view on the receiver in `tryTypedApply`, we found that we had mutated the cases of the original tree, and allowed orphaned local symbols to escape into the compiler pipeline. This commit uses duplicated trees for the the cases in the synthetic `Match` to avoid this problem. `duplicateAndKeepPositions` is used to preserve range positions; without this scala-refactoring PrettyPrinterTest fails. `Tree#duplicate` uses offset positions in the copied tree, which is appropriate when both the original and the copy are going to end up in the final tree.
* | | | | | | Merge pull request #3325 from clhodapp/fix/double.absJason Zaugg2014-01-081-0/+4
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix (postfix abs for -0.0)
| * | | | | | | SI-8102 -0.0.abs must equal 0.0clhodapp2014-01-061-0/+4
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-8102 points out that -0.0.abs returns -0.0 (in error). The same issue exists for -0.0f. This commit fixes the issue for both by delegating to math.abs.
* | | | | | | Merge pull request #3301 from Ichoran/issue/7837Jason Zaugg2014-01-081-2/+2
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Resolves SI-7837, failure in quickSort.
| * | | | | | | SI-7837 quickSort, along with Ordering[K], may result in stackoverflow ↵Rex Kerr2013-12-311-2/+2
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | because the code uses '==' instead of 'equiv' == instead of equiv (from Ordering) was used by mistake. Fixed. Also created a test to make sure that == is not used by throwing an exception if it is (as suggested by Jason).
* | | | | | | Merge pull request #3305 from xeno-by/topic/copy-untypedJason Zaugg2014-01-084-49/+71
|\ \ \ \ \ \ \ | |_|/ / / / / |/| | | | | | awakens default getter synthesis from the untyper nightmare
| * | | | | | untyper is no moreEugene Burmako2014-01-071-36/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike with default getters, removing untyper from case class synthesis was trivial. Just resetLocalAttrs on a duplicate of the provided class def, and that’s it. resetAllAttrs, you’re next. We’ll get to you! Eventually...
| * | | | | | awakens default getter synthesis from the untyper nightmareEugene Burmako2014-01-074-40/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our happy little macro paradise is regularly invaded by resetAllAttrs, the bane of all macros and typers. It’s so ruthless and devastating that we’ve been long scheming to hack something really cool and to one day defeat it. Today we make the first step towards the happy future. Today we overthrow the UnTyper, resetAllAttrs’s elder brother that rules in the kingdoms of GetterLand and CaseClassia, and banish him from the land of getters. In the name of what’s good and meta, let’s band together and completely drive him away in a subsequent pull request! To put it in a nutshell, instead of using untyper on a DefDef to do default getter synthesis, the commit duplicates the DefDef and does resetLocalAttrs on it. As default getter synthesis proceeds with figuring out type and value parameters for the getter, then its tpt and finally its rhs, the commit destructures the duplicated DefDef and then assembles the default getter from the destructured parts instead of doing copyUntyped/copyUntypedInvariant on the original DefDef. I would say the test coverage is pretty good, as I had to figure out 3 or 4 test failures before I got to the stage when everything worked. Iirc it tests pretty exotic stuff like polymorphic default parameters in both second and third parameter lists, so it looks like we're pretty good in this department.
* | | | | | | Merge pull request #3313 from OlivierBlanvillain/upstreamJason Zaugg2014-01-034-4/+4
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | Fix typos in documentation
| * | | | | | Fix typos in documentationOlivier Blanvillain2013-12-284-4/+4
| |/ / / / /
* | | | | | Merge pull request #3284 from soc/SI-7880Jason Zaugg2014-01-031-9/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7880 Fix infinite loop in ResizableArray#ensureSize
| * | | | | | SI-7880 Fix infinite loop in ResizableArray#ensureSizeSimon Ochsenreither2013-12-231-9/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue was triggered for values greater than Int.MaxValue/2, which caused the computation of the new array size to overflow and become negative, leading to an infinite loop.
* | | | | | | Merge pull request #3239 from soc/SI-8052Jason Zaugg2014-01-032-4/+11
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8052 Disallow `macro` as an identifier
| * | | | | | | SI-8052 Disallow `macro` as an identifierSimon Ochsenreither2013-12-092-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Note that the change could look a lot cleaner, at the cost of returning more generic error messages. I decided that at least for 2.11 I'll keep scalac remembering that macro was a standard identifier name once, so that we can point out more precisely what's wrong with users' code.
* | | | | | | | Merge pull request #3245 from densh/si/8047Jason Zaugg2014-01-034-13/+26
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-8047 change fresh name encoding in quasiquotes to avoid symbol owner corruption
| * | | | | | | | SI-8047 change fresh name encoding to avoid owner corruptionDen Shabalin2013-12-164-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously a following encoding was used to represent fresh names that should be created at runtime of the quasiquote: build.withFreshTermName(prefix1) { name$1 => ... build.withFreshTermName(prefixN) { name$N => tree } ... } It turned out that this encoding causes symbol corruption when tree defines symbols of its own. After being spliced into anonymous functions, the owner chain of those symbols will become corrupted. Now a simpler and probably better performing alternative is used instead: { val name$1 = universe.build.freshTermName(prefix1) ... val name$N = universe.build.freshTermName(prefixN) tree } Here owner stays the same and doesn’t need any adjustment.