summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Stable hashCodes for case objects.Paul Phillips2011-07-013-11/+37
| | | | | | | | | | | | Somehow case objects fell through the cracks and have had default hashCode implementations, leading to new hashCodes on each jvm run. Now we use the productPrefix, and inline it right into the bytecode. scala> None.## == "None".## res0: Boolean = true Closes #4752, no review.
* Fixed a path issue in partest, no review.Paul Phillips2011-07-013-7/+10
|
* Fixes scaladoc layout for function arguments wi...Vlad Ureche2011-07-011-2/+2
| | | | | | Fixes scaladoc layout for function arguments with default values. Contributed by Ruediger Keller. Closes SI-4588, no review.
* Keep BufferedSource from losing buffered data w...Paul Phillips2011-07-013-10/+108
| | | | | | Keep BufferedSource from losing buffered data when a derivative iterator is created via getLines. Closes #4671, #4662, no review.
* Further refinement of the tiark RefinedType patch.Paul Phillips2011-06-301-4/+3
| | | | | I think this is fastest and simplest both. Review by rompf.
* Fix for unfortunate bug in Range.init.Paul Phillips2011-06-302-1/+8
|
* Restored tiark's RefinedType-exclusion fast pat...Paul Phillips2011-06-301-5/+7
| | | | | | | | | | | | Restored tiark's RefinedType-exclusion fast path for implicit search. The issue was that in a subtype check like lhs <:< { val someName } ...you cannot determine it is impossible if the left hand side is an abstract type, because you don't know what its members will be. Review by rompf.
* Having established that r25051 is not responsib...Paul Phillips2011-06-302-9/+3
| | | | | | Having established that r25051 is not responsible for the compilation issue with scalaz, it is hereby restored. Review by moors.
* Fix for recently introduced performance regress...Paul Phillips2011-06-303-7/+7
| | | | | Fix for recently introduced performance regression, no review.
* Small change to doCookJavaInfo, to have it run ...Martin Odersky2011-06-303-8/+12
| | | | | | Small change to doCookJavaInfo, to have it run less often. Some more changes in comments. Review by moors.
* Oh yeah. Backward compatibility stubs, no review.Paul Phillips2011-06-301-0/+5
|
* Warning! Warning! Yes, that's what's in this co...Paul Phillips2011-06-2921-42/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Warning! Warning! Yes, that's what's in this commit. Why are you panicking? Mostly new command line options: -Xlint // basically, the ones which aren't noisy Ywarn-all -Ywarn-dead-code Ywarn-inaccessible // try this one on the library: -it makes some good points Ywarn-nullary-override Ywarn-nullary-unit -Ywarn-numeric-widen Ywarn-value-discard Some accumulated motivations: The wontfix resolution of ticket #4506 indicates that "def foo" and "def foo()" are always going to be treated differently in some situations and the same in others without users having any way to fix it. Summary expressed in latest comment with which I agree (and quite sadly, given that I've done a lot of work to try to make them usable) is "avoid using structural types like the plague." But the least we can do is warn if you're using parentheses "wrong". I think it would be better if the warning about "def foo()" overriding "def foo" were an error instead. If we have to live with this... trait Me { def f(): Int } class A { def f: Int = 5 } class C extends A with Me { } // error: Int does not take parameters def f(x: C) = x.f() // compiles def f(x: Me) = x.f() // error: Int does not take parameters. Mmph, how can a method be // legal with parameter "Foo" and illegal with parameter "Foo with // Bar" ? def f(x: Me with C) = x.f() The warning about a method contains a reference to a type which is less accessible than the method itself is obviously to those who recall it a response to GenTraversable being private and appearing in flatMap's signature during the 2.9.0 RCs. It avoids warning in the case where the unnormalized type is inaccessible but the normalized version would be, but it could use further refinement.
* overeager optimisation caused timeout in neg/t3...Adriaan Moors2011-06-291-4/+4
| | | | | overeager optimisation caused timeout in neg/t3399. no review
* Use the correct encoding in the browsing loader...Iulian Dragos2011-06-291-2/+2
| | | | | | Use the correct encoding in the browsing loader for the presentation compiler. This should be backported to 2.9 and 2.8. no review.
* Export correct packages from MANIFEST.MF.Iulian Dragos2011-06-291-2/+7
|
* Revert "Check that 'info' is only called on the...Iulian Dragos2011-06-294-36/+8
| | | | | | | | Revert "Check that 'info' is only called on the presentation compiler thread. This is a temporary debugging option" This reverts commit 29329aa84a1f8cff4ff866044faf2490a39dadd5.
* slight improvement to lubList so that the simpl...Adriaan Moors2011-06-292-21/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | slight improvement to lubList so that the simple case of lubbing type constructors works. review by extempore the strategy is to detect when the ts in lub(ts) are actually type constructors and remember their type parameters the BTS of a type constructor is a list of proper types (the type constructors have been applied to their dummy arguments, which are simply type refs to the original type parameters) in lubList, we undo this damage by stripping these dummy arguments (they refer to type parameters that are meant to be bound) a better fix would be to actually bind those type parameters that appear free in error, but that would require major changes to the BTS infrastructure example that only kindasorta works now... given: trait Container[+T] trait Template[+CC[X] <: Container[X]] class C1[T] extends Template[Container] with Container[T] C1's BTS contains Template[Container] with Container[T], but that should really be [T] => Template[Container] with Container[T] instead of wrapping it in a polytype, the current approach uses elimHOTparams to patch up this type so that it looks more like a type ctor: Template[Container] with Container, but this is ill-kinded as Template[Container] is a proper type, whereas Container is not the performance impact should be minimal, but caveat reviewer
* Check that 'info' is only called on the present...Iulian Dragos2011-06-294-8/+36
| | | | | | | Check that 'info' is only called on the presentation compiler thread. This is a temporary debugging option for the presentation compiler. no review.
* Profiler suggested it would be worthwhile to sh...Paul Phillips2011-06-297-116/+131
| | | | | | | | Profiler suggested it would be worthwhile to short-circuit allOverriddenSymbols.isEmpty, and one thing led to another. I don't know how much I accomplished performancewise, but the cosmetology is outstanding. Review by moors.
* Continuing to press on RefChecks, discovered wh...Paul Phillips2011-06-281-6/+10
| | | | | | | | | | | | | | | | | | | Continuing to press on RefChecks, discovered what seemed a pretty spectacular performance bug, at least at first. I was disappointed to see that the time gain didn't measure up. Still, nanos are nanos. According to YourKit, millis spent in List#foreach on a compilation of src/library broke down like this: | +---LinearSeqOptimized$class.foreach | 173,123 100 % | | +---RefChecks$RefCheckTransformer.register$1 | 117,658 68 % | I think that is largely a profiler lie, but there is enough truth. After adjusting to prune before recursing, the number of invocations of method register in validateBaseTypes drops by 98%. Review by odersky.
* Suppressing a failing assert which isn't accomp...Paul Phillips2011-06-281-1/+11
| | | | | | | Suppressing a failing assert which isn't accomplishing anything but annoyance. Why is this suddenly tripping with frequency? I do not know. No review.
* Don't infer anonymous classes.Paul Phillips2011-06-276-9/+30
| | | | | | | | | | | | | | possible, just far enough to avoid all kinds of undesirable consequences which accompany the preservation of too much type information. (The problems are akin to inferring the singleton type too freely.) // Example of code which did not compile, but now does class A class B[T <: A](cons: T) object C extends B(new A {}) Closes #4110, #3048. I already ran this by moors, so review by odersky.
* Profiling revealed a suspiciously heavy consume...Paul Phillips2011-06-271-19/+26
| | | | | | | | | | | | | Profiling revealed a suspiciously heavy consumer of CPU time during refchecks called checkOverloadedRestrictions. Turns out it was looking for overloads where more than one method defined default arguments, but with N^2 carved on its checking stick. Time spent in checkOverloadedRestrictions in quick.lib drops from 5800ms to 300ms. Review by rytz.
* Avoided a ton of unnecessary garbage by creatin...Paul Phillips2011-06-261-11/+20
| | | | | | | | Avoided a ton of unnecessary garbage by creating singletons for <:< and =:= and giving them to all comers. Mother Earth is pleased. Thanks to Michael Bayne for pointing out the suboptimality of giving everyone their own instance. Review by moors.
* Generalizing some TreeGen machinery on an oppor...Paul Phillips2011-06-259-49/+97
| | | | | | | Generalizing some TreeGen machinery on an opportunistic basis. Better documenting how Class types and classOf are implemented. Cleaning up the manifest code. No review.
* Test cases close #2782, #2171, no review.Paul Phillips2011-06-253-0/+26
|
* Cosmetic removal of redundant toList call on it...Paul Phillips2011-06-2513-25/+22
| | | | | Cosmetic removal of redundant toList call on iterable target, no review.
* Another one I missed which was fixed by r25149.Paul Phillips2011-06-241-0/+41
|
* Defined tpeHK in a manner consistent with tpe s...Paul Phillips2011-06-242-26/+58
| | | | | | | Defined tpeHK in a manner consistent with tpe so it has a better chance of being found/understood, and tried to clean up its documentation a little bit. Review by moors.
* Integrating feedback from adriaan, changed anot...Paul Phillips2011-06-241-23/+26
| | | | | | Integrating feedback from adriaan, changed another call to tpe to tpeHK and simplified the surrounding method. No review.
* Another one brought to compilation by r25149.Paul Phillips2011-06-241-0/+31
|
* A test case from recently closed #490, no review.Paul Phillips2011-06-241-0/+16
|
* Added sanity check to lub calculation to preven...Paul Phillips2011-06-249-18/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added sanity check to lub calculation to prevent invalid lubs from emerging. The underlying cause of said lubs is that higher-order type parameters are not handled correctly: this is why the issue is seen so frequently in the collections. See pending test pending/pos/those-kinds-are-high.scala for a demonstration. Until that's fixed, we can at least raise the bar a bit. Closes #2094, #2322, #4501. Also, some test cases in neg have been promoted into working programs: #2179, #3774. (They're not in neg for the "shouldn't work" reason, but out of despair.) In some cases, such as the original reported ticket in #3528, this only pushes the problem downfield: it still fails due to inferred type parameters not conforming to bounds. I believe a similar issue with higher-order type parameters underlies that. Look at how far this takes us though. All kinds of stuff which did not work, now works. None of these even compiled until now: scala> :type List(mutable.Map(1 -> 1), immutable.Map(1 -> 1)) List[scala.collection.Map[Int,Int]] scala> :type Set(List(1), mutable.Map(1 -> 1)) scala.collection.Set[Iterable[Any] with PartialFunction[Int,Int]] scala> :type Stream(List(1), Set(1), 1 to 5) Stream[Iterable[Int] with Int => AnyVal{def getClass(): Class[_ >: Int with Boolean <: AnyVal]}] scala> :type Map(1 -> (1 to 10), 2 -> (1 to 10).toList) scala.collection.immutable.Map[Int,scala.collection.immutable.Seq[Int] ] PERFORMANCE: compiling quick.lib and quick.comp, this patch results in an extra 27 subtype tests. Total. Time difference too small to measure. However to be on the safe side I made it really easy to disable. private final val verifyLubs = true // set to false Review by moors, odersky.
* getting the revamped getClass to work on Java 5Adriaan Moors2011-06-238-25/+10
| | | | | | | | | | | | | | | | | hunch by adriaan (needed to change Object to Any in strategic location), location + fix determined by paul, menial work (reverts of obsolete spears and introduction of fix) by adriaan review by extempore Revert "A line missed from spear thrust, no review. Revert " "Thrusting spear into darkened alcove attempting to slay java5 " Revert "New theory: fails running on java 1.5. Put in hack to " discover Revert "Everything builds for me, but apparently not for " jenkins. First "
* Overrode contains and apply in mutable.HashMap ...Paul Phillips2011-06-235-64/+27
| | | | | | | | Overrode contains and apply in mutable.HashMap to avoid allocating an unnecessary Some on every call to either of them. Fruit looks a little better defended in immutable.HashMap, so I deleted a bunch of old debugging code instead. Closes #4469, no review.
* Notice when erasure is trying to cast something...Paul Phillips2011-06-232-3/+23
| | | | | | | | Notice when erasure is trying to cast something to Unit, and don't do it. I'm not sure at what prior point such things should have been caught, but for now we can have a sanity check. Closes #4731, review by odersky.
* Added a -Y option to resolve namespace collisio...Paul Phillips2011-06-232-3/+28
| | | | | | | | | Added a -Y option to resolve namespace collisions between package and object. It's a blunt instrument: if people have lots of these conflicts they need to resolve in individually nuanced fashion, they'll probably remain out of luck. But now people can use YourKit probes without a custom hacked compiler. Let's say this closes #2089. Review by odersky.
* Playing defense against NoSymbol in scaladoc, n...Paul Phillips2011-06-231-2/+2
| | | | | Playing defense against NoSymbol in scaladoc, no review.
* Noticed while working on getClass that most of thePaul Phillips2011-06-232-21/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | implementations for $hash$hash can be inlined directly, with this kind of beautiful change: // source def hash(x1: Int, x2: Int) = x1.## + x2.## // before 0: getstatic #11; //Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$; 3: iload_1 4: invokevirtual #27; //Method scala/runtime/ScalaRunTime$.hash:(I)I 7: getstatic #11; //Field scala/runtime/ScalaRunTime$.MODULE$:Lscala/runtime/ScalaRunTime$; 10: iload_2 11: invokevirtual #27; //Method scala/runtime/ScalaRunTime$.hash:(I)I 14: iadd 15: ireturn // after 0: iload_1 1: iload_2 2: iadd 3: ireturn No review.
* A line missed from spear thrust, no review.Paul Phillips2011-06-221-0/+1
|
* Thrusting spear into darkened alcove attempting...Paul Phillips2011-06-222-7/+11
| | | | | | Thrusting spear into darkened alcove attempting to slay java5 build failure. No review.
* New theory: fails running on java 1.5.Paul Phillips2011-06-225-3/+10
| | | | | truth of theory. No review.
* Moved test for #4727 to where it was supposed t...Paul Phillips2011-06-222-0/+11
| | | | | Moved test for #4727 to where it was supposed to go, no review.
* Everything builds for me, but apparently not fo...Paul Phillips2011-06-221-4/+7
| | | | | | | | | Everything builds for me, but apparently not for jenkins. First attempt to solve mystery: explicitly set return type of Any#getClass() to Class[_ <: Any] rather than allowing java's to be used. I'm guessing that somehow it materializes as Class[_ <: Any] sometimes and Class[_ <: AnyRef] other times. Review by moors.
* A total rewrite of "runtimeClass", discarding t...Paul Phillips2011-06-2217-24/+223
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A total rewrite of "runtimeClass", discarding the user-space approach in favor of simply fixing getClass. def f1 = 5.getClass // Class[Int] def f2 = (5: AnyVal).getClass // Class[_ <: AnyVal] def f3 = (5: java.lang.Integer).getClass // Class[_ <: java.lang.Integer] class A class B extends A def f1 = (new B: Any).getClass().newInstance() // Any def f2 = (new B: AnyRef).getClass().newInstance() // AnyRef def f3 = (new B: A).getClass().newInstance() // A def f4 = (new B: B).getClass().newInstance() // B But that's not all! def f0[T >: B] = (new B: T).getClass().newInstance() def f5 = f0[Any] // Any def f6 = f0[AnyRef] // AnyRef def f7 = f0[A] // A def f8 = f0[B] // B Closes #490, #896, #4696. Review by moors. (Note: I think this is pretty good, but picky review requested.)
* Test case closes #4727, no review.Paul Phillips2011-06-221-0/+7
|
* Updated a test with GenSetLike.Aleksandar Pokopec2011-06-221-1/+1
|
* Removing the package-private modifiers on Gen*L...Aleksandar Pokopec2011-06-228-18/+18
| | | | | | | Removing the package-private modifiers on Gen*Like traits. No review.
* Removed "isInterpreterWrapper" from the conditi...Paul Phillips2011-06-213-1/+14
| | | | | | | | Removed "isInterpreterWrapper" from the conditions which imply an effective root. This was an old hack from before my time which is no longer necessary and then recently became actively hostile. Closes #4710, no review.
* Relaxes a typer check which fails valid code wi...Paul Phillips2011-06-212-8/+25
| | | | | | | | Relaxes a typer check which fails valid code with NoCommonType. If the instantiated types or type bounds do not conform, it tries normalizing the type before throwing the exception. Closes #4553. I wrote this patch with adriaan already, but bonus review by moors.