summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-8195 Test case to show this is a dup of SI-8196Jason Zaugg2014-03-111-2/+23
| | | | Which was fixed in the previous commit.
* SI-8196 Runtime reflection robustness for STATIC impl detailsJason Zaugg2014-03-114-4/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala's runtime reflection works in few modes. The primary mode reads reads out the pickled signatures from ScalaSig annotations, if avaialable. However, these aren't available for Java-defined classes (obviously) nor for local Scala-defined classes (less obviously.), and the Scala `Symbol`s and `Types` must be reconstructed from the Java generic reflection metadata. This bug occurs in the last case, and is centered in `FromJavaClassCompleter`. In that completer, member fields and methods are given an owner based on the STATIC modifier. That makes sense for Java defined classes. I'm not 100% if it makes sense for Scala defined classes; maybe we should just skip them entirely? This patch still includes them, but makes the ownership-assignment more robust in the face of STATIC members emitted by the Scala compiler backend, such as the cache fields for structural calls. (It's reflection all the way down!). We might not have a companion module at all, so before we ended up owning those by `NoSymbol`, and before too long hit the dreaded NSDHNAO crash. That crash doesn't exist any more on 2.11 (it is demoted to a -Xdev warning), but this patch still makes sense on that branch. This commit makes `followStatic` and `enter` more robust when finding a suitable owner for static members. I've also factored out the duplicated logic between the two.
* 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 #3356 from retronym/ticket/8138Jason Zaugg2014-01-182-5/+31
|\ \ \ \ | | | | | | | | | | Fix bug with super-accessors / dependent types
| * | | | SI-8143 Fix bug with super-accessors / dependent typesJason Zaugg2014-01-122-5/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-152-3/+18
|\ \ \ \ \ | |_|/ / / |/| | | | [nomaster] Backport variance validator performance fix
| * | | | [nomaster] SI-8152 Backport variance validator performance fixJason Zaugg2014-01-142-3/+18
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | % 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 #3328 from retronym/ticket/8111v2.10.4-RC2Jason Zaugg2014-01-122-0/+47
|\ \ \ \ | |/ / / |/| | | 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-062-0/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-112-1/+41
|\ \ \ \ | | | | | | | | | | [nomaster] Binary compat. workaround for erasure bug
| * | | | [nomaster] SI-8114 Binary compat. workaround for erasure bug SI-7120Jason Zaugg2014-01-092-1/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | | Merge pull request #3344 from jamesward/fix/ec-implicit-errorJason Zaugg2014-01-091-1/+1
|\ \ \ \ \ | |/ / / / |/| | | | More clear implicitNotFound error for ExecutionContext
| * | | | More clear implicitNotFound error for ExecutionContextJames Ward2014-01-081-1/+1
|/ / / /
* | | | Merge pull request #3329 from retronym/ticket/6563Eugene Burmako2014-01-062-0/+12
|\ \ \ \ | |/ / / |/| | | SI-6563 Test case for already-fixed crasher
| * | | SI-6563 Test case for already-fixed crasherJason Zaugg2014-01-062-0/+12
|/ / / | | | | | | | | | Progressed to working in SI-7636 / c4bf1d5.
* | | Merge pull request #3312 from xeno-by/topic/fine-points-of-whiteboxity-210xJason Zaugg2013-12-306-0/+98
|\ \ \ | |/ / |/| | (2.10.x) codifies the state of the art wrt SI-8104
| * | [nomaster] codifies the state of the art wrt SI-8104Eugene Burmako2013-12-286-0/+98
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | As it was discovered in SI-8104, whiteboxity doesn’t apply equally to type parameters and type members of materialized type classes. During implicit search and subsequent type inference, whitebox type parameters are consistently erased to wildcards, whereas whitebox type members sometimes remain as is and get in the way of signature conformance checks. Unfortunately, 2.10.x can’t make use of type parameter whiteboxity, because it requires fundep materializers that were only merged into 2.11: https://github.com/scala/scala/pull/2499, and therefore Si-8104 seems to be a hard blocker for 2.10.x at the moment. Stay tuned for updates.
* | Merge pull request #3282 from retronym/ticket/8085Adriaan Moors2013-12-1813-2/+110
|\ \ | | | | | | Fix BrowserTraverser for package objects
| * | SI-8085 Fix BrowserTraverser for package objectsJason Zaugg2013-12-1811-13/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
| * | Test demonstrating SI-8085Mirco Dotta2013-12-186-0/+55
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * The presentation compiler sourcepath is now correctly set-up. * Amazingly enough (for me at least), the outer import in the package object seem to be responsible of the faulty behavior. In fact, if you move the import clause *inside* the package object, the test succeed! The test's output does provide the correct hint of this: ``` % diff /Users/mirco/Projects/ide/scala/test/files/presentation/t8085-presentation.log /Users/mirco/Projects/ide/scala/test/files/presentation/t8085.check @@ -1,3 +1,2 @@ reload: NodeScalaSuite.scala -prefixes differ: <empty>.nodescala,nodescala -value always is not a member of object scala.concurrent.Future +Test OK ``` Notice the ``-prefixes differ: <empty>.nodescala,nodescala``. And compare it with the output when the import clause is placed inside the package object: ``` % diff /Users/mirco/Projects/ide/scala/test/files/presentation/t8085-presentation.log /Users/mirco/Projects/ide/scala/test/files/presentation/t8085.check @@ -1,4 +1,2 @@ reload: NodeScalaSuite.scala -reload: NodeScalaSuite.scala -open package module: package object nodescala Test OK ``` Notice now the ``-open package module: package object nodescala``!
* | Merge pull request #3268 from adriaanm/support-3021v2.10.4-RC1Adriaan Moors2013-12-124-6/+37
|\ \ | | | | | | Report error on code size overflow, log method name.
| * | Report error on code size overflow, log method name.Adriaan Moors2013-12-124-6/+37
|/ / | | | | | | | | | | | | 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.
* | Partially revert f8d8f7d08d.Adriaan Moors2013-12-111-0/+1
| | | | | | | | | | | | | | | | Need `${dist.dir}/lib/scala-partest.jar` for maven publish. We still don't want to distribute it in the distribution, but will have to remove it in release script, as 2.10.x's build hasn't been refactoreded like master's, and I'm not backporting it.
* | Merge pull request #3261 from adriaanm/ticket-6426Adriaan Moors2013-12-114-18/+6
|\ \ | | | | | | Revert ", importable _."
| * | Revert "SI-6426, importable _."Adriaan Moors2013-12-104-18/+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-116-5/+20
|\ \ \ | |/ / |/| | Fix inliner cycle with recursion, separate compilation
| * | SI-8062 Fix inliner cycle with recursion, separate compilationJason Zaugg2013-12-106-5/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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).
* | | Fixup #3248 missed a spot in pack.xmlAdriaan Moors2013-12-101-1/+1
| | | | | | | | | | | | | | | Forgot to run `ant distpack` to verify, only did `dist.done`. Implemented the rename of `doc/scala-devel-docs` to `api`.
* | | Merge pull request #3249 from retronym/ticket/7912Adriaan Moors2013-12-102-2/+24
|\ \ \ | | | | | | | | SI-7912 Be defensive calling `toString` in `MatchError#getMessage`
| * | | SI-7912 Be defensive calling `toString` in `MatchError#getMessage`Jason Zaugg2013-12-102-2/+24
| | | | | | | | | | | | | | | | | | | | Otherwise, objects with exception-throwing `toString` lead to a cascading error far removed from the originally failed match.
* | | | Merge pull request #3251 from retronym/ticket/8060Adriaan Moors2013-12-102-1/+12
|\ \ \ \ | | | | | | | | | | SI-8060 Avoid infinite loop with higher kinded type alias
| * | | | SI-8060 Avoid infinite loop with higher kinded type aliasJason Zaugg2013-12-102-1/+12
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The `dealiasLocals` map was assuming that: tp.isAliasType implies (tp.dealias ne tp) This isn't true if `!typeParamsMatchArgs`. This commit avoids the infinite loop by checking whether or not dealiasing progresses.
* | | | Merge pull request #3248 from adriaanm/dist-cleanup-licensesAdriaan Moors2013-12-10113-6236/+303
|\ \ \ \ | |/ / / |/| | | Clean up Scala distribution a bit.
| * | | Update README, include doc/licenses in distroAdriaan Moors2013-12-107-66/+301
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We forgot to copy the licenses directory to the dists/ directory, so that they weren't included in the binary distribution. I did some house cleaning while I was at it. We no longer distribute ant as far as I can see (we used to for the sbt build, but that was long since removed). Added license for ASM, and Jansi (just to be sure).
| * | | Add attribution for Typesafe.Adriaan Moors2013-12-091-0/+2
| | | | | | | | | | | | | | | | This was agreed on a while ago, but not yet implemented.
| * | | Remove docs/examples; they reside at scala/scala-distAdriaan Moors2013-12-09104-6120/+1
| | | |
| * | | Remove unused android test and corresponding license.Adriaan Moors2013-12-093-43/+0
| | | |
| * | | Do not distribute partest and its dependencies.Adriaan Moors2013-12-091-8/+0
| | | |
* | | | 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