summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
| * | | | | | | | introduces an exhaustive java-to-scala testEugene Burmako2013-02-053-17/+262
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Originally composed to accommodate pull request feedback, this test has uncovered a handful of bugs in FromJavaClassCompleter, namely: * SI-7071 non-public ctors get lost * SI-7072 inner classes are read incorrectly I'm leaving the incorrect results of FromJavaClassCompleters in the check file, so that we get notified when something changes there.
| * | | | | | | | SI-6989 privateWithin is now populated in reflectEugene Burmako2013-02-043-0/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Runtime reflection in JavaMirrors previously forgot to fill in privateWithin when importing Java reflection artifacts. Now this is fixed.
* | | | | | | | | Merge commit '558c059227' into merge-210Paul Phillips2013-02-092-0/+12
|\ \ \ \ \ \ \ \ \ | | |_|_|_|/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * commit '558c059227': SI-7060 More conservative dead code elim marking Conflicts: src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala
| * | | | | | | | Merge pull request #2059 from VladUreche/issue/7060James Iry2013-02-062-0/+12
| |\ \ \ \ \ \ \ \ | | |_|/ / / / / / | |/| | | | | | | SI-7060 More conservative dead code elim marking
| | * | | | | | | SI-7060 More conservative dead code elim markingVlad Ureche2013-02-052-0/+12
| | | |_|_|/ / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In dead code elimination, a DROP instruction that gets marked as useful and can be reached via several paths needs to also mark all the reaching definitions as useful, else we'll get unbalanced stacks on the two paths. A simplistic example: ``` BB1: CALL X // useful, leaves a LONG on the stack JUMP BB3 BB2: LOAD_FIELD Y // not useful JUMP BB3 BB3: DROP LONG // useful because "CALL X" is useful // but unless we mark "LOAD_FIELD Y" as useful too // we'll get unbalanced stacks when reaching BB3 ``` This patch addresses the unbalanced stack problem by adding all the reaching definitions of a useful DROP as useful instructions too.
* | | | | | | | Merge commit '81d8f9d3da' into merge-210Paul Phillips2013-02-0953-128/+599
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * excluded from merge: [nomerge] SI-6667 Demote a new ambiguity error to a lint warning. Revert "SI-6422: add missing Fractional and Integral alias in scala package" [backport] SI-6482, lost bounds in extension methods. * commit '81d8f9d3da': (31 commits) reflecting @throws defined in Scala code pullrequest feedback SI-5833 Fixes tail-of-Nil problem in RefinedType#normalizeImpl SI-6017 Scaladoc: Show all letters without dangling links SI-6017 Generate Scaladoc's index links in Scala side SI-5313 Minor code cleanup for store clobbering SI-5313 Test clobbers on the back edge of a loop SI-7033 Be symful when creating factory methods. SI-7022 Additional test case for value class w. bounds SI-7039 unapplySeq result type independent of subpattern count evicts javac-artifacts.jar SI-7008 @throws annotations are now populated in reflect Fix SI-6578. Deprecated `askType` because of possible race conditions in type checker. SI-7029 - Make test more robust SI-7029 - Makes sure that uncaught exceptions are propagated to the UEH for the global ExecutionContext SI-6941 tests SI-6686 drop valdef unused in flatMapCond's block ... Conflicts: src/compiler/scala/tools/nsc/backend/opt/DeadCodeElimination.scala src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala src/reflect/scala/reflect/internal/Definitions.scala
| * | | | | | | Merge pull request #2051 from adriaanm/ticket-7039Adriaan Moors2013-02-042-0/+12
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7039 unapplySeq result type independent of subpattern count
| | * | | | | | | SI-7039 unapplySeq result type independent of subpattern countAdriaan Moors2013-02-012-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixes a bug in the implementation of the `unapplySeq` part of the spec below. An `unapply` method with result type `R` in an object `x` matches the pattern `x(p_1, ..., p_n)` if it takes exactly one argument and, either: - `n = 0` and `R =:= Boolean`, or - `n = 1` and `R <:< Option[T]`, for some type `T`. The argument pattern `p1` is typed in turn with expected type `T`. - Or, `n > 1` and `R <:< Option[Product_n[T_1, ..., T_n]]`, for some types `T_1, ..., T_n`. The argument patterns `p_1, ..., p_n` are typed with expected types `T_1, ..., T_n`. An `unapplySeq` method in an object `x` matches the pattern `x(p_1, ..., p_n)` if it takes exactly one argument and its result type is of the form `Option[S]`, where either: - `S` is a subtype of `Seq[U]` for some element type `U`, (set `m = 0`) - or `S` is a `ProductX[T_1, ..., T_m]` and `T_m <: Seq[U]` (`m <= n`). The argument patterns `p_1, ..., p_n` are typed with expected types `T_1, ..., T_m, U, ..., U`. Here, `U` is repeated `n-m` times.
| * | | | | | | | Merge pull request #2063 from retronym/ticket/6667-2.10.x-revertAdriaan Moors2013-02-044-2/+6
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | [nomerge] SI-6667 Demote a new ambiguity error to a lint warning.
| | * | | | | | | | [nomerge] SI-6667 Demote a new ambiguity error to a lint warning.Jason Zaugg2013-02-044-2/+6
| | | |_|_|_|_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the interests of not breaking source compability. A few projects are relying on this bug. Should not be merged to master.
| * | | | | | | | Merge pull request #2050 from kzys/jira-6017-v2Adriaan Moors2013-02-041-0/+5
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-6017 Scaladoc: Fix dangling links on index.html
| | * | | | | | | | SI-6017 Scaladoc: Show all letters without dangling linksKato Kazuyoshi2013-02-031-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use <span> instead of <a href="..."> if there is no page on the letter.
| | * | | | | | | | SI-6017 Generate Scaladoc's index links in Scala sideKato Kazuyoshi2013-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no reason to do it in JavaScript.
| * | | | | | | | | Merge pull request #2040 from scalamacros/ticket/7008Adriaan Moors2013-02-0420-6/+203
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7008 @throws annotations are now populated in reflect
| | * | | | | | | | | reflecting @throws defined in Scala codeEugene Burmako2013-02-044-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As per Jason's comment: How are Scala classes containing @throws annots treated? I can't figure out whether we pickle the annotation in addition to adding the exception to the signature. If we do, might we end up with duplicate annotations in runtime reflection? This warrants a test. See the context of the discussion here: https://github.com/scala/scala/pull/2040/files#r2874769. No, we won't end up with duplicates, because classes defined in Scala are loaded in a different completer. But I'll add a test - you can never have too many of those.
| | * | | | | | | | | evicts javac-artifacts.jarEugene Burmako2013-02-0115-8/+141
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently, the usual _1, _2, _3... naming scheme also works for java files, which need to be compiled together with partests. This allows us to get rid of javac-artifacts.jar.
| | * | | | | | | | | SI-7008 @throws annotations are now populated in reflectEugene Burmako2013-02-014-1/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Runtime reflection in JavaMirrors previously forgot to fill in @throws when importing Java reflection artifacts. Now this is fixed. Note that generic exception types used in `throws` specifications will be garbled (i.e. erased), because we don't use `getGenericExceptionTypes` in favor of just `getExceptionTypes` to stay compatible with the behavior of ClassfileParser. That's a bug, but a separate one and should be fixed separately. Also note that this commit updated javac-artifacts.jar, because we need to test how reflection works with javac-produced classfiles. The sources that were used to produce those classfiles can be found in the jar next to the classfiles.
| * | | | | | | | | | Merge pull request #1992 from retronym/ticket/7033Adriaan Moors2013-02-041-0/+15
| |\ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|/ / / / / | |/| | | | | | | | | SI-7033 Be symful when creating factory methods.
| | * | | | | | | | | SI-7033 Be symful when creating factory methods.Jason Zaugg2013-02-021-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Implicit class factory methods were synthesizing the reference to the class as `Ident(classDef.name)`, which was unhygienic in case of `implicit class X[X]`. To use symbols without causing a cycle, I switched from `REF(symbol)` to `Ident(symbol)`. The former calls into: at scala.reflect.internal.TreeGen.mkAttributedSelect(TreeGen.scala:184) at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:124) at scala.reflect.internal.TreeGen.mkAttributedRef(TreeGen.scala:130) at scala.tools.nsc.ast.TreeDSL$CODE$.REF(TreeDSL.scala:307) which forces the info of enclosing module and forms a cycle.
| * | | | | | | | | | Merge pull request #2001 from JamesIry/2.10.x_SI-5313Grzegorz Kossakowski2013-02-042-0/+66
| |\ \ \ \ \ \ \ \ \ \ | | |_|_|_|/ / / / / / | |/| | | | | | | | | SI-5313 Do not eliminate stores that potentially wipe referenes
| | * | | | | | | | | SI-5313 Test clobbers on the back edge of a loopJames Iry2013-02-022-2/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I realized I was missing a test case for a local store early in a loop that was unused but turned out to be a clobber of a store later in the loop.
| | * | | | | | | | | SI-5313 Eliminate more stores by replacing clobbers with null storesJames Iry2013-01-302-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an unused store clobbers a previous store, replace it with storing a null. Don't mark clobbers as "used" so that the original clobber and all following clobbers can still be eliminated.
| | * | | | | | | | | SI-5313 Do not eliminate stores that potentially wipe referenesJames Iry2013-01-282-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Storing to local variables of reference or array type is indirectly observable because it potentially allows gc to collect an object. So this commit makes DeadCodeElimination mark a store necessary if it assigns to a local that potentially stored by a previous necessary store.
| * | | | | | | | | | Merge pull request #2039 from scalamacros/ticket/7046Eugene Burmako2013-02-042-0/+15
| |\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | SI-7046 reflection now auto-initializes knownDirectSubclasses
| | * | | | | | | | | | SI-7046 reflection now auto-initializes knownDirectSubclassesEugene Burmako2013-01-312-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | knownDirectSubclasses joins the happy family of flags, annotations and privateWithin, which automatically trigger initialization, when used within runtime reflection.
| * | | | | | | | | | | Merge pull request #2022 from lrytz/analyzerPlugins210Lukas Rytz2013-02-0313-5/+398
| |\ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | Analyzer Plugins
| * \ \ \ \ \ \ \ \ \ \ \ Merge pull request #1976 from retronym/backport/1468James Iry2013-02-032-0/+20
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | [backport] SI-6428 / SI-7022 Value class with bounds
| | * | | | | | | | | | | | SI-7022 Additional test case for value class w. boundsJason Zaugg2013-02-021-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As reported against 2.10.0, and as fixed by SI-6482, which was backported in the previous commit.
| | * | | | | | | | | | | | [backport] SI-6482, lost bounds in extension methods.Jason Zaugg2013-02-021-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Squashed commit of the following: commit 5c156185306ba797c0443d9dccae0ae7ce462a1f Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 15:42:50 2012 -0700 A little more housecleaning in ExtensionMethods. The only real contribution is readability. (cherry picked from commit 61f12faacaaccf366f9211ba6493fb042a91f1d2) Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala commit 79f443edf584745d614e24fb9ca6644c6b18d439 Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 14:22:19 2012 -0700 Incorporated pull request feedback. (cherry picked from commit 153ccb4757718cceb219988f30381f73362e6075) commit 707f580b0cdcb01e27ca4c76991dea427945b5bd Author: Paul Phillips <paulp@improving.org> Date: Sat Oct 6 10:20:45 2012 -0700 Fix for SI-6482, lost bounds in extension methods. That was a good one. How to create a new method with type parameters from multiple sources, herein. (cherry picked from commit ff9f60f420c090b6716c927ab0359b082f2299de) commit 8889c7a13f74bc175e48aa2209549089a974c2af Author: Paul Phillips <paulp@improving.org> Date: Fri Oct 5 22:19:52 2012 -0700 Responded to comment about how many isCoercibles there are. I make the case that there is only one. (cherry picked from commit 883f1ac88dd7cec5882d42d6b48d7f267d1f6e00)
| * | | | | | | | | | | | | Merge pull request #2033 from adriaanm/patmat-optAdriaan Moors2013-02-0319-120/+252
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|_|/ / / / / / | |/| | | | | | | | | | | | pattern matching efficiency: addresses SI-6686 and SI-6941, affects SI-5739
| | * | | | | | | | | | | | SI-6941 testsAdriaan Moors2013-01-314-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tests that the methods' bytecodes are similar as variable load/stores are reordered, it ignores which variables are modified when checking for bytecode equality the assert is: `similarBytecode(methNodeA, methNodeB, equalsModuloVar)`
| | * | | | | | | | | | | | SI-6686 drop valdef unused in flatMapCond's blockAdriaan Moors2013-01-315-76/+69
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | no type test if static type <:< primitive value classAdriaan Moors2013-01-314-0/+35
| | | | | | | | | | | | | |
| | * | | | | | | | | | | | don't store subpats bound to underscoreAdriaan Moors2013-01-315-8/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | also, tweak fix in place for SI-5158 to appease SI-6941 don't store mutable fields from scala.* as we can assume these classes are well-behaved and do not mutate their case class fields
| | * | | | | | | | | | | | no null check for type-tested unapply argAdriaan Moors2013-01-315-103/+138
| | | |_|/ / / / / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | pattern matching on case classes where pattern is not known to be a subclass of the unapply's argument type used to result in code like: ``` if (x1.isInstanceOf[Foo]) { val x2 = x1.asInstanceOf[Foo] if (x2 != null) { // redundant ... } } ``` this wastes byte code on the redundant null check with this patch, when previous type tests imply the variable cannot be null, there's no null check
| * | | | | | | | | | | | Merge pull request #1911 from kzys/jira-4976Adriaan Moors2013-02-022-0/+2
| |\ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-4976 Scaladoc: Add a source link to package objects
| | * | | | | | | | | | | | SI-4976 Scaladoc: Add a source link to package objectsKato Kazuyoshi2013-01-172-0/+2
| | | | | | | | | | | | | |
| * | | | | | | | | | | | | Merge pull request #2044 from phaller/issue/7029Adriaan Moors2013-02-021-1/+13
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-7029 - Makes sure that uncaught exceptions are propagated to the UEH ...
| | * | | | | | | | | | | | | SI-7029 - Make test more robustPhilipp Haller2013-02-011-24/+12
| | | | | | | | | | | | | | |
| | * | | | | | | | | | | | | SI-7029 - Makes sure that uncaught exceptions are propagated to the UEH for ↵Viktor Klang2013-01-311-0/+24
| | | |/ / / / / / / / / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the global ExecutionContext
| * | | | | | | | | | | | | Merge pull request #2019 from scalamacros/ticket/6539Eugene Burmako2013-02-012-1/+7
| |\ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-6539 moves @compileTimeOnly away from scala-reflect
| | * | | | | | | | | | | | | SI-6539 moves @compileTimeOnly away from scala-reflectEugene Burmako2013-01-312-1/+7
| | | |_|_|_|_|_|_|_|/ / / / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The move is done to provide forward compatibility with 2.10.0. The annotation isn't replaced with one of the macro-based solutions right away (see comments for more information about those), because we lack necessary tech in 2.10.x.
* | | | | | | | | | | | | | Merge pull request #2042 from mt2309/SI-5151Paul Phillips2013-02-082-0/+8
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-5151 - Add firstKey and lastKey to LongMap.
| * | | | | | | | | | | | | | SI-5151 - Add firstKey and lastKey to LongMap.Michael Thorpe2013-01-312-0/+8
| | | | | | | | | | | | | | |
* | | | | | | | | | | | | | | Merge commit 'f3cdf146709e0dd98533ee77e8ca2566380cb932'Lukas Rytz2013-02-0413-5/+398
|\ \ \ \ \ \ \ \ \ \ \ \ \ \ \ | | |_|_|_|_|_|/ / / / / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Contexts.scala src/compiler/scala/tools/nsc/typechecker/Namers.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/continuations/plugin/scala/tools/selectivecps/CPSAnnotationChecker.scala src/reflect/scala/reflect/internal/AnnotationCheckers.scala src/reflect/scala/reflect/internal/Symbols.scala
| * | | | | | | | | | | | | | Fix context for type checking early initializersLukas Rytz2013-02-031-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before: scala> class A { class C extends { val x: A = this } with AnyRef } <console>:7: error: type mismatch; found : A.this.C required: A class A { class C extends { val x: A = this } with AnyRef } ^ Note that the same thing is necessary and already done in Namers (see def createNamer). The whole logic of when and how to create contexts should be factored out and reused in Namer and Typer. ( My Hobby [1]: detecting compiler by just looking at its soruce [1] http://www.explainxkcd.com/wiki/index.php?title=Category:My_Hobby )
| * | | | | | | | | | | | | | Analyzer PluginsLukas Rytz2013-02-032-0/+318
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | AnnotationCheckers are insufficient because they live outside the compiler cake and it's not possible to pass a Typer into an annotation checker. Analyzer plugins hook into important places of the compiler: - when the namer assigns a type to a symbol (plus a special hook for accessors) - before typing a tree, to modify the expected type - after typing a tree, to modify the type assigned to the tree Analyzer plugins and annotation checker can be activated only during selected phases of the compiler. Refactored the CPS plugin to use an analyzer plugin (since adaptToAnnotations is now part of analyzer plugins, no longer annotation checkers).
| * | | | | | | | | | | | | | SI-1803, plus documentation and cleanups in Namers, mainly in typeSigLukas Rytz2013-02-038-4/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - when typing (and naming) a ValDef, tpt and rhs are now type checked in the same context (the inner / ValDef context). this does not change any behavior, but is more uniform (same as for DefDef). martin told me (offline) that this change is desirable if it doesn't break anything. (it doesn't). - typeSig is now more uniform with a separate method for each case (methodSig, valDefSig, etc). methodSig was cleaned up (no more variables) and documented. the type returned by methodSig no longer contains / refers to type skolems, but to the actual type parameters (so we don't need to replace the skolems lateron). - documentation on constructor contexts, type skolems - more tests for SI-5543
| * | | | | | | | | | | | | | Keep annotations when computing lubsLukas Rytz2013-02-031-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Integrates annotationsLub into lub. Also fixes SubstSymMap when mapping over annotaion trees. I don't understand what the previous code was supposed to achieve, but it crashed in some of my examples.
| * | | | | | | | | | | | | | case module toString is syntheticLukas Rytz2013-02-031-1/+1
| | |/ / / / / / / / / / / / | |/| | | | | | | | | | | |