summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #3647 from densh/si/8411Jason Zaugg2014-03-255-4/+39
|\ | | | | SI-8411 match desugared partial functions
| * SI-8411 match desugared partial functionsDenys Shabalin2014-03-225-4/+39
| |
* | Merge pull request #3636 from xeno-by/topic/mirror-typeofJason Zaugg2014-03-256-1/+101
|\ \ | | | | | | introduces Mirror.typeOf
| * | introduces Mirror.typeOfEugene Burmako2014-03-256-1/+101
|/ / | | | | | | | | | | | | | | | | I just realized that our tag-based shortcuts were incomplete, because they only work with root mirrors (doing just u.typeTag[T].tpe means that the type is going to be resolved in u.rootMirror because that's the default). This commit fixes this oversight. I'm hoping for 2.11.0-RC3, but also feel free to reschedule to 2.12.0-M1 if it becomes clear that RC3 isn't happening.
* | Merge pull request #3653 from densh/si/8200Jason Zaugg2014-03-255-5/+28
|\ \ | | | | | | SI-8200 provide an identity liftable for trees
| * | SI-8200 provide an identity liftable for treesDenys Shabalin2014-03-245-5/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This liftable hasn't been originally included in the set of standard liftables due to following contradiction: 1. On one hand we can have identity lifting that seems to be quite consistent with regular unquoting: q"..${List(1,2)}" <==> q"1; 2" q"${List(1,2)}" <==> q"s.c.i.List(1, 2)" q"..${List(q"a", q"b")}” <==> q"a; b" q"${List(q"a", q"b")}" <==> q"s.c.i.List(a, b)" This is also consistent with how lisp unquoting works although they get lifting for free thanks to homoiconicity: // scala scala> val x = List(q"a", q"b); q"f($x)" q"f(s.c.i.List(a, b))" // scheme > (let [(x (list a b))] `(f ,x)) '(f (list a b)) 2. On the other hand lifting is an operation that converts a value into a code that when evaluated turns into the same value. In this sense Liftable[Tree] means reification of a tree into a tree that represents it, i.e.: q"${List(q"a", q"b")}" <==> q"""s.c.i.List(Ident(TermName("a")), Ident(TermName("b")))""" But I belive that such lifting will be very confusing for everyone other than a few very advanced users. This commit introduces the first option as a default Liftable for trees.
* | | Merge pull request #3650 from retronym/merge/2.10.x-to-master-1Grzegorz Kossakowski2014-03-250-0/+0
|\ \ \ | | | | | | | | Merge 2.10.x to master
| * \ \ Merge commit 'daa77d1' into merge/2.10.x-to-master-1Jason Zaugg2014-03-220-0/+0
| |\ \ \ | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Merged with `-s ours`, all commits in cbb88ac...daa77d1 where backports to 2.10.x or changes to the 2.10.x build. git log --graph --oneline --decorate $MB...origin/2.10.x * daa77d1 (origin/pr/3648, origin/2.10.x) Merge pull request #3602 from xeno-by/topic/backport-vampire-warni |\ | * db300d4 (xenoby/topic/backport-vampire-warning, origin/pr/3602) [backport] no longer warns on calls to vam * | 43e06be Merge pull request #3643 from gkossakowski/2.10.5-nightlies |\ \ | |/ |/| | * a16e003 (origin/pr/3643) Bump version to 2.10.5 for nightly builds. |/ * b66a396 (tag: v2.10.4-RC3, tag: v2.10.4, xenoby/2.10.x, huit/2.10.x) Merge pull request #3491 from retrony |\ | * 5f4011e (retronym/backport/7902, origin/pr/3491) [backport] SI-7902 Fix spurious kind error due to an unit |/ * 5720e97 Merge pull request #3430 from som-snytt/issue/8205-backport |\ | * 8ee165c (origin/pr/3430) SI-8205 [nomaster] backport test pos.lineContent * 50453ce Merge pull request #3415 from xeno-by/topic/reify210x |\ | * d167f14 (origin/pr/3415) [nomaster] corrects an error in reify’s documentation |/ * 6557570 Merge pull request #3359 from huitseeker/issue/VarianceAdaptations |\ | * 806b6e4 (origin/pr/3359, huit/issue/VarianceAdaptations) Backports library changes related to SI-6566 from * d9ee69f Merge pull request #3367 from retronym/backport/3363 * ff13742 (retronym/backport/3363, origin/pr/3367) [nomaster] SI-8146 Fix non-deterministic <:< for deeply nes * cbb88ac [nomaster] Update MiMa and use new wildcard filter
| | * | Merge pull request #3602 from xeno-by/topic/backport-vampire-warningJason Zaugg2014-03-225-1/+62
| | |\ \ | | | | | | | | | | [backport] no longer warns on calls to vampire macros
| | | * | [backport] no longer warns on calls to vampire macrosEugene Burmako2014-03-055-1/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As eloquently elaborated and cleverly named by Travis Brown, macros defined in structural types are useful: http://meta.plasm.us/posts/2013/07/12/vampire-methods-for-structural-types/. However, since such macros are on the intersection of a number of language features, as usual, there are bugs. This commit fixes an unwanted interaction of macros defined in structural types with the scala.language.reflectiveCalls guard. Since macro calls aren't going to be carried to runtime, there's no need to warn about them.
| | * | | Merge pull request #3643 from gkossakowski/2.10.5-nightliesGrzegorz Kossakowski2014-03-191-1/+1
| | |\ \ \ | | | |/ / | | |/| | Bump version to 2.10.5 for nightly builds.
| | | * | Bump version to 2.10.5 for nightly builds.Grzegorz Kossakowski2014-03-191-1/+1
| | |/ /
| | * | Merge pull request #3491 from retronym/backport/7902v2.10.4-RC3v2.10.4Grzegorz Kossakowski2014-02-092-1/+19
| | |\ \ | | | | | | | | | | [backport] SI-7902 Fix spurious kind error due to an unitialized symbol
| | | * | [backport] SI-7902 Fix spurious kind error due to an unitialized symbolJason Zaugg2014-02-092-1/+19
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tracked down this error: <none> is invariant, but type Y2 is declared covariant <none>'s bounds<notype> are stricter than type X2's declared bounds >: Nothing <: Any, <none>'s bounds<notype> are stricter than type Y2's declared bounds >: Nothing <: Any to `Symbol#typeParams` returning `List(NoSymbol)` if the symbol was not initialized. This happends in the enclosed test for: // checkKindBoundsHK() hkArgs = List(type M3) hkParams = List(type M2) This commit forces the symbol of the higher-kinded type argument before checking kind conformance. A little backstory: The `List(NoSymbol)` arises from: class PolyTypeCompleter... { // @M. If `owner` is an abstract type member, `typeParams` are all NoSymbol (see comment in `completerOf`), // otherwise, the non-skolemized (external) type parameter symbols override val typeParams = tparams map (_.symbol) The variation that triggers this problem gets into the kind conformance checks quite early on, during naming of: private[this] val x = ofType[InSeq] The inferred type of which is forced during: def addDerivedTrees(typer: Typer, stat: Tree): List[Tree] = stat match { case vd @ ValDef(mods, name, tpt, rhs) if !noFinishGetterSetter(vd) => // If we don't save the annotations, they seem to wander off. val annotations = stat.symbol.initialize.annotations (cherry picked from commit 03a06e02483eaf442158339c2edd6bcfd99847a3)
| | * | Merge pull request #3430 from som-snytt/issue/8205-backportJason Zaugg2014-01-291-0/+58
| | |\ \ | | | | | | | | | | SI-8205 [nomaster] backport test pos.lineContent
| | | * | SI-8205 [nomaster] backport test pos.lineContentSom Snytt2014-01-291-0/+58
| | | | | | | | | | | | | | | | | | | | Verifies previous behavior.
| | * | | Merge pull request #3415 from xeno-by/topic/reify210xEugene Burmako2014-01-271-5/+5
| | |\ \ \ | | | | | | | | | | | | [nomaster] corrects an error in reify’s documentation
| | | * | | [nomaster] corrects an error in reify’s documentationEugene Burmako2014-01-261-5/+5
| | |/ / /
| | * | | Merge pull request #3359 from huitseeker/issue/VarianceAdaptationsJason Zaugg2014-01-216-6/+6
| | |\ \ \ | | | | | | | | | | | | [backport] Backports library changes related to SI-6566 from a419799
| | | * | | Backports library changes related to SI-6566 from a419799François Garillot2014-01-136-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The idea of backporting this occured while developing the -source flag for SI-8126 : withouth this the library breaks at refchecks for a Scala compiler that checks type aliases variance. This shoudl be BC and promote good hygiene.
| | * | | | Merge pull request #3367 from retronym/backport/3363Jason Zaugg2014-01-2010-1506/+137
| | |\ \ \ \ | | | | | | | | | | | | | | [nomaster] Fix non-deterministic <:< for deeply nested types
| | | * | | | [nomaster] SI-8146 Fix non-deterministic <:< for deeply nested typesJason Zaugg2014-01-157-25/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Backported from master. This is a squashed commmit comprising: SI-8146 Pending test, diagnosis for bug in decidability of <:< (cherry picked from commit 8beeef339ad65f3308ece6fb0440cdb31b1ad404) SI-8146 Test cases for typechecking decidability Taken from "On Decidability of Nominal Subtyping with Variance" (Pierce, Kennedy), which was implemented in 152563b. Part of the implementation (SubTypePair) will be changed in the following commit to fix the non-deterministic errors typechecking heavily nested types involving aliases or annotations. (cherry picked from commit 2e28cf7f76c3d5fd0c2df4274f1af9acb42de699) SI-8146 Fix non-deterministic <:< for deeply nested types In the interests of keeping subtyping decidable [1], 152563b added some bookkeeping to `isSubType` to detect cycles. However, this was based on a hash set containing instances of `SubTypePair`, and that class had inconsistencies between its `hashCode` (in terms of `Type#hashCode`) and `equals` (in terms of `=:=`). This inconsistency can be seen in: scala> trait C { def apply: (Int @unchecked) } defined trait C scala> val intUnchecked = typeOf[C].decls.head.info.finalResultType intUnchecked: $r.intp.global.Type = Int @unchecked scala> val p1 = new SubTypePair(intUnchecked, intUnchecked) p1: $r.intp.global.SubTypePair = Int @unchecked <:<? Int @unchecked scala> val p2 = new SubTypePair(intUnchecked.withoutAnnotations, intUnchecked.withoutAnnotations) p2: $r.intp.global.SubTypePair = Int <:<? Int scala> p1 == p2 res0: Boolean = true scala> p1.hashCode == p2.hashCode res1: Boolean = false This commit switches to using `Type#==`, by way of the standard case class equality. The risk here is that you could find a subtyping computation that progresses in such a manner that we don't detect the cycle. It would need to produce an infinite stream of representations for types that were `=:=` but not `==`. If that happened, we'd fail to terminate, rather than judging the relationship as `false`. [1] http://research.microsoft.com/pubs/64041/fool2007.pdf (cherry picked from commit a09e143b7fd1c6b433386d45e9c5ae3548819b59) Conflicts: src/reflect/scala/reflect/internal/tpe/TypeComparers.scala src/reflect/scala/reflect/runtime/JavaUniverseForce.scala
| | | * | | | [nomaster] Update MiMa and use new wildcard filterJason Zaugg2014-01-153-1481/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | scala.reflect.internal._ now gets a free pass from binary compatibility checking. Previously, we had to excrutiatingly exclude violations individually.
* | | | | | | Merge pull request #3637 from densh/si/8420Jason Zaugg2014-03-252-2/+25
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8420 don't crash on unquoting of non-liftable native type
| * | | | | | | SI-8420 don't crash on unquoting of non-liftable native typeDenys Shabalin2014-03-172-2/+25
| | |_|_|_|_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously quasiquote's type-based dispatch failed to handle situation where unquotee's type is native but non-liftable and was used to splice with non-zero cardinality.
* | | | | | | Merge pull request #3644 from retronym/ticket/8431Jason Zaugg2014-03-253-6/+22
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8428 Fix regression in iterator concatenation
| * | | | | | | SI-8428 Refactor ConcatIteratorJason Zaugg2014-03-242-6/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make the head iterator a constructor parameter, for easier construction and implementation of ++.
| * | | | | | | SI-8428 Fix regression in iterator concatenationJason Zaugg2014-03-202-1/+13
| | |/ / / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Regressed in e3ddb2d7, which introduced `ConcatIterator` to avoid super-linear runtime on chains of concatenated iterators. `ConcatIterator` maintains a queue of thunks for the remaining iterators. Both `next` and `hasNext` delegate to `advance`, which evaluates the thunks and discards any empty iterators from the start of the queue. The first non-empty iterator is stored in the var `current`. It also overrides `++`, and creates a new `ConcatIterator` with the given `that` as an extra element in the queue. However, it failed to copy `current` across, which led to data loss.
* | | | | | | Merge pull request #3642 from adriaanm/release-2.11.0-RC3Grzegorz Kossakowski2014-03-241-8/+8
|\ \ \ \ \ \ \ | |/ / / / / / |/| | | | | | Bump versions for 2.11.0-RC3
| * | | | | | Bump versions for 2.11.0-RC3Adriaan Moors2014-03-181-8/+8
|/ / / / / /
* | | | | | RC3 will ship with akka-actor 2.3.0v2.11.0-RC3Adriaan Moors2014-03-181-1/+1
| | | | | |
* | | | | | Merge pull request #3641 from adriaanm/fixup-3639Adriaan Moors2014-03-181-3/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8341 minor fixup for comments in test
| * | | | | | SI-8341 minor fixup for comments in testAdriaan Moors2014-03-181-3/+3
|/ / / / / /
* | | | | | Merge pull request #3639 from retronym/ticket/8341Adriaan Moors2014-03-183-9/+100
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8341 Refine handoff of undet. params from implicit search
| * | | | | | SI-8341 Refine handoff of undet. params from implicit searchJason Zaugg2014-03-183-9/+100
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In SI-7944 / 251c2b93, we discovered that typechecking of an implicit candidate could leave orphaned undetermined type parameters in the implicit search context. This resulted in naked type parameters leaking into implicit expansions. The fix seemed easy: just copy any symbols from `implicitSearchContext.undetparams` to the enclosing context (other than ones in `SearchResult#subst`). However, the test case in this ticket reveals a subtle flaw in that fix: `implicitSerachContext.undetparams` only contains the type params from the most recently typechecked candidate! Why? Implicit search uses the same context to typecheck all plausibly compatible candidates. The typechecking itself is driven by `typedImplicit1`. Side note, that explains the heisenbug behaviour noted in the ticket: Not *all* plausibly implicit candidates are typechecked. If the current 'best' eligible candidate is more specific than the next candidate, we can skip that altogether.Implicit search actually exploits this for performance by ordering the candidates according to usage statistics. This reordering, means that commenting out lines elsewhere in the file changed the behaviour! This commit simply stores the undet. tparams in the `SearchResult`, where it is safe from the vaguries of typechecking other candidates. That makes `Test1` and `Test2` with in the enclosed test case fail uniformly, both with each other, and with an explicit call to the view. This is ostensibly a regression from 2.10.3. To get there, we need an implicit search that has to infer `Nothing` in a covariant position. In 2.10.3, we would just let the `G` out into the wild, which did the right thing for the wrong reasons.
* | | | | | Merge pull request #3638 from xeno-by/topic/freshname-hotfixv2.11.0-RC2Adriaan Moors2014-03-174-1/+18
|\ \ \ \ \ \ | |/ / / / / |/| | | | | SI-8425 don't create double-dollar names in c.freshName
| * | | | | SI-8425 don't create double-dollar names in c.freshNameEugene Burmako2014-03-184-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we append a dollar to a user-provided prefix that ends in a dollar, we create a potential for confusion for backend phases. That's why this commit prevents such situations from happening.
* | | | | | Merge pull request #3631 from adriaanm/t4492Adriaan Moors2014-03-167-19/+44
|\ \ \ \ \ \ | |/ / / / / |/| | | | | SI-4492 More informative error when class not found on classpath
| * | | | | SI-4492 More informative error when class not found on classpathAdriaan Moors2014-03-147-19/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Position the error based on Select tree that failed to type check, presumably due to an underlying MissingRequirementError, which has no position. There are lots of other ways we could rewrap a MRE and supplement position info, but that remains TODO. Jason's review comment is recorded in the code. Also try to detect the case of a missing module and provide some advice, as well as linking to the forthcoming 2.11 guide at http://docs.scala-lang.org/overviews/core/scala-2.11.html.
* | | | | | Merge pull request #3630 from adriaanm/t8368Adriaan Moors2014-03-142-2/+3
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8368 respect user-supplied scala.usejavacp
| * | | | | | SI-8368 respect user-supplied scala.usejavacpAdriaan Moors2014-03-142-2/+3
| |/ / / / / | | | | | | | | | | | | | | | | | | Now also works when the option is -Dscala.usejavacp=false...
* | | | | | Merge pull request #3617 from VladimirNik/typedTreesPrinter-2.11.0-SI-8386Adriaan Moors2014-03-143-835/+1172
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-8386 showCode fails to pretty print application to assign
| * | | | | | Printers tests uncommentedVladimirNik2014-03-132-1171/+1163
| | | | | | |
| * | | | | | SI-8386 fixedVladimirNik2014-03-112-270/+615
| | | | | | |
* | | | | | | Merge pull request #3598 from som-snytt/issue/8266-amend-adviceAdriaan Moors2014-03-142-2/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-8266 Amend advice for deprecated octal 042
| * | | | | | | SI-8266 Amend advice for deprecated octal 042Som Snytt2014-02-282-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Improve the advice for `f"\042"` to read: ``` use ${'"'} or a triple-quoted literal """with embedded " or \u0022""" instead. ``` as per the discussion on SI-6476. Knuth says that Charles XII came close to introducing octal arithmetic to Sweden, and Wikipedia doesn't deny it. I imagine an alternative history in which octal literals are deprecated in Scala but required by legislation in Akka. #octal-fan-fiction
* | | | | | | | Merge pull request #3624 from puffnfresh/patch-1Adriaan Moors2014-03-141-1/+0
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Remove "will not terminate" from toStream doc
| * | | | | | | | Remove "will not terminate" from toStream docBrian McKenna2014-03-121-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It's at least not always true: scala> val example = Iterator.continually(1).toStream example: scala.collection.immutable.Stream[Int] = Stream(1, ?)
* | | | | | | | | Merge pull request #3629 from xeno-by/topic/setter-conflictAdriaan Moors2014-03-141-0/+4
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-8086 follow-up that fixes the problem with `setter`
| * | | | | | | | | SI-8086 follow-up that fixes the problem with `setter`Eugene Burmako2014-03-131-0/+4
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a super-low risk follow-up for 47dba05 that fixes the same problem with a neighboring method.