summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | SI-8133 Fix regression with package objects, overloadingJason Zaugg2014-01-143-6/+11
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regressed in f5c336d56, a refactoring of `typedIdent`. In that commit, an (ostensibly) accidental change arrived, equivalent to: - val pre1 = if (qual == EmptyTree) NoPrefix else if (sym.isTopLevel) sym.owner.thisType else qual.tpe + val pre1 = if (sym.isTopLevel) sym.owner.thisType else if (qual == EmptyTree) NoPrefix else qual.tpe Here, `qual` is a tree returned in the successful result of `Context#lookup`. This change itself looks innocuous (top level symbols can be prefixed with a qualifier or not, right?), but it exposed us to a bug in `makeAccessible`. It is responsible for rewriting, e.g, `scala.List` to `scala.package.List`. It has a few cases, but one of them relies relies on typechecking `Ident(nme.PACKAGE)`, and hoping that it will bind to the right place. That's fraught with danger, and breaks in the enclosed tests. This commit binds that Ident symbolically, and in the process factors a tiny bit of code in common with `TreeGen`. (More work is still needed here!) In the next commit, I'm going to revert the change to `pre1`. That would have also fixed the regression, albeit symptomatically.
* | | | | | Merge pull request #3385 from xeno-by/ticket/8158Eugene Burmako2014-01-206-18/+43
|\ \ \ \ \ \ | |_|_|/ / / |/| | | | | fixes some typos and types
| * | | | | temporarily disables the toStringSubjects cacheEugene Burmako2014-01-201-7/+12
| | | | | |
| * | | | | addresses pull request feedbackEugene Burmako2014-01-201-1/+1
| | | | | |
| * | | | | capitalizes “s” in tostringEugene Burmako2014-01-203-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As suggested by the reviewers, tostringXXX variables in TypeToStrings.scala have been renamed to toStringXXX.
| * | | | | introduces failsafe against endless type printingEugene Burmako2014-01-203-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parent commit works around a particular problem that led to a compiler freeze in SI-8158, whereas this commit introduces a general solution - a cache that tracks all types that we've recursed into during printing. I can't immediately come up with an example of a type that would be caught by this safety net, but unknown unknowns are the worst of them all, so why not guard against them while we can.
| * | | | | SI-8158 compiler hangs printing out fancy typesEugene Burmako2014-01-201-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, even though the compiler has safeguards against infinite type printouts, having a depth counter, we didn’t account for the cases when printouts are both self-referential and self-multiplying. For one, SI-8158 provides an example of such a type, which is a structural type that refers to itself twice in return types of its methods. At first, printing such a type would go deeper and deeper, but then it will hit the depth limit and start multiply indefinitely. This commit fixes this particular problem by recognizing self-references as this.type’s and printing them out as such. The subsequent commit will introduce a more general facility.
| * | | | | fixes a typo in Types.scalaEugene Burmako2014-01-191-1/+1
| | | | | |
| * | | | | quasiquotes no longer evaluate debug logs when debug logging is offEugene Burmako2014-01-191-2/+2
| | | | | |
* | | | | | Merge 2.10.x into masterAdriaan Moors2014-01-181-5/+7
|\ \ \ \ \ \ | |/ / / / / |/| | | | |
| * | | | | Merge pull request #3356 from retronym/ticket/8138Jason Zaugg2014-01-181-5/+7
| |\ \ \ \ \ | | | | | | | | | | | | | | Fix bug with super-accessors / dependent types
| | * | | | | SI-8143 Fix bug with super-accessors / dependent typesJason Zaugg2014-01-121-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Super-accessors are generated as `DefDef`'s with `EmptyTree` as a placeholder for the RHS. This is filled in later in `Mixin` in `completeSuperAccessor`. A change in `Uncurry` (SI-6443 / 493197f), however, converted this to a `{ EmptyTree }`, which evaded the pattern match in mixin. This commit adds a special case to the dependent method treatment in Uncurry to avoid generating redundant blocks.
| * | | | | | Merge pull request #3364 from retronym/ticket/8152Jason Zaugg2014-01-151-3/+5
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | [nomaster] Backport variance validator performance fix
| | * | | | | | [nomaster] SI-8152 Backport variance validator performance fixJason Zaugg2014-01-141-3/+5
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | % time qbin/scalac test/files/pos/t8146-performance.scala real 0m2.015s user 0m2.892s sys 0m0.215s % time scalac-hash v2.10.3 test/files/pos/t8146-performance.scala real 1m13.652s user 1m14.245s sys 0m0.508s Cherry-picks one hunk from 882f8e64.
* | | | | | | Merge pull request #3383 from adriaanm/merge-2.10.xAdriaan Moors2014-01-189-16/+53
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Merge 2.10.x
| * | | | | | | Merge commit 'd5801b9eee' from 2.10.x into masterAdriaan Moors2014-01-171-0/+23
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| | * | | | | | Merge pull request #3328 from retronym/ticket/8111v2.10.4-RC2Jason Zaugg2014-01-121-0/+23
| | |\ \ \ \ \ \ | | | |/ / / / / | | |/| | | | | Repair symbol owners after abandoned named-/default-args
| | | * | | | | SI-8111 Expand the comment with a more detailed TODOJason Zaugg2014-01-081-3/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As everone knows, undo/reset/retype/rollback are bandaids; we should try to treat the disease more directly.
| | | * | | | | SI-8111 Repair symbol owners after abandoned named-/default-argsJason Zaugg2014-01-061-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Names/Defaults eagerly transforms an application with temporaries to maintain evaluation order, and dutifully changes owners of symbols along the way. However, if this approach doesn't work out, we throw away this and try a auto-tupling. However, we an still witness symbols owned by the temporaries. This commit records which symbols are owned by the context.owner before `transformNamedApplication`, and rolls back the changes before `tryTupleApply`. Perhaps a better approach would be to separate the names/defaults applicability checks from the evaluation-order-preserving transform, and only call the latter after we have decided to go that way.
| | * | | | | | Merge pull request #3345 from retronym/ticket/8114Jason Zaugg2014-01-111-1/+26
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | [nomaster] Binary compat. workaround for erasure bug
| | | * | | | | | [nomaster] SI-8114 Binary compat. workaround for erasure bug SI-7120Jason Zaugg2014-01-091-1/+26
| | | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't backport SI-7120 to 2.10.x as it changes erased signatures, which can lead to interop problems between 2.10.3 and 2.10.4. But, we can detect one of the nasty symptoms -- a bridge method with the same signature as its target -- and treat that. This commit detects duplicate bridges in the ASM (only) backend and removes them.
| | * / / / / / More clear implicitNotFound error for ExecutionContextJames Ward2014-01-081-1/+1
| | |/ / / / /
| * | | | | | Merge commit '97b9b2c06a' from 2.10.x into masterAdriaan Moors2014-01-178-16/+30
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check files updated: test/files/presentation/t8085*.check Conflicts: build.xml src/compiler/scala/tools/nsc/ast/parser/Parsers.scala src/compiler/scala/tools/nsc/symtab/classfile/ICodeReader.scala
| | * | | | | SI-8085 Fix BrowserTraverser for package objectsJason Zaugg2013-12-181-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A source file like: import foo.bar package object baz Is parsed into: package <empty> { import foo.bar package baz { object `package` } } A special case in Namers compensates by adjusting the owner of `baz` to be `<root>`, rather than `<empty>`. This wasn't being accounted for in `BrowserTraverser`, which underpins `-sourcepath`, and allows the presentation compiler to load top level symbols from sources outside those passes as the list of sources to compile. This bug did not appear in sources like: package p1 package object p2 { ... } ... because the parser does not wrap this in the `package <empty> {}` This goes some way to explaining why it has gone unnoticed for so long.
| | * | | | | Report error on code size overflow, log method name.Adriaan Moors2013-12-122-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We used to silently skip class files that would exceed the JVM's size limits. While rare, this should still be an error. While I was at it, also included the name of the offending method.
| | * | | | | Merge pull request #3261 from adriaanm/ticket-6426Adriaan Moors2013-12-112-6/+6
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | Revert ", importable _."
| | | * | | | | Revert "SI-6426, importable _."Adriaan Moors2013-12-102-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit d2316df920ffa4804fe51e8f8780240c46efa982. We can't make `_` an illegal identifier -- it's legal in Java, so we must be able to name these Java underscores.
| | * | | | | | Merge pull request #3253 from retronym/ticket/8062Adriaan Moors2013-12-113-5/+11
| | |\ \ \ \ \ \ | | | |/ / / / / | | |/| | | | | Fix inliner cycle with recursion, separate compilation
| | | * | | | | SI-8062 Fix inliner cycle with recursion, separate compilationJason Zaugg2013-12-103-5/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ICodeReaders, which decompiles JVM bytecode to ICode, was not setting the `recursive` attribute of `IMethod`. This meant that the inliner got into a cycle, repeatedly inlining the recursive call. The method name `filter` was needed to trigger this as the inliner heuristically treats that as a more attractive inlining candidate, based on `isMonadicMethod`. This commit: - refactors the checking / setting of `virtual` - adds this to ICodeReaders - tests the case involving `invokevirtual` I'm not sure how to setup a test that fails without the other changes to `ICodeReader` (for invokestatic and invokespecial).
* | | | | | | | Merge pull request #3381 from retronym/topic/debug-friendlinessEugene Burmako2014-01-182-2/+4
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Fix compilation under -Ydebug
| * | | | | | | Don't trace the low-level details of ResetAttrs under -YdebugJason Zaugg2014-01-171-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This need for this output is highly situational and since we've starting using this resettter in case classes and names/defaults, it is polluting our consoles.
| * | | | | | | Avoid cycles in Symbol toString under -YdebugJason Zaugg2014-01-171-1/+1
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is the first of two commits to restore workingness to the compiler under `-Ydebug`. `ResetAttrs` is now called during case class unapply synthesis, after the UnTyper was recently banished. But, this class has some low-level tracing that is triggered under `-Ydebug` (irrespective of any `-Ylog` settings.) This tracing code calls `Symbol#toString`, which, in an attempt to discriminate primary from secondary constructors, accesses the info of its owner. This is sufficient to hit a dreaded `CyclicReferenceError`. The enclosed test compiles a case class under this option to show that things now compile. It still spews out unwanted output; this will be removed in the next commit.
* | | | | | | Merge pull request #3377 from VladimirNik/sprinter-eol-fixAdriaan Moors2014-01-171-5/+7
|\ \ \ \ \ \ \ | |_|_|_|_|/ / |/| | | | | | Fix EOL-printing in Printers test suite
| * | | | | | Problem with EOL in tests for Printers is fixedVladimirNik2014-01-171-5/+7
| | | | | | |
* | | | | | | Merge pull request #3378 from Blaisorblade/patch-1Adriaan Moors2014-01-171-1/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Fix typo
| * | | | | | | Fix typoPaolo G. Giarrusso2014-01-171-1/+1
| |/ / / / / / | | | | | | | | | | | | | | In `for inner classes `val mm2 = im.reflectClass(<module symbol>)``, `<module symbol>` should read `<class symbol>`.
* | | | | | | Merge pull request #3373 from densh/topic/std-liftable-refinementAdriaan Moors2014-01-175-30/+38
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | A few minor changes to standard liftable instances and liftable support
| * | | | | | | Test edge cases of literal liftingDen Shabalin2014-01-161-10/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously in some corner situation proper Liftable instance might not have been resolved. In particular q"${true}" and q"${""}" used to fail.
| * | | | | | | Give better names to UnliftHelper1 and UnliftHelper2Denys Shabalin2014-01-164-14/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous ones were inscrutable but thankfully @xeno_by helped me out to find better alternatives.;
| * | | | | | | Lift Some, None, Nil, Left, Right not just supertypesDenys Shabalin2014-01-161-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously leaf concrete types were not lifted which could have caused weird problems when types is too precise: val s1 = Some(2) q"$s1" // used to fail
| * | | | | | | Remove redundant asInstanceOf for liftableDen Shabalin2014-01-161-2/+1
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previous encoding of Liftables which had universe passed in as a parameter required a cast to solve path-dependant madness problems: trait OldLiftable[T] { def apply(u: Universe, v: T): u.Tree } In this case compiler wasn't smart enough to find out that liftFoo(universe, foo) returns the same type of tree we were working with (universe.Tree) and we had to cast to make it work: liftFoo(universe, foo).asInstanceOf[universe.Tree] Now this cast is redundant as universe is not a parameter of Liftable's apply.
* | | | | | | Merge pull request #3380 from retronym/ticket/8157Adriaan Moors2014-01-171-5/+1
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Make overloading, defaults restriction PolyType aware
| * | | | | | | SI-8157 Make overloading, defaults restriction PolyType awareJason Zaugg2014-01-171-5/+1
| | |_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Named/Default args levies an implementation restriction that only one overloaded alternative may declare defaults. But, this restriction failed to consider polymorphic methods. Rather than matching on MethodType, this commit uses `Type#paramms`, which handles PolyTypes and curried MethodTypes in one fell swoop.
* | | | | | | Merge pull request #3283 from paulp/pr/dotless-targsAdriaan Moors2014-01-172-11/+23
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Dotless type application for infix operators.
| * | | | | | Dotless type application for infix operators.Paul Phillips2013-12-172-11/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When you have an aesthetic expresion like def f(xs: Iterator[Int]) = ( xs takeWhile (_ < 1000) map (_ * -1) filter (_ % 2 == 0) flatMap (x => List(x, x)) reduceOption (_ + _) maxBy (_.toString) ) And then for whatever reason you have to perform explicit type application in the midst of that expression, it's aggravating in the extreme that it has (had) to be rewritten in its entirety to accommodate that change. So now you can perform type application in the middle of it. For reasons not entirely clear to me postfix operators are excluded. The discussion as well as the approval for the infix variation of it can be found at: https://groups.google.com/forum/#!msg/scala-language/eJl1wnkEz9M/hR984-lqC5EJ
* | | | | | | Merge pull request #3354 from xeno-by/topic/enclosing-xxxEugene Burmako2014-01-173-5/+51
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | deprecates c.enclosingTree-style APIs
| * | | | | | deprecates c.enclosingTree-style APIsEugene Burmako2014-01-163-5/+51
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Existing enclosing tree macro APIs face both technical and philosophical problems. On the one hand, it’s close to impossible to provide their robust implementation within the current typer infrastructure. From the very beginning, these APIs have been very experimental, and I was very much hoping to tackle the underlying technical problems, but after a year and a half I can say that it’s still outside our reach. On the other hand, we’re gravitating towards increasingly more local macro expansion, which is in direct contradiction with the existence of c.enclosingTree APIs. Therefore, in order to be able to further evolve macros, we need need additional freedom to reshape the enclosing tree APIs. Therefore I suggest we deprecate the aforementioned APIs and start preparing ourselves to removing them for good in 2.12.0. I hope that existing macros that use these APIs can be reformulated in terms of completely local expansion or be built on top of orthogonal language features (existing ones or new ones, e.g. something like https://groups.google.com/forum/#!topic/scala-debate/f4CLmYShX6Q). Please share your use cases, and I will be glad to help! We have at least the entire 2.12 development cycle ahead of us, so I’m sure we’ll figure this out. Let’s shape robust and scalable reflection API together!
* | | | | | Merge pull request #3322 from rklaehn/issue/6253Ichoran2014-01-161-14/+511
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6253 HashSet should implement union
| * | | | | | SI-6253 HashSet should implement unionRüdiger Klaehn2014-01-161-14/+511
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implements of HashSet.union that reuses the two trees as much as possible when calculating the union of two sets. This leads to significant performance improvements as well as to much better structural sharing. There is a comprehensive correctness test for union since there was not a single test for HashSet.union before. In addition, there are some tests of the desirable properties of the new implementation (structural sharing and efficiency regarding calls of key.hashCode). The other operations diff and intersect, which are conceptually very similar to union, are also implemented along with comprehensive test cases for both correctness and structural sharing. Note that while it appears that there is some code duplication between the three methods, they are sufficiently different that it is not possible to merge them into one without sacrificing performance.
* | | | | | Merge pull request #3278 from magarciaEPFL/backendish48Adriaan Moors2014-01-167-19/+50
|\ \ \ \ \ \ | | | | | | | | | | | | | | improvements to GenBCode