summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Adds a setting to delay delambdafication. If set then uncurry liftsJames Iry2013-11-0610-21/+264
| | | | | the body of a lambda into a local def. Tests are included to show the different tree shapes.
* Add a skeletal Delambdafy phase.James Iry2013-11-0111-49/+84
| | | | | | This commit adds a do-nothing phase called "Delambdafy" that will eventually be responsible for doing the final translation of lambdas into classes.
* Make future-spec tests not spawn threads in constructors.James Iry2013-11-014-6/+6
| | | | | | | | | The future-spec tests were spawning threads in object constructors which meant they were on the ragged edge of entering deadlock from the static initialization lock acquired during the static initialization blocks we use to construct object reference fields. My work on restructuring lambdas pushed it over the edge. This commit refactors the tests to use class constructors rather than object constructors.
* Merge pull request #3076 from soc/SI-7605-deprecate-proceduresJames Iry2013-10-294-1/+27
|\ | | | | SI-7605 Deprecate procedure syntax
| * SI-7605 Deprecate procedure syntaxSimon Ochsenreither2013-10-244-1/+27
| | | | | | | | | | | | | | | | | | | | This commit covers three cases: - constructor definitions (def this {...}) - concrete method definitions (def foo {...}) - abstract method declarations (def foo) The deprecation is currently hidden behind -Xfuture pending IDE support for migrating users from procedures to methods.
* | Merge pull request #3082 from retronym/ticket/6385Grzegorz Kossakowski2013-10-2914-33/+102
|\ \ | | | | | | SI-6385 Avoid bridges to identical signatures over value classes
| * | SI-6385 Avoid bridges to identical signatures over value classesJason Zaugg2013-10-2814-33/+102
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As Paul noted in the comments to SI-6260 (from which I mined some test cases) "there is no possible basis for conflict here": scala> class C[A](val a: Any) extends AnyVal defined class C scala> class B { def x[A](ca: C[A]) = () } defined class B scala> class D extends B { override def x[A](ca: C[A]) = () } <console>:8: error: bridge generated for member method x: [A](ca: C[A])Unit in class D which overrides method x: [A](ca: C[A])Unit in class B clashes with definition of the member itself; both have erased type (ca: Object)Unit class D extends B { override def x[A](ca: C[A]) = () } ^ What was happening? Bridge computation compares `B#x` and `D#x` exitingErasure, which results in comparing: ErasedValueType(C[A(in B#x)]) =:= ErasedValueType(C[A(in D#x)]) These types were considered distinct (on the grounds of the unique type hash consing), even though they have the same erasure and involve the same value class. That triggered creation of an bridge. After post-erasure eliminates the `ErasedValuedType`s, we find that this marvel of enginineering is bridges `(Object)Unit` right back onto itself. The previous resolution of SI-6385 (d435f72e5fb7fe) was a test case that confirmed that we detected the zero-length bridge and reported it nicely, which happened after related work in SI-6260. But we can simply avoid creating in it in the first place. That's what this commit does. It does so by reducing the amount of information carried in `ErasedValueType` to the bare minimum needed during the erasure -> posterasure transition. We need to know: 1. which value class wraps the value, so we can box and unbox as needed 2. the erasure of the underlying value, which will replace this type in post-erasure. This construction means that the bridge above computation now compares: ErasedValueType(C, Any) =:= ErasedValueType(C, Any]) I have included a test to show that: - we don't incur any linkage or other runtime errors in the reported case (run/t6385.scala) - a similar case compiles when the signatures align (pos/t6260a.scala), but does *not* compile when the just erasures align (neg/t6260c.scala) - polymorphic value classes continue to erase to the instantiated type of the unbox: (run/t6260b.scala) - other cases in SI-6260 remains unsolved and indeed unsolvable without an overhaul of value classes: (neg/t6260b.scala) In my travels I spotted a bug in corner case of null, asInstanceOf and value classes, which I have described in a pending test.
* | | Merge pull request #3069 from adriaanm/build-maven-publishAdriaan Moors2013-10-2812-1033/+958
|\ \ \ | | | | | | | | Rework build to allow publishing core to maven
| * | | Bundle source and class file bundling in osgi bundling.Adriaan Moors2013-10-251-85/+59
| | | | | | | | | | | | | | | | Fix oversight in not skipping scalap's ad-hoc published docs on docs.skip.
| * | | Tidy pom xml files.Adriaan Moors2013-10-257-366/+358
| | | |
| * | | Fail build on error in signed maven publish.Adriaan Moors2013-10-251-1/+1
| | | |
| * | | Build cleanup. Prepare for scaladoc module build.Adriaan Moors2013-10-222-49/+52
| | | |
| * | | Targets for publishing core to maven.Adriaan Moors2013-10-221-11/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ant publish-core-signed-opt-nodocs` creates and publishes the smallest possible set of jars (library/reflect/compiler) we can send to maven. It uploads jars with class files and sources, but no docs (so that we don't need to build scaladoc or any other modules). `ant publish-core-signed-opt` is similar, but also publishes docs. For local experimentation: `ant publish-core-local-nodocs`. With a little bit more work, this can be used instead of `replacestarr`.
| * | | Towards minimal build for publishing core to maven.Adriaan Moors2013-10-223-241/+253
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use `unless` attribute in targets so that `docs.skip` influences dependency graph. Create `scaladoc` task in `pack.core` so that we don't need `pack.done` for publishing the core. Move source bundle creation from `dist.src` to `osgi.core`/`osgi.done`. Split dependencies of maven publishing into core/all variants: `osgi.core` creates osgi bundles for just lib/reflect/comp.
| * | | Support publishing to maven from main buildAdriaan Moors2013-10-222-100/+129
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Publish to maven with `ant publish.local`, `ant publish`, or `ant publish.signed`. For now, we must keep copying `src/build/maven/maven-deploy.xml` to `dists/maven/latest.build.xml`, along with its dependencies, as it's used by jenkins jobs and PR validation. TODO: `inline src/build/maven/maven-deploy.xml` into `build.xml`.
| * | | Simplify packing, align maven-deploy and pack-maven.Adriaan Moors2013-10-211-173/+101
| | | |
| * | | Inline src/build/pack.xml into build.xml.Adriaan Moors2013-10-212-273/+233
| | | | | | | | | | | | | | | | It tended too easily to get out of synch with build.xml.
| * | | Continuations plugin gets its own osgi source bundle.Adriaan Moors2013-10-211-9/+14
| | | |
| * | | Generate scaladoc for each subproject.Adriaan Moors2013-10-211-68/+63
| | | |
| * | | Untangle classpaths related to doc targets.Adriaan Moors2013-10-211-16/+26
| | | |
| * | | Remove dead target: locker.actorsAdriaan Moors2013-10-211-8/+0
| | | |
| * | | Clarify comment.Adriaan Moors2013-10-211-1/+2
| | | |
| * | | Correct license to 3-clause BSD in poms.Adriaan Moors2013-10-217-21/+14
| | | |
* | | | Merge pull request #3080 from retronym/topic/empty-checkJason Zaugg2013-10-2764-16/+0
|\ \ \ \ | |_|/ / |/| | | Check file maintainence
| * | | Remove orphaned check files and flags files.Jason Zaugg2013-10-275-16/+0
| | | | | | | | | | | | | | | | (for f in $(find test -name '*.check' -o -name '*.flags'); do bare=$(echo $f | sed -E 's/\.\w+$//'); ([[ -f "$bare" ]] || [[ -d "$bare" ]] || [[ -f "$bare.scala" ]] || [[ -f "$bare.test" ]] || echo $f) done;) | xargs rm
| * | | Remove empty check files and flags files.Jason Zaugg2013-10-2759-0/+0
|/ / / | | | | | | | | | for f in $(find test -name '*.check' -o -name '*.flags'); do [[ $(wc -c $f | sed -E 's/ *([0-9]+).*/\1/') == "0" ]] && rm $f; done
* | | Merge pull request #3073 from retronym/ticket/7928Jason Zaugg2013-10-252-1/+21
|\ \ \ | | | | | | | | Favour module accessors symbols in rebind
| * | | SI-7928 Favour module accessors symbols in rebindJason Zaugg2013-10-232-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Refchecks tree transformer transforms a nested modules that overrides a method into a pair of symbols: the module itself, and an module accessor that matches the overridden symbol. [[syntax trees at end of typer]] // test1.scala package <empty> { abstract trait C2 extends scala.AnyRef { def O1: Any }; class C1 extends AnyRef with C2 { object O1 extends scala.AnyRef } } [[syntax trees at end of refchecks]] // test1.scala package <empty> { abstract trait C2 extends scala.AnyRef { def O1: Any }; class C1 extends AnyRef with C2 { object O1 extends scala.AnyRef @volatile <synthetic> private[this] var O1$module: C1.this.O1.type = _; <stable> def O1: C1.this.O1.type = { C1.this.O1$module = new C1.this.O1.type(); C1.this.O1$module } } } When constructing a TypeRef or SingleType with a prefix and and a symbol, the factory methods internally use `rebind` to see if the provided symbol should be replaced with an overriding symbol that is available in that prefix. Trying this out in the REPL is a bit misleading, because even if you change phase to `refchecks`, you won't get the desired results because the transform is not done in an InfoTransformer. scala> val O1 = typeOf[C1].decl(TermName("O1")) O1: $r.intp.global.Symbol = object O1 scala> typeRef(typeOf[C2], O1, Nil) res13: $r.intp.global.Type = C2#O1 scala> res13.asInstanceOf[TypeRef].sym.owner res14: $r.intp.global.Symbol = class C1 But debugging the test case, we get into `rebind` during an AsSeenFrom which is where we crashed when `suchThat` encountered the overloaded module and module accessor symbols: typeOf[OuterObject.Inner.type].memberType(symbolOf[InnerTrait.Collection]) ... singleTypeAsSeen(OuterTrait.this.Inner.type) val SingleType(pre, sym) = tp // pre = OuterTrait.this.type // sym = OuterTrait.Inner val pre1 = this(pre) // OuterObject.type singleType(pre1, sym) rebind(pre1, sym) // was crashing, now OuterObject.Inner } This commit excludes the module symbol from symbol lookup in the prefix in rebind.
* | | | Merge pull request #3079 from jamesward/fix/ec-implicit-errorJames Iry2013-10-251-1/+1
|\ \ \ \ | | | | | | | | | | More clear implicitNotFound error for ExecutionContext
| * | | | More clear implicitNotFound error for ExecutionContextJames Ward2013-10-241-1/+1
| | | | |
* | | | | Merge pull request #3077 from retronym/topic/phase-descAdriaan Moors2013-10-246-6/+6
|\ \ \ \ \ | | | | | | | | | | | | Update description of explicitouter phase.
| * | | | | Update description of explicitouter phase.Jason Zaugg2013-10-246-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | Patern translation now happens earlier.
* | | | | | Merge pull request #3006 from ivmaykov/masterAdriaan Moors2013-10-242-0/+58
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | SI-7883 - don't iterate over all keys in MapWrapper.containsKey()
| * | | | | SI-7883: Added a comment per CR feedback from @adriaanm, @IchoranIlya Maykov2013-10-031-0/+3
| | | | | |
| * | | | | SI-7883 - don't iterate over all keys in MapWrapper.containsKey()Ilya Maykov2013-10-012-0/+55
| | | | | |
* | | | | | Merge pull request #3074 from Jentsch/filterInDocsJason Zaugg2013-10-241-33/+38
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Prevent useless filter operation in docs
| * | | | | Prevent useless filter operation in docsJentsch2013-10-231-33/+38
| | | | | |
* | | | | | Merge pull request #3027 from etaty/patch-2Jason Zaugg2013-10-231-1/+1
|\ \ \ \ \ \ | | | | | | | | | | | | | | IterableLike grouped : fix documentation
| * | | | | | IterableLike.grouped() : More explicit documentationValerian2013-10-141-1/+1
| | | | | | |
| * | | | | | IterableLike grouped : fix documentationValerian2013-10-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | scala> Seq(1,2,3).grouped(2).toList res1: List[Seq[Int]] = List(List(1, 2), List(3))
* | | | | | | Merge pull request #3026 from retronym/ticket/3871Jason Zaugg2013-10-234-0/+242
|\ \ \ \ \ \ \ | |_|_|_|_|_|/ |/| | | | | | Tests for protected access
| * | | | | | SI-3871 Testing protected access against the specJason Zaugg2013-10-232-0/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've marked a few minor cases in the test with !!! where I believe the behaviour goes beyond the spec.
| * | | | | | SI-3871 Missing test case for protected bug.Jason Zaugg2013-10-092-0/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | c39f26382dddaa7 fixed the bug but didn't commit a test case.
* | | | | | | Merge pull request #3039 from huitseeker/filter-partest-JAVA_OPTIONSJason Zaugg2013-10-231-0/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Filter JVM debug output for custom options in partest
| * | | | | | | Filter JVM debug output for custom options in partestFrançois Garillot2013-10-151-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The Picked up _JAVA_OPTIONS line occurs on Sun's JDK as a debug output when you use that variable to set up custom VM options
* | | | | | | | Merge pull request #3059 from densh/pull/si-6840Jason Zaugg2013-10-233-2/+11
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-6840 fixes weird typing of quasiquote arguments
| * | | | | | | | SI-6840 fixes weird typing of quasiquote argumentsDen Shabalin2013-10-193-2/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously quasiquote arguments were type checked against Any which caused weird inference that made splicing of complex expressions unusable: val l1 = List(q"foo") val l2 = List(q"bar") q"f(..${l1 ++ l2})" // argument type checked as Any instead of List[Tree] This is fixed by forcing compiler to type check against type variable which itself isn't used in any other way.
* | | | | | | | | Merge pull request #3070 from xeno-by/topic/macro-impl-wrong-shapeJason Zaugg2013-10-2310-9/+41
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | better macro impl shape errors
| * | | | | | | | | better macro impl shape errorsEugene Burmako2013-10-2310-9/+41
| |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | With the advent of quasiquotes, we allowed both arguments and return types of macro impls to be c.Tree's (as opposed to traditional c.Expr[T]'s). This warrants an update of macro def <-> macro impl signature mismatch errors that include a printout of suggested macro impl signatures. Now along with a signature that contains exprs, we suggest another signature that has all exprs replaced by trees
* | | | | | | | | Merge pull request #3068 from retronym/ticket/7020-3-1Jason Zaugg2013-10-235-12/+15
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Deterministic warnings for pattern matcher, take 2