summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2224 from retronym/ticket/7238Adriaan Moors2013-03-111-3/+3
|\ | | | | SI-7328 Bail out of names/defaults when args are error typed
| * SI-7328 Bail out of names/defaults if args are error typedJason Zaugg2013-03-091-3/+3
| | | | | | | | | | To avoid a crasher later on with a null type inside a sequence argument.
* | Merge pull request #2225 from retronym/ticket/7234Adriaan Moors2013-03-111-7/+10
|\ \ | | | | | | SI-7234 Make named args play nice with dep. method types
| * | SI-7234 Make named args play nice with dep. method typesJason Zaugg2013-03-091-7/+10
| | | | | | | | | | | | | | | | | | Some care is needed to avoid interaction with constant types (e.g pos/z1730.scala) and with existentials (e.g. t3507-old.scala).
* | | Merge pull request #2223 from scalamacros/ticket/7235Adriaan Moors2013-03-112-0/+6
|\ \ \ | | | | | | | | reifier is now aware of SI-7235
| * | | reifier is now aware of SI-7235Eugene Burmako2013-03-092-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SI-7235 is caused by a long-standing todo in typedRefinement, which leads to originals of compound type trees swallowing their stats. I'm not sure how exactly to fix SI-7235, but what I am sure about is that we shouldn't silently discard stats during reification. This patch introduces a new implementation restrictions, which now reports that reify of compound type trees with non-empty stats isn't going to work.
* | | | SI-7226 Fix inference regression caused by TypeVar equality.Jason Zaugg2013-03-091-0/+6
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TypeVars, being mutable creatures, mustn't have structural equality/hashing, otherwise TypeRefs that differ only by having distinct TypeVars as components get wrongly uniqued together. The reported bug showed the disaterous consequences: constraints from the `C?[Int]` in the return type applied to the `?C[?A]` in the parameter list. This commit overrides `equals` and `hashCode` in `TypeVar` to use reference equality. An alternative fix would be to drop the `case`-ness of the class, as was the case before 0cde930b when this regressed.
* | | Fix SI-7224.Iulian Dragos2013-03-071-1/+1
| |/ |/| | | | | | | | | | | Don't focus positions assigned to the TypeTree of a parent of a Template when the parent exists in the source. A focused position (instance of `OffsetPosition`) makes it invisible to the presentation compiler when it looks for the innermost enclosing tree of a given position (breaking hyperlinking, for example).
* | Merge pull request #2199 from retronym/ticket/7214Adriaan Moors2013-03-051-1/+3
|\ \ | | | | | | SI-7214 outer check based on dealiased pattern type.
| * | SI-7214 outer check based on dealiased pattern type.Jason Zaugg2013-03-051-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A Typed Pattern (_: T) is more than `.isInstanceOf`: if `T` is a path dependent type, the scrutinee's $outer reference is also compared against the prefix of `T`. The code that synthesises this is split into two places. `needsOuterCheck` determines whether to add this check, based on the type `T`, and the type of the scrutinee. If it gives the go-ahead, `treeCondStrategy.outerCheck` synthesizes the check. The new test case demonstrates the problems caused by the failure to dealias in `needsOuterCheck`: it could either wrongly lead to synthesis of an outer test (which would crash), or wrongly omit the outer test (meaning overly liberal matching.) A simple `dealias` remedies this. `dealiasWiden` is *not* appropriate here; we need to keep hold of singleton types. I'll also note that there is already a little slack between these methods, as commented: > ExplicitOuter replaces `Select(q, outerSym) OBJ_EQ expectedPrefix` > by `Select(q, > outerAccessor(outerSym.owner)) OBJ_EQ expectedPrefix` > if there's an outer accessor, otherwise the condition becomes `true` > TODO: can we improve needsOuterTest so there's always an outerAccessor? So this is probably a fragile area that warrants a careful review with a view to design improvements.
* | | Merge pull request #2156 from vigdorchik/hierarchyAdriaan Moors2013-03-055-61/+65
|\ \ \ | | | | | | | | SI-7109 SI-7153 Generalize the API to get docComments: allow to force do...
| * | | SI-7109 SI-7153 Generalize the API to get docComments: allow to force docTreesEugene Vigdorchik2013-02-245-61/+65
| | | | | | | | | | | | | | | | | | | | | | | | for given fragments. Don't type-check when forcing doc comments, but rather do it directly. Test the new functionality as well as better tests for the old one.
* | | | Merge pull request #2193 from adriaanm/patmat-refactorAdriaan Moors2013-03-0510-307/+353
|\ \ \ \ | | | | | | | | | | merge 2.10.1 into 2.10.x
| * \ \ \ Merge 2.10.1 into 2.10.xAdriaan Moors2013-03-032-7/+21
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix for SI-7183 in 440bf0a8c2 was forward ported in f73d50f46c. Conflicts: src/compiler/scala/tools/nsc/typechecker/PatternMatching.scala
| | * | | | [nomaster] SI-7195 minor version mustn't introduce warningsAdriaan Moors2013-03-011-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We want 2.10.1 to be a drop-in replacement for 2.10.0, so we can't start warning where we weren't warning in 2.10.0. See SI-5954 (#1882, #2079) for when it was an implementation restriction, which was then weakened to a warning. It's now hidden behind -Ydebug.
| | * | | | Merge pull request #2168 from retronym/ticket/7183Adriaan Moors2013-03-011-14/+28
| | |\ \ \ \ | | | | | | | | | | | | | | SI-7183 Disable unreachability for withFilter matches.
| | | * | | | SI-7183 Disable unreachability for withFilter matches.Jason Zaugg2013-02-251-14/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This avoids spurious unreachable warnings on code that the user didn't write. The parser desugars for-comprehensions such as: for (A(a) <- List(new A)) yield a To: List(new A()).withFilter(((check$ifrefutable$2) => check$ifrefutable$2: @scala.unhecked match { case A((a @ _)) => true case _ => false }) ) But, if `A.unapply` returns `Some[_]`, the last case is dead code. (Matching against a regular case class *would* fall through in the caes of a null scrutinee.) In SI-6902, we enabled unreachability warnings, even if the scrutinee was annotated as @unchecked. That was consistent with the 2.9.2 behaviour, it was only disabled temporarily (actually, accidentally) in 2.10.0. But, the old pattern matcher didn't warn about this code. This commit makes the pattern matcher recognise the special scrutinee based on its name and disables both exhaustivity *and* unreachability analysis. To do so, the we generalize the boolean flag `unchecked` to the class `Suppression`.
| | * | | | | Merge pull request #2167 from retronym/ticket/7126Adriaan Moors2013-03-012-6/+18
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | SI-7126 Account for the alias types that don't dealias.
| | | * | | | | SI-7126 Eliminate a source of malformed types.Jason Zaugg2013-02-261-4/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The kind-polymorphic nature of Nothing and Any in concert with type argument inference could lead to types like `T[T]` (where `type T=Any`). Compensatory action is taken later on to recover; see the usages of `TypeRef#typeParamsMatchArgs`. But this these types have a nasty property, they can dealias to themselves. Callers recursing through types who fail to account for this hit an infinite recursion, as was reported in SI-7126. This commit simply dealiases `T` when registering the type bound in `unifySimple`. We should try to weed out additional sources of these types.
| | | * | | | | SI-7126 Account for the alias types that don't dealias.Jason Zaugg2013-02-251-2/+7
| | | |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After this change: qbin/scalac -Ydebug test/files/pos/t7126.scala 2>&1 | grep warning warning: dropExistential did not progress dealiasing Test.this.T[Test.this.T], see SI-7126 one warning found T[T]? Really? The true bug lies somewhere else; the comments of the ticket illuminate the general areas of concern.
| * | | | | | [port] SI-7183 Disable unreachability for withFilter matches.Adriaan Moors2013-03-033-16/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a forward port of #2168 (originally for 2.10.1, but the pattern matcher has since been refactored in 2.10.x.)
| * | | | | | better names for components of MatchTranslatorAdriaan Moors2013-03-033-34/+33
| | | | | | |
| * | | | | | move sat solving to separate fileAdriaan Moors2013-03-033-233/+243
| | | | | | |
| * | | | | | simplify dependencies between patmat components, remove self typesAdriaan Moors2013-03-037-41/+51
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #2198 from retronym/ticket/7215Paul Phillips2013-03-051-10/+13
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7215 Fix transpose of an empty Array[Array[T]].
| * | | | | | SI-7215 Fix transpose of an empty Array[Array[T]].Jason Zaugg2013-03-051-10/+13
| | |_|_|_|/ | |/| | | |
* | | | | | Merge pull request #2175 from retronym/ticket/7185Paul Phillips2013-03-051-1/+2
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7185 Avoid NPE in TreeInfo.isExprSafeToInline
| * | | | | | SI-7185 Avoid NPE in TreeInfo.isExprSafeToInlineJason Zaugg2013-03-021-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We got there typechecking code with a redundant layer of Block. We can't express that in source code, so we test this with manual tree construction and with XML literals, which as reported produce such trees.
* | | | | | | Merge pull request #2178 from scalamacros/ticket/7190Paul Phillips2013-03-051-0/+1
|\ \ \ \ \ \ \ | |_|_|/ / / / |/| | | | | | SI-7190 macros no longer give rise to bridges
| * | | | | | SI-7190 macros no longer give rise to bridgesEugene Burmako2013-02-271-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Amazingly enough, this got through all the testing we performed. But now erasure knows that it shouldn't generate bridges for macro methods.
* | | | | | | Merge pull request #2184 from adriaanm/revert-pr-2083Adriaan Moors2013-03-0120-1468/+331
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Revert SI-6240 synchronization for runtime reflection
| * | | | | | | Revert SI-6240 synchronization for runtime reflectionAdriaan Moors2013-03-0120-1468/+331
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit reverts #2083: - 387b2590db runtime reflection: death from thousand threads - 73d079fb38 removes the assertion in missingHook - f4dd56ca5d synchronizes names - dd148de5a8 synchronizes pendingVolatiles - 4cbb9357c5 synchronizes toolboxes - 07bcb6176a SI-7045 reflection now auto-initializes selfType - bebd62d566 optimizes Scala reflection GIL - 735634f1d6 initializes lazy vals and inner objects in advance - 5b37cfb19a introduces GIL to Scala reflection - 981da8edfc cleans up initialization of runtime reflection - b2c2493b22 reflection no longer uses atPhase and friends - a9dca512d8 synchronizes symbols - 0262941b3c removes the crazy extraneous log - 21d5d3820b moves Symbol#SymbolKind to Symbols
* | | | | | | | Merge pull request #2179 from adriaanm/merge-2.10.1Adriaan Moors2013-03-0119-327/+171
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | Merge 2.10.1 into 2.10.x
| * | | | | | | Merge 2.10.1 into 2.10.x.Adriaan Moors2013-02-2719-327/+171
| |\ \ \ \ \ \ \ | | | |_|_|/ / / | | |/| | | | |
| | * | | | | | SI-7180 Fix regression in implicit scope of HK type alias.Jason Zaugg2013-02-251-1/+1
| | | |_|_|/ / | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We actually need to call normalize here, otherwise we don't progress through #1 below. [infer implicit] scala.this.Predef.implicitly[Higher[Foo.Bar]] with pt=Higher[Foo.Bar] in object Foo 1. tp=Foo.Bar tp.normalize=[A <: <?>]Foo.Bar[A] tp.dealias=Foo.Bar 2. tp=Foo.Bar[A] tp.normalize=Box[A] tp.dealias=Box[A]
| | * | | | | Merge pull request #2152 from retronym/topic/annotatedRetyping-2.10.1Adriaan Moors2013-02-211-9/+5
| | |\ \ \ \ \ | | | | | | | | | | | | | | | | SI-7163 backport of annotated retyping to 2.10.1
| | | * | | | | Fix typing idempotency bug with Annotated treesLukas Rytz2013-02-211-9/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | typedAnnotated transforms an Annotated tree into a Typed tree. The original field of the result is set to the Annotated tree. The bug was that typedAnnotated was using the untyped Annotated tree as original, but also set its type. When re-typing later on the same Annotated tree, the typer would consider it as alreadyTyped. This is incorrect, the typer needs to convert Annotated trees to Typed. Also, the Annotated tree only had its type field set, but its children were still untyped. This crashed the compiler lateron, non-typed trees would get out of the typing phase.
| | * | | | | | Merge pull request #2138 from retronym/ticket/6576-null-strikes-backJames Iry2013-02-191-2/+6
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6576 Workaround / diagnostic for IDE NPE.
| | | * | | | | | SI-6576 Workaround / diagnostic for IDE NPE.Jason Zaugg2013-02-191-2/+6
| | | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seems like this was too optimistic: > // later by lukas: disabled when fixing SI-5975 > // i think it cannot happen anymore - restored the null check - added logging when we set the namer in this attachment, in the hope of spotting a pattern in the wild. We don't have a test case yet; if we did we could most likely have a more principled fix. But this should suffice for 2.10.1.
| | * | | | | | SI-7146 - Fixing checkinit bug in ExecutionContextImpl and adding testViktor Klang2013-02-191-4/+4
| | | | | | | |
| | * | | | | | SI-7128 Fix regression in copyToArray for empty arraysJason Zaugg2013-02-141-1/+1
| | |/ / / / /
| | * | | | | [nomaster] Revert "Added a Swing ColorChooser wrapper"Adriaan Moors2013-02-122-59/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 08ab007c5c97f153902c4ac58f87e30fbf7cf99f. This is necessary to maintain binary compatibility with 2.10.0.
| | * | | | | [nomaster] Revert "Added a Swing PopupMenu wrapper"Adriaan Moors2013-02-122-83/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit bdff881f8a15d4de0c0ff2aa2427f0d8244d2d42. This is necessary to maintain binary compatibility with 2.10.0.
| | * | | | | [nomaster] Revert "SI-6548 reflection now correctly enters jinners"Adriaan Moors2013-02-101-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 54a84a36d5b435a787d93ca48d45399136c7e162. This is necessary to maintain binary compatibility with 2.10.0. run/t6989.check had to be updated as it also (indirectly) tested SI-6548 Conflicts: test/files/lib/javac-artifacts.jar.desired.sha1 test/files/run/t6548.check test/files/run/t6548/Test_2.scala
| | * | | | | [nomaster] inline importPrivateWithinFromJavaFlags into SymbolTableAdriaan Moors2013-02-092-24/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reworks 02ed5fb so that we don't change JavaUniverse's super classes. This is necessary to maintain binary compatibility with 2.10.0.
| | * | | | | [nomaster] Revert "cosmetic renamings in runtime reflection"Adriaan Moors2013-02-092-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 0429f0fd9224499cd8b606490d04b1a8dcffbca8. This is necessary to maintain binary compatibility with 2.10.0.
| | * | | | | [nomaster] refactor AdaptedForkJoinTask, uncaughtExceptionHandlerAdriaan Moors2013-02-091-18/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inlined AdaptedForkJoinTask, made uncaughtExceptionHandler private[this]. This is necessary to maintain binary compatibility with 2.10.0.
| | * | | | | [nomaster] can't add new class BatchingExecutorAdriaan Moors2013-02-092-120/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary to maintain binary compatibility with 2.10.0.
| | * | | | | [nomaster] bring back SerializeStart from fa3b8040ebAdriaan Moors2013-02-091-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This is necessary to maintain binary compatibility with 2.10.0.
| | * | | | | [nomaster] duplicate tailImpl as a private methodAdriaan Moors2013-02-092-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reworks d526f8bd74. This is necessary to maintain binary compatibility with 2.10.0. matchName="scala.collection.mutable.MutableList.tailImpl" problemName=MissingMethodProblem