summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge commit '0c92704' into merge/2.10.x-to-masterJason Zaugg2013-12-119-61/+183
|\ | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-forward.whitelist.conf src/interactive/scala/tools/nsc/interactive/Global.scala test/files/presentation/scope-completion-2.check test/files/presentation/scope-completion-3.check test/files/presentation/scope-completion-import.check Conflicts in the scope completion tests handled with the help of @skyluc in https://github.com/scala/scala/pull/3264
| * Merge pull request #3222 from skyluc/issue/completion-import-vals-210-7995Adriaan Moors2013-12-096-54/+112
| |\ | | | | | | SI-7995 completion imported vars and vals
| | * SI-7995 completion imported vars and valsLuc Bourlier2013-12-066-54/+112
| | | | | | | | | | | | | | | | | | Imported member vals and vars were always marked inaccessible, even if referencing them at the location of the completion is valid in code. The accessible flag is now set accordingly to the accessibility of the getter.
| * | Merge pull request #3244 from rtyley/si-8019-swing-publisher-check-pf-definedAdriaan Moors2013-12-091-1/+1
| |\ \ | | | | | | | | SI-8019 Make Publisher check PartialFunction is defined for Event
| | * | SI-8019 Make Publisher check PartialFunction is defined for EventRoberto Tyley2013-12-091-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reactions are PartialFunctions, so if events come through indiscriminately that the listener is not defined for, errors occur. Eg: -- Exception in thread "AWT-EventQueue-0" scala.MatchError: FocusGained(scala.swing wrapper scala.swing.TextField -- A Coursera thread with people affected by this issue: https://class.coursera.org/reactive-001/forum/thread?thread_id=1315
| * | Merge pull request #3229 from retronym/ticket/8029Adriaan Moors2013-12-093-1/+69
| |\ \ | | | | | | | | SI-8029 Avoid multi-run cyclic error with companions, package object
| | * | SI-8029 Avoid multi-run cyclic error with companions, package objectJason Zaugg2013-12-063-1/+69
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug report suggests this problem only became visible in the IDE *after* 2.10.3, but I tested an IDE with exactly 2.10.3 and saw the same problem. In fact, my test case fails as far back as 2.10.0. I suspect the problem showed up after 816cecf9a9, which checks that pairs of companion symbols are codefined eagerly in Namers. This commit modifies the check of `rawInfo ne NoType` in `isCoDefinedWith` to avoid triggering adaptation of types from the previous run. I'm not sure of the precise intent of that check. I looked at c9861cd198 (genesis of isCoDefinedWith). Before that we get back to 3761cb4b3a1 (the dawn of Subversion.)
* | | Merge commit '4d439dd' into merge/2.10.x-to-masterJason Zaugg2013-12-110-0/+0
|\| |
| * | Merge pull request #3230 from retronym/backport/7439Eugene Burmako2013-12-075-1/+41
| |\ \ | | | | | | | | [backport] SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.
| | * | [backport] SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.Jason Zaugg2013-12-075-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `originalInfo` can return null for stub symbols; deal with that as we used to before a regression in 016bc3db. After this change, we can once again delete A_1.class and still compile code instantiating B_1. (A_1 is only referred to in a method signature of B_1 which is not called from our code.) scala> new B_1 warning: Class A_1 not found - continuing with a stub. res0: B_1 = B_1@5284b8f9 In practice, this situation arises when someone uses a third party class that was compiled against other libraries not avaialable on the current compilation classpath. (cherry picked from commit a95432168204964e4f6c4571e781559c1640f2d8)
* | | | Merge commit 'a774157' into merge/2.10.x-to-masterJason Zaugg2013-12-112-0/+35
|\| | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/transform/Erasure.scala
| * | | Merge pull request #3223 from retronym/ticket/8010-2.10.xEugene Burmako2013-12-072-0/+35
| |\ \ \ | | | | | | | | | | SI-8010 Fix regression in erasure double definition checks
| | * | | SI-8010 Fix regression in erasure double definition checksJason Zaugg2013-12-062-0/+35
| | | |/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to `Symbol#info` during scope iteration considered harmful. Looks like calling `info` during this Scope iteration is triggering the ExplicitOuter info transformer, which "makes all super accessors and modules in traits non-private, mangling their names.". This name change necessitates a rehashing of the owning scope, which I suspect is enough to corrupt the ScopeEntry-s being traversed in `checkNoDeclaredDoubleDefs`. The upshot was that we encountered the same symbol twice, which was reported as being a double-definition. This problem only showed up after 086702d8a74, which did nothing worse then change the order in which `{e, e1}.sym.info` were forced. I inspected SymbolPairs/OverridingPairs which *appear* to be immune as they only test flags during scope iteration; infos are not used until later, at which point we're iterating a temporary scope that isn't part of the type of the owner of the symbols.
* | | | Merge commit 'f6c6846' into merge/2.10.x-to-masterJason Zaugg2013-12-110-0/+0
|\| | |
| * | | Merge pull request #3232 from xeno-by/topic/macro-error-messages-210xJason Zaugg2013-12-0719-27/+25
| |\ \ \ | | |_|/ | |/| | [nomaster] better error messages for various macro definition errors
| | * | [nomaster] better error messages for various macro definition errorsEugene Burmako2013-12-0619-27/+25
| |/ / | | | | | | | | | backport of 1d3ec4e708154ec05554f540d7d68ed55dc12426
* | | Merge commit '7e996c1' into merge/2.10.x-to-masterJason Zaugg2013-12-110-0/+0
|\| |
| * | Merge pull request #3209 from dotta/SI-7982-on-2.10.xJason Zaugg2013-12-068-15/+58
| |\ \ | | | | | | | | make askLoadedType unload arguments out of the PC by default,
* | \ \ Merge pull request #3246 from xeno-by/topic/compile-time-onlyJason Zaugg2013-12-103-48/+85
|\ \ \ \ | | | | | | | | | | streamlines refchecking undesired symbol properties
| * | | | streamlines refchecking undesired symbol propertiesEugene Burmako2013-12-093-48/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unifies `checkDeprecated`, `checkMigration` and `checkCompileTimeOnly` into a single centralized point of reference that is now consistently called from `checkTypeRef`, `transformIdent` and `transformSelect`.
* | | | | Merge pull request #3237 from xeno-by/topic/macrodef-returntype-inferenceJason Zaugg2013-12-10102-235/+245
|\ \ \ \ \ | |/ / / / |/| | | | deprecates macro def return type inference
| * | | | deprecates macro def return type inferenceEugene Burmako2013-12-10102-235/+245
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the new focus on quasiquotes in macro implementations, we now have to change the way how inference of macro def return types works. Previously, if the return type of a macro def wasn’t specified, we looked into the signature of its macro impl, took its return type (which could only be c.Expr[T]) and then assigned T to be the return type of the macro def. We also had a convenient special case which inferred Any in case when the body of the macro impl wasn’t an expr. That avoided reporting spurious errors if the macro impl had its body typed incorrectly (because in that case we would report a def/impl signature mismatch anyway) and also provided a convenience by letting macro impls end with `???`. However now we also allow macro impls to return c.Tree, which means that we are no longer able to do any meaningful type inference, because c.Tree could correspond to tree of any type. Unfortunately, when coupled with the type inference special case described above, this means that the users who migrate from exprs to quasiquotes are going to face an unpleasant surprise. If they haven’t provided explicit return types for their macro defs, those types are going to be silently inferred as `Any`! This commit plugs this loophole by prohibiting type inference from non-expr return types of macro impls (not counting Nothing). Moreover, it also deprecates c.Expr[T] => T inference in order to avoid confusion when switching between exprs and quasiquotes.
* | | | Merge pull request #3226 from ziggystar/patch-1Adriaan Moors2013-12-082-0/+35
|\ \ \ \ | | | | | | | | | | add method dequeueOption to immutable.Queue
| * | | | add method dequeueOption to immutable.QueueThomas Geier2013-12-052-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows immutable.Queue to be used conveniently in functional code. Method is in the spirit of `headOption` on seqs or `get` on maps. Also adds a unit test for immutable.Queue.
* | | | | Merge pull request #3225 from som-snytt/issue/8013-interp-nowarnAdriaan Moors2013-12-084-6/+60
|\ \ \ \ \ | | | | | | | | | | | | SI-8013 Nowarn on macro str interpolation
| * | | | | SI-8013 Nowarn on macro str interpolationSom Snytt2013-12-044-6/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When warning about stray "foo $bar" under `-Xlint`, which may be missing an interpolator id, suppress the warning if we're in the middle of a macro expansion, since we have no useful heuristic to apply to the expanded tree. The test for whether the string is part of an expanded tree is to check all open macros for an expanded tree that contains the literal tree under scrutiny. (This is deemed more paranoid than looking for a macro application that is an enclosing position.)
* | | | | | Merge pull request #3231 from xeno-by/topic/undeprecate-parseEugene Burmako2013-12-061-3/+0
|\ \ \ \ \ \ | | | | | | | | | | | | | | undeprecates c.parse
| * | | | | | undeprecates c.parseEugene Burmako2013-12-061-3/+0
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We never thought that c.parse is going to be completely subsumed by quasiquotes, but hoped that the use cases that are going to be lost aren’t going to be noticed by anyone. Unfortunately, this isn’t the case, so I’m undeprecating c.parse until we get a better story for those for whom quasiquotes are not enough.
* | | | | | Merge pull request #3228 from retronym/merge/2.10.x-and-pr-3209-to-masterJason Zaugg2013-12-0617-29/+137
|\ \ \ \ \ \ | | | | | | | | | | | | | | Merge #3209 and 2.10.x to master
| * \ \ \ \ \ Merge commit '7d41094' into merge/2.10.x-and-pr-3209-to-masterJason Zaugg2013-12-068-15/+58
| |\ \ \ \ \ \ | | | |_|_|/ / | | |/| | | | | | | | | | | | | | | | | | Conflicts: src/interactive/scala/tools/nsc/interactive/CompilerControl.scala
| | * | | | | SI-7982 Changed contract of askLoadedType to unload units by defaultFrançois Garillot2013-12-068-15/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rationale for not keeping units loaded by default is that the more units are loaded, the slower is background compilation. For instance, in the Scala IDE for Eclipse (which uses the presentation compiler), typechecking occurs every time the reconciler kicks-in (~500millis after you stop typing), hence it is important that units are not kept loaded unless strictly necessary (for some extra information about this, see https://www.assembla.com/spaces/scala-ide/tickets/1001388) While I agree that using a boolean argument (`keepLoaded`) for deciding if a unit should be loaded isn't a great design, other methods in `CompilerControl` also have a keepLoaded parameter, so at least we have some consistency. For the future, I'm thinking we should be able to remove the `keepLoaded` flag altogether, and change the implementation of `askLoadedType` to preserve the same units loaded in the presentation compiler before and after its execution. Basically, if you want a unit to be kept loaded, you should call `askReload` first, and then `askLoadedType`. However, to reduce impact, I think the changes carried by this commit will help us estimate if the solution I just outlined is viable (because `askLoadeType` won't be keeping units loaded by default, which wasn't the case with the former implementation). (While the patch was mostly contributed by @huitseeker, @dotta has edited the commit message to preserve the comments in the PR https://github.com/scala/scala/pull/3209)
| * | | | | | Merge commit '7d74884' into merge-2.10.x-to-masterJason Zaugg2013-12-063-5/+8
| |\ \ \ \ \ \ | | | |_|_|/ / | | |/| | | | | | | | | | | | | | | | | | Conflicts: test/files/jvm/scala-concurrent-tck.scala
| | * | | | | Merge pull request #3181 from heathermiller/issue/6913James Iry2013-12-053-5/+8
| | |\ \ \ \ \ | | | |_|_|_|/ | | |/| | | | SI-6913 Reapplies a lost fix by @viktorklang
| | | * | | | SI-6913 Fixing semantics of Future fallbackTo to be according to docsHeather Miller2013-12-053-5/+8
| | |/ / / / | | | | | | | | | | | | | | | | | | Origin: viktorklang@1bbe854
| * | | | | Merge commit '7c1d114' into merge-2.10.x-to-masterJason Zaugg2013-12-067-9/+71
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/interactive/Global.scala
| | * | | | Merge pull request #3208 from dotta/si-7548-on-2.10Jason Zaugg2013-12-027-9/+71
| | |\ \ \ \ | | | |/ / / | | |/| | | askTypeAt returns the same type for full/ targeted typecheck (2.10.x)
| | | * | | SI-7458 Pres. compiler must not observe trees in silent modeJason Zaugg2013-12-022-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Otherwise we can think that `+` in `1 + BigInt(2)` refers to a method in `Int`. In general, this protects the IDE from observing results from "exploratory" typing which is discarded as the compiler backtracks to another possibility. This protection subsumes the condition that checked for overloaded types: presentation/t7458 now passes without this.
| | | * | | SI-7548 Test to demonstrate residual exploratory typing bugJason Zaugg2013-12-023-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We shouldn't observe tree types under silent mode. The enclosed test is a standalone version of `1 + BigInt(2)`, a standard example of exploratory typing in Scala. Once we determine that none of the `+` methods in `Int` accepts (possibly implicitly coerced `BigInt`), we have to backtrack and look for a view from `Int => { +(_: BigInt): ? }`. The next commit will correct the problem.
| | | * | | SI-7548 askTypeAt returns the same type whether the source was fully or ↵Mirco Dotta2013-12-024-9/+39
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | targeted type-checked When asking for targeted typecheck, the located tree may have overloaded types is the source isn't yet fully typechecked (e.g., a select tree for an overloaded method). This is problematic as it can lead to unknown 'hovers', broken hyperlinking that suddenly starts working, unresolved ScalaDoc comments, and similar, in the Scala IDE. With this commit we are hardening the contract of `askTypeAt` to return the same type whether the file was fully type-checked or targeted type-checked. This is done by preventing the typechecker to stop too early if the `located` tree has an overloaded type. Furthermore, I'm assuming that if `located.tpe` is of type `OverloadedType`, by letting the compiler carry-on the typechecking, the `located.tpe` will eventually be resolved to a non-overloaded type. Said otherwise, I expect the targeted typechecking will always terminate (if my reasoning isn't sound, please say so). The test provided with this commit demonstrates the new behavior (the position used to execute the test is resolved to the `foo` method's call). In fact, before this commit, executing the test returned the following: (x: Int, y: String)Unit <and> (x: String)Unit <and> (x: Int)Unit Showing that the tree's type is an overloaded type. The ambiguity is fixed by this commit, and in fact the test's output is now: (x: Int)Unit
| * | | | Merge commit 'da73950' into merge-2.10.x-to-masterJason Zaugg2013-12-060-0/+0
| |\| | |
| | * | | Merge pull request #3180 from xeno-by/topic/toolbox-rangeposJason Zaugg2013-11-263-2/+16
| | |\ \ \ | | | | | | | | | | | | teaches toolbox about -Yrangepos
| | | * | | [nomaster] teaches toolbox about -YrangeposEugene Burmako2013-11-223-2/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Unlike in master, in 2.10.x enabling -Yrangepos requires instantiating Global with mixed in RangePositions trait. Same story for toolboxes. Just setting Yrangepos is not enough - one needs to mix in RangePositions into ToolboxGlobal. I didn’t know that back then, so now I’m fixing the oversight. The commit is marked as [nomaster], because -Yrangepos doesn’t need special treatment in master.
| | * | | | Merge pull request #3196 from retronym/topic/3190-fixupJason Zaugg2013-11-2610-8/+178
| | |\ \ \ \ | | | |/ / / | | |/| | | Corrects positions for Dynamic calls
* | | | | | Merge pull request #3191 from retronym/ticket/deprecate-par-viewJason Zaugg2013-12-0621-968/+286
|\ \ \ \ \ \ | |_|_|_|_|/ |/| | | | | Remove parallel collection views and, with them, Gen*View
| * | | | | Removes Gen*View and Par*ViewJason Zaugg2013-11-2621-980/+286
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - code that used to be inherited in *View is now inlined - the `view` methods on `ParIteratoa` and `ParSeq` now convert to sequential collections, and are deprecated asking the user to do this explicitly in the future. Should be largely source compatible with 2.10.x, on the assumption that the removed classes, while being public, were internal implementation details. A few tests used now-removed classes to demonstrate compiler crashes. I managed to confirm that after my decoupling, t4365 still exercises the bug: % qbin/scalac test/files/pos/t4365/*.scala warning: there were 2 deprecation warning(s); re-run with -deprecation for details one warning found % scalac-hash 7b4e450 test/files/pos/t4365/*.scala warning: there were 2 deprecation warning(s); re-run with -deprecation for details one warning found % scalac-hash 7b4e450~1 test/files/pos/t4365/*.scala 2<&1 | grep -i wrong error: something is wrong: cannot make sense of type application something is wrong: cannot make sense of type application something is wrong: cannot make sense of type application I didn't manage to do the same for specializes-sym-crash.scala, and instead just made it compile.
| * | | | | Deprecates Par*View and Gen*ViewJason Zaugg2013-11-2412-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 2.12, this gives us the option to move the code from Gen*View down into *View. If we don't do something more drastic with views, which inertia and history suggests is a real possibility, we can at least shed a little of the implementation. These abstractions are *only* used to share implementation; there is no `view` method available on, for instance, `GenSeq` that lets one abstract over parallel/sequential collections while spawning views. scala> (List(1): collection.GenSeq[Int]).view <console>:8: error: value view is not a member of scala.collection.GenSeq[Int] (List(1): collection.GenSeq[Int]).view ^ Let's keep it that way. I suspect that views over parallel collections exist not because they were the most sought after feature, but rather because the initial incarnatin of parallel collections used to live undernead TraversableOnce, and hence were obligated to implement `def view`. This change will give us deprecation warnings in the non deprecated places that extend `Gen*View` (three, by my count) in the interim. There are ways to avoid this, but they aren't particularly appealing.
* | | | | | Merge pull request #3198 from adriaanm/update-versionsAdriaan Moors2013-12-041-0/+21
|\ \ \ \ \ \ | | | | | | | | | | | | | | Use -Dupdate.versions to update versions.properties
| * | | | | | Use -Dupdate.versions to update versions.propertiesAdriaan Moors2013-11-261-0/+21
| | | | | | |
* | | | | | | Merge pull request #3216 from xeno-by/topic/macro-error-messagesAdriaan Moors2013-12-0315-76/+84
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | better error messages for various macro definition errors
| * | | | | | | better error messages for various macro definition errorsEugene Burmako2013-12-0315-76/+84
| | | | | | | |