summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-7569 Fix end position in PostfixSelect treeFrançois Garillot2013-06-243-1/+32
| | | | | | | introduced in 5b54681: the end position of Postfix operators should take the operator length into account. review by @som-snytt
* Merge pull request #2653 from retronym/ticket/7433Grzegorz Kossakowski2013-06-234-1/+24
|\ | | | | SI-7433 Fix spurious warning about catching control throwable
| * SI-7433 Fix spurious warning about catching control throwableJason Zaugg2013-06-234-1/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In the same vein as SI-6994, we have to be careful not to warn about synthetic code. In that case, the spurious warnings came because we warned in the typechecker, which was also called in erasure. In this case, we are issuing the warning in Uncurry, so we must be mindful of the pattern matchers translations of non-trivial catch patterns, which look like: case (ex8 @ _) => { <synthetic> val x5: Throwable = ex8; case11(){ if ({ case14(){ if (x5.$isInstanceOf[NullPointerException]()) matchEnd13(true) else case15() }; case15(){ if (x5.$isInstanceOf[RuntimeException]()) matchEnd13(true) else case16() }; case16(){ matchEnd13(false) }; matchEnd13(x: Boolean){ x } }) This commit detects that `ex8` is synthetic and disables the warning.
* | Merge pull request #2637 from retronym/ticket/7439Paul Phillips2013-06-235-1/+43
|\ \ | | | | | | SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols. …
| * | SI-7439 Avoid NPE in `isMonomorphicType` with stub symbols.Jason Zaugg2013-06-135-1/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `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.
* | | Merge pull request #2668 from soc/SI-7292-fixAdriaan Moors2013-06-214-13/+14
|\ \ \ | | | | | | | | SI-7292 Fixes test failures by updating *.check files
| * | | SI-7292 Fixes test failures by updating *.check filesSimon Ochsenreither2013-06-214-13/+14
|/ / / | | | | | | | | | | | | Looks like partest's confusion about / vs. \ was fixed between the original Jenkins run of the fix for SI-7292 and its merge.
* | | Merge pull request #2342 from soc/SI-7292Adriaan Moors2013-06-207-0/+41
|\ \ \ | | | | | | | | SI-7292 Deprecate octal escape literals
| * | | SI-7292 Deprecate octal escape literalsSimon Ochsenreither2013-04-047-0/+41
| | | |
* | | | Merge pull request #2625 from paulp/pr/no-useless-implicitsGrzegorz Kossakowski2013-06-198-66/+54
|\ \ \ \ | | | | | | | | | | SI-6899, prohibit dangerous, useless implicit conversions.
| * | | | SI-6899, prohibit dangerous, useless implicit conversions.Paul Phillips2013-06-048-66/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increase eligibility requirements for implicit conversions, such that T => U is ineligible if T <: Null <or> AnyRef <: U This has the salutary effect of allowing us to ditch 16 ridiculous implicits from Predef, since they existed solely to work around the absence of this restriction. There was one tiny impact on actual source code (one line in one file) shown here, necessitated because the literal null is not eligible to be implicitly converted to A via <:<. def f[A](implicit ev: Null <:< A): A = null // before def f[A](implicit ev: Null <:< A): A = ev(null) // after As impositions go it's on the tame side.
* | | | | Merge pull request #2628 from retronym/ticket/7364Eugene Burmako2013-06-195-5/+23
|\ \ \ \ \ | | | | | | | | | | | | SI-7364 Allow raw types in parent position in Java sources
| * | | | | SI-7364 Allow raw types in parent position in Java sourcesJason Zaugg2013-06-095-5/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make this work, this commit simply restricts parent type argument inference to Scala source files. The surrounding code has also been refactored to avoid a var.
* | | | | | Merge pull request #2635 from retronym/ticket/7151Grzegorz Kossakowski2013-06-193-2/+33
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7151 Emit final in bytecode for final inner classes.
| * | | | | | SI-7151 Emit final in bytecode for final inner classes.Jason Zaugg2013-06-073-2/+33
| | |_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As we did before a regression in 18efdedfb / SI-5676. This commit tightens up the condition in which the FINAL modifier is omitted; it now *only* does this for the module classes of nested objects.
* | | | | | Merge pull request #2631 from retronym/ticket/5022Grzegorz Kossakowski2013-06-194-4/+42
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-5022 Retain precise existentials through pattern matching
| * | | | | | SI-5022 Retain precise existentials through pattern matchingJason Zaugg2013-06-054-4/+42
| | |/ / / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From the dawn of scalac's existentials, the typer widens existentials pt-s by substituting wildcard types in places of existential quantifiers. In this example: class ForSomeVsUnapply { def test { def makeWrap: Wrap = ??? def useRep[e](rep: (e, X[e])) = () val rep = makeWrap match { case Wrap(r) => r }; useRep(rep) // error } } the type of `r` is the result of typechecking: Apply( fun = TypeTree( tpe = (rep#12037: (e#12038, X#7041[e#12038]) forSome { type e#12038 }) args = Bind(r @ _) :: Nil } This descends to type the `Bind` with: pt = (e#12038, X#7041[e#12038]) forSome { type e#12038 } `dropExistential` clobbers that type to `Tuple2#1540[?, X#7041[?]]`, which doesn't express any relationship between the two instances of the wildcard type. `typedIdent` sort of reverses this with a call to `makeFullyDefined`, but only ends up with: pt = (Any#3330, X#7041[_1#12227]) forSome { type _1#12227; type e#12038 } I suspect that this existential dropping only makes sense outside of typechecking patterns. In pattern mode, type information flows from the expected type onwards to the body of the case; we must not lose precision in the types. For SIP-18 friendly existentials, one `dropExistential` is invertable with `makeFullyDefined`, so this hasn't been such a big problem. The error message improvement conferred by SI-4515 took a hit. That might be a good example to consider when reviewing this change: Does it tell us anything interesting about this `dropExistential` business?
* | | | | | Merge pull request #2657 from gkossakowski/junit-masterGrzegorz Kossakowski2013-06-197-176/+296
|\ \ \ \ \ \ | | | | | | | | | | | | | | Merge JUnit support into master
| * | | | | | Move WeakHashSetTest to junit tests.Grzegorz Kossakowski2013-06-162-174/+171
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The WeakHashSetTest was written as unit test but put into partest's `run` category as we were missing direct unit testing support. That got fixed so moving the test now.
| * | | | | | Merge remote-tracking branch 'scala-2.10.x/junit' into masterGrzegorz Kossakowski2013-06-165-2/+125
| |\ \ \ \ \ \
| | * | | | | | Add Eclipse project for JUnit tests.Grzegorz Kossakowski2013-06-153-0/+50
| | | | | | | |
| | * | | | | | Add support for JUnit testsGrzegorz Kossakowski2013-06-152-2/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add `test.junit` ant target that compiles and runs JUnit tests found in `test/junit` directory. Add `scala.tools.nsc.SampleTest` that demonstrates working testing infrastructure.
| | * | | | | | Merge pull request #2644 from retronym/ticket/7498-backportJason Zaugg2013-06-092-2/+25
| | |\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | [backport] SI-7498 ParTrieMap.foreach no longer crashes
| | | * | | | | | [backport] SI-7498 ParTrieMap.foreach no longer crashesAleksandar Prokopec2013-06-092-2/+25
| | |/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the `split` method of the `ParTrieMap` iterator threw an exception when splitting a splitter that iterated over nodes whose hash codes collide. This was due to reusing the iterator of the list of colliding keys rather than creating a new splitter. This commit changes the `subdivide` method to create a new iterator using the factory method of the current trie map iterator rather than returning a `LinearSeqLike` iterator.
* | | | | | | | Merge pull request #2602 from t3hnar/Duration.toCoarsestAdriaan Moors2013-06-182-0/+64
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Add Duration.toCoarsest method
| * | | | | | | | Add Duration.toCoarsest methodYaroslav Klymko2013-06-102-0/+64
| | | | | | | | |
* | | | | | | | | Merge pull request #2561 from soc/SI-7479Adriaan Moors2013-06-186-3/+64
|\ \ \ \ \ \ \ \ \ | |_|/ / / / / / / |/| | | | | | | | SI-7479 Make test/files/run/tailcalls.scala pass on Avian
| * | | | | | | | SI-7479 Make test/files/run/tailcalls.scala pass on AvianSimon Ochsenreither2013-06-103-1/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit modifies the test and check file to use the new diff filter.
| * | | | | | | | SI-7479 Add avian option to partest's diff filter...Simon Ochsenreither2013-06-063-2/+6
| | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... so that the different results of the test on Avian can be specified in the check file.
* | | | | | | | Merge pull request #2652 from paulp/no-sbt-buildPaul Phillips2013-06-1416-1309/+0
|\ \ \ \ \ \ \ \ | |_|_|_|_|_|_|/ |/| | | | | | | Removed sbt build.
| * | | | | | | Removed sbt build.Paul Phillips2013-06-1316-1309/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Difficult though it may be to accept, it must go. We couldn't keep it working with active maintenance; after eight months of neglect there is no chance. Nobody is working on it or using it. The code will remain in the history if anyone wants it. One of the most annoying experiences one can have when building a new project is finding out one has been fiddling with an abandoned build system which isn't even expected to work. Sometimes I check out a scala project and there is a build.xml, a pom.xml, and a project directory. We should not be among those who sow such build confusion.
* | | | | | | | Merge pull request #2641 from soc/SI-6811-cloneable-definitionPaul Phillips2013-06-131-15/+0
|\ \ \ \ \ \ \ \ | |/ / / / / / / |/| | | | | | | SI-6811 Remove scala.annotation.cloneable
| * | | | | | | SI-6811 Remove scala.annotation.cloneableSimon Ochsenreither2013-06-071-15/+0
| | |_|_|_|/ / | |/| | | | |
* | | | | | | Merge pull request #2645 from soc/SI-6747Paul Phillips2013-06-131-0/+3
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6747 Deprecate Range#{numRange,last,terminal}Element{s,}
| * | | | | | | SI-6747 Deprecate Range#{numRange,last,terminal}Element{s,}Simon Ochsenreither2013-06-091-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are already better replacements which expose less surprising behaviour.
* | | | | | | | Merge pull request #2647 from ↵Grzegorz Kossakowski2013-06-1215-22/+3180
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | retronym/topic/merge-v2.10.2-RC1-35-ga54d86b-to-master merge 2.10.x to master
| * | | | | | | | Merge branch '2.10.x' into topic/merge-v2.10.2-RC1-35-ga54d86b-to-masterJason Zaugg2013-06-1015-22/+3180
|/| | | | | | | | | | |_|_|_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | Conflicts: src/partest/scala/tools/partest/DirectTest.scala
| * | | | | | | Merge pull request #2616 from retronym/ticket/7505Jason Zaugg2013-06-091-0/+16
| |\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7505 Test case for pattern matcher + type alias bug
| | * | | | | | | SI-7505 Test case for pattern matcher + type alias bugJason Zaugg2013-06-081-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Progressed along with SI-7214 in acd74cae09.
| * | | | | | | | Merge pull request #2606 from JamesIry/2.10.x_classfile_52Jason Zaugg2013-06-095-11/+114
| |\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Test for reading JDK 8 (classfile format 52) class files.
| | * | | | | | | | Refactor testing logic for only running under certain JDK versionsJames Iry2013-06-044-18/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We had several tests designed to only run if the JDK version was at least some specified version. This commit refactors that common logic into DirectTest.
| | * | | | | | | | Test for reading JDK 8 (classfile format 52) class files.James Iry2013-05-292-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit includes a test for reading JDK 8 (classfile format 52) class files, in particular default (aka defender) methods. It uses ASM to generate an interface with default methods then exercises that interface from Scala. Surprisingly no changes are necessary to the Scala code base to support reading format 52 class files. Because the test can only run under JDK 8, the JDK version is checked and the expected output is synthesized for previous versions.
| * | | | | | | | | Merge pull request #2611 from retronym/ticket/6481Paul Phillips2013-06-083-1/+21
| |\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-6841 Fix bug at the intersection of DelayedInit and named args
| | * | | | | | | | | SI-6841 Fix bug at the intersection of DelayedInit and named argsJason Zaugg2013-05-303-1/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The DelayedInit transformation analyses the constructor to partition regular initialization from calls to super constructors / trait initializers. It failed to find such super calls if they were nested in a Block, which can happens when using named or default arguments. This commit makes that code peer into Blocks to correctly partition the constructor statements. This change doesn't affect the result of run/t4680.scala, which was mentioned in nearby comments and which chronicles bugs with DelayedInit when used in inheritance hierarchies.
| * | | | | | | | | | Merge pull request #2629 from retronym/ticket/7558Paul Phillips2013-06-082-1/+10
| |\ \ \ \ \ \ \ \ \ \ | | |_|_|/ / / / / / / | |/| | | | | | | | | SI-7558 Fix capture of free local vars in toolbox compiler
| | * | | | | | | | | SI-7558 Fix capture of free local vars in toolbox compilerJason Zaugg2013-06-052-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was creating an `ObjectRef[<notype>]` because of a small bug in `capturedVariableType`.
| * | | | | | | | | | Merge pull request #2626 from retronym/ticket/7556Adriaan Moors2013-06-054-9/+3019
| |\ \ \ \ \ \ \ \ \ \ | | |/ / / / / / / / / | |/| | | | | | | | | SI-7556 Fix runtime reflection involving ScalaLongSignature
| | * | | | | | | | | SI-7556 Fix runtime reflection involving ScalaLongSignatureJason Zaugg2013-06-054-9/+3019
| | |/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Scala type information is stored in classfiles in encoded in a String in the ScalaSignature annotation. When it is too big for a single String, it is split into an array of Strings in a different annotation, ScalaLongSignature. The enclosed test, with a class containing 3000 methods, uses the latter. It exposes a bug in the way runtime reflection decodes that data. It must concatentate and *then* decode, rather that the other way around.
* | | | | | | | | | Merge pull request #2621 from retronym/ticket/7264Paul Phillips2013-06-094-1/+28
|\ \ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | | SI-7264 Initialize owner when searching for companion.
| * | | | | | | | | | SI-7264 Initialize owner when searching for companion.Jason Zaugg2013-06-054-1/+28
| | |_|_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | From ClassSymbol: protected final def companionModule0: Symbol = flatOwnerInfo.decl(name.toTermName).suchThat(sym => sym.isModuleNotMethod && (sym isCoDefinedWith this)) protected final def flatOwnerInfo: Type = { if (needsFlatClasses) info owner.rawInfo } Note the call to `rawInfo`; in the enclosed test case, that gives us back an uninitialized type for the module class of `Foo`, and consequently we don't find the companion for `Foo.Values`. This commit forces the initialization of the owning symbol if it was compiled in a prior run. In addition, it adds a special case to `Run#compiles` for early initialized symbols, which start out in life with the wrong owner. As best as I can see, that complexity stems from allowing early initialized members *without* return types to be used as value arguments to the super call, which in turn is needed to infer parent type arguments. The situation is described a little further in existing comments of `typedPrimaryConstrBody`. This bug is essentially another case of SI-6976. See the comments in pull request of that patch (https://github.com/scala/scala/pull/1910) for commit archaeology that shows why we're reluctant to force the owner info more broadly than is done in this commit.