summaryrefslogtreecommitdiff
path: root/test/files/pos
Commit message (Collapse)AuthorAgeFilesLines
...
* Fixes #4112. Closes #4112.Aleksandar Pokopec2011-01-101-0/+12
| | | | | No review.
* Override checks and self-types still needed som...Paul Phillips2011-01-081-0/+13
| | | | | | | | | Override checks and self-types still needed some work (ticket #2808.) I believe this is the right change. The modifications in parallel and actors were a result of the files failing to compile after the change to allOverriddenSymbols. (I am taking the position that that aspect is a feature.) Review by malayeri, odersky.
* Closes #3869. no review.Iulian Dragos2011-01-041-0/+10
|
* An Ordering for Seq and all of its descendents.Paul Phillips2010-12-211-0/+7
| | | | | small, very focused taste of Ordering contravariance. No review.
* Minor changes.Aleksandar Pokopec2010-12-091-3/+3
| | | | | No review.
* again: relax access boundry check for overridin...Lukas Rytz2010-12-082-0/+17
| | | | | | again: relax access boundry check for overriding protected java members. review by eugenevigdorchik.
* Test case closes #3642, no review.Paul Phillips2010-12-072-0/+10
|
* Reverts previous commit: needs a new starr..Lukas Rytz2010-12-072-10/+0
| | | | | This reverts commit 99652fe553a1a5b0c551950e8178e867943a088f.
* follow up on fix #3946.Lukas Rytz2010-12-072-0/+10
|
* close #4036, fix #2489.Lukas Rytz2010-12-031-0/+13
|
* close #3951. review by dubochet.Lukas Rytz2010-12-032-0/+40
|
* Added test for #4052Hubert Plociniczak2010-12-031-0/+5
|
* It's a big one!Paul Phillips2010-12-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TermName and TypeName are exposed throughout the compiler based on what kind of name a given abstraction ought to have. (There remain places where one needs to create a name without knowing yet what it will be, and those will always be Names.) The nme object in the compiler now holds only term names. To reference a known type name, use tpnme: nme.List == ("List": TermName) tpnme.List == ("List": TypeName) The contents of nme and tpname are defined in traits, many of which are shared, so if a name should exist only as a Type and not a Term, it should be defined in CompilerTypeNames, but otherwise in CompilerTermNames or CompilerCommonNames. This is partially complete but I'm sure there are still many shared which should pick a side. Usage of .toTermName and .toTypeName is strongly discouraged. After the dust has settled, there will be very few places where it will make sense to hop between namespaces like that. There are some implicits to smooth everything out, most of which should be removable eventually. // these two are in no hurry to go anywhere String => TermName String => TypeName // but not String => Name: def view in the compiler is no longer implicit // these two are temporary, and can log when they kick off to help us flush // out remaining issues of "name migration" Name => TermName Name => TypeName There is more work to be done before we're properly protected from naming errors, but I will not allow another eight hour tragedy to befall lukas or anyone else! Review by rytz. (Formality.)
* Deprecated the @serializable annotation, introd...Lukas Rytz2010-11-301-0/+6
| | | | | | | | | | | | | | | | | | | Deprecated the @serializable annotation, introduce a new trait "scala.Serializable" which has to be extended instead (cross-platform). Known issues: - Companion objects of serializable classes (including case classes) are automatically made serializable. However, they don't extend "Serializable" statically because of the known difficulty (should be done before typing, but hard). - Writing "case class C() extends Serializable" gives "error: trait Serializable is inherited twice" - Functions are serializable, but don't extend Serializable dynamically (could be fixed by making FunctionN Serializable - shouldn't we?) Note that @SerialVersionUID continues to be an annotation; it generates a static field, which is not possible otherwise in scala. Review by dragos, extempore. Question to dragos: in JavaPlatform.isMaybeBoxed, why is there a test for "JavaSerializableClass"? Is that correct?
* The initial implementation of TraversableOnce c...Paul Phillips2010-11-291-0/+8
| | | | | | | | | | | | | | | | | | The initial implementation of TraversableOnce could not supply concrete methods or even signatures for map and flatMap because they have different signatures in Iterator and TraversableLike. But we can take another approach which works out as nicely: 1) Create implicits which install those methods and flatten on TraversableOnce instances. 2) Generalize the signatures of flatten and flatMap to work with A => TraversableOnce[B] instead of A => Traversable[B]. And voila, you can mix and match Iterators and Traversables in a for comprehension, map, flatMap, and flatten, without the tedious process of sprinkling .iterator or .toList around to appease the compiler. No review.
* "I invite everyone to change this rule, and obs...Paul Phillips2010-11-291-0/+4
| | | | | | | | | | | | | | | | | | | | | "I invite everyone to change this rule, and observe what breaks!" This much beloved comment from #1208 has been on my radar for two years. The worm has turned. Closes #1208. The inferred type of an object is now Foo.type instead of "object Foo". What once was this: scala> val x: Map[Int, Singleton] = Map(1 -> None) <console>:5: error: type mismatch; found : (Int, object None) required: (Int, Singleton) Now exudes a pleasing aura of workingness: scala> val x: Map[Int, Singleton] = Map(1 -> None) x: Map[Int,Singleton] = Map(1 -> None) No review.
* Test case closes #3106, no review.Paul Phillips2010-11-281-0/+7
|
* protected[this] members should be accessible to...Paul Phillips2010-11-101-0/+13
| | | | | | protected[this] members should be accessible to super.x calls. Closes #464, review by odersky.
* Deprecation patrol.Paul Phillips2010-11-081-0/+8
| | | | | | | | | the same issues as JavaConversions with respect to overloading implicit methods making them inaccessible to view bounds. Fixed JavaConverters. Added a warning for when people overload parameterized implicits: in almost all cases the name is irrelevant so there's little point in unwittingly suffering degraded functionality. No review.
* Fixed crasher with @elidable on parameterized m...Paul Phillips2010-11-081-0/+10
| | | | | | Fixed crasher with @elidable on parameterized methods. Closes #3981, no review.
* This is work on -Ycheck:icode.Paul Phillips2010-11-081-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | distribution can now be built with that option, with or without optimization, and almost all tests cases can. (Those which can't are due to different -Ycheck: issues.) Major changes of interest are as follows: * LOAD_EXCEPTION and THROW are parameterized on the throwable symbol. * Does not squash all traits down to AnyRef, but instead deals with issues as they arise. By observation the cases where one needs a "Foo with Product" to manifest as both a "Foo" and a "Product" at different places are quite rare, so we need not throw out the whole baby. * Exception handlers now have positions. * The remaining checker failures removed, such as CALL_METHOD wanting to pop a value off the stack after calling a constructor. * Many multiply defined values such as REFERENCE(ObjectClass) put in one place (ICodes.scala) and reused. * -Ycheck:icode output (if also given -Ydebug) worthy of Michelangelo. Here is a class and the -Ycheck:icode -Ydebug output for f's block. class A { def f(x: Int, y: String) = try println(x + y.length) catch { case x: NullPointerException => () } } ** Checking Block 4 [S: 3, 2] [P: 1] <closed> 1-> REF(singleton class Predef) 3 + LOAD_MODULE object Predef 2-> INT 3 + LOAD_LOCAL(value x) 3-> REF(class String) 3 + LOAD_LOCAL(value y) 2<- REF(class String) 3 - CALL_METHOD java.lang.String.length (dynamic) 3-> INT 3 + CALL_METHOD java.lang.String.length (dynamic) 2<- INT 3 - CALL_PRIMITIVE(Arithmetic(ADD,INT)) 1<- INT 3 - """ 2-> INT 3 + CALL_PRIMITIVE(Arithmetic(ADD,INT)) 1<- INT 3 - BOX INT 2-> REF(class Integer) 3 + BOX INT 1<- REF(class Integer) 3 - CALL_METHOD scala.Predef.println (dynamic) 0<- REF(singleton class Predef) 3 - CALL_METHOD scala.Predef.println (dynamic) Review by dragos (I marked the specific spots I thought of interest with "PP to ID" which makes it sound like I'm talking to my primal self. Next week on programmer theater: "PP to SUPEREGO.")
* Closes #3927. No reviewHubert Plociniczak2010-11-021-0/+6
|
* Created @strictfp annotation in scala.annotation.Paul Phillips2010-11-011-0/+11
| | | | | | your fp with no tolerance for tomfoolery, this is the commit for you. Closes #1708, review by community.
* A double goodness whammy involving type inferen...Paul Phillips2010-10-271-0/+6
| | | | | | | | | | | | | | | | | | | | A double goodness whammy involving type inference at the borders. 1) Implicit search preserves singleton type fidelity. 2) Unification of parent bounds is (closer to) correct. Result of 1: "implicit def f(x: Foo.type)" will convert object Foo. Result of 2: "new Trait[Int] { }" may enjoy its type constructor being inferred, no longer foiled by the anonymous class. Also included are some clarity-enhnancing renamings and refactorings. Performance note: I heavily benchmarked the change to isSubArgs and it is reproducibly faster than the previous implementation. Numbers and methodology available upon request. Closes #2693, #3964. Review by moors, who wrote most of this patch but might like to review the comments.
* Test for long fixed bug. Closes #2119, no review.Paul Phillips2010-10-261-0/+4
|
* Added test for #3312 which it looks like was fi...Paul Phillips2010-10-261-0/+17
| | | | | | Added test for #3312 which it looks like was fixed long ago but not closed. Closes #3312, no review.
* A modifier's work is never done.Paul Phillips2010-10-262-0/+82
| | | | | | | protected and its bevy of corner cases. Closes #3939, #3947. This patch is intended for both trunk and 2.8.1. Already reviewed and co-authored by moors, and review by oderksy.
* Closes #3670, #3877.Hubert Plociniczak2010-10-201-0/+43
|
* Closes #2910.Hubert Plociniczak2010-10-201-0/+33
|
* Disambiguated all the implicits in JavaConversi...Paul Phillips2010-10-161-0/+7
| | | | | | | | | | Disambiguated all the implicits in JavaConversions. All the documentation had fallen out of date so I fixed that up too, in the process converting from HTML to wikiformatting. (Wouldn't it be nice to mass convert trunk out of the HTML tags?) Closes #3688, no review.
* new tests. no review.Martin Odersky2010-10-166-0/+58
|
* Modification to the widening logic to treat loc...Paul Phillips2010-10-141-0/+17
| | | | | | | | | | | | | | | | | | Modification to the widening logic to treat locally defined symbols like final members thus allowing more constants to be inlined. Concretely, that means that in code like this: def f: Unit = { val b = false ; if (b) println("ok") } The call to println is no longer generated at all, and in this code: def f(x: Int) = { val X = 1 ; val Y = 2; x match { case X => 1 ; case Y => 2 } } A tableswitch is generated instead of the present if/then/else. I also added a big comment to the former widenIfNotFinal (now widenIfNecessary for obvious reasons.) Review by rytz.
* closes #3862.Adriaan Moors2010-10-131-0/+8
|
* closes #3281, #3866.Adriaan Moors2010-10-131-0/+17
| | | | | | | | | | | I don't understand why we had to clear() the undoLog in the first place, since the undoXXX methods increase and decrease its size symmetrically, so the log should always be empty once they have all unwound. Was it a (premature) optimisation or was there some kind of semantic meaning to it that I didn't see? review by odersky
* closes #3890: propagate inferred type parameter...Adriaan Moors2010-10-121-0/+4
| | | | | | closes #3890: propagate inferred type parameters to info of undetermined type parameters. review by imaier.
* An overhaul of the collection-oriented methods ...Paul Phillips2010-10-111-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An overhaul of the collection-oriented methods in Tuple2/Tuple3 (which still need to be taken all the way to Tuple5.) * Zip semantics: zip and zipped now properly terminate when any collection runs out of elements, even if others are infinite. In addition, short circuiting methods (exists and forall) will terminate if the condition is met, even in the presence of infinity. Example: scala> val ys = Stream from 1 ys: scala.collection.immutable.Stream[Int] = Stream(1, ?) scala> (ys, ys).zipped forall ((x, y) => x+y < 100) res0: Boolean = false scala> (ys, ys).zipped exists ((x, y) => x+y > 100) res1: Boolean = true * There are implicits converting Zipped2/3 to Traversable to expose all the methods which aren't defined in an arity-specific way in the tuple classes. I have mixed feelings about putting these in Predef; but if there is another way to make them visible by default I wasn't able to find it. Example putting said implicit to use: scala> (ys, ys, ys).zipped find { case (x, y, z) => x+y+z > 1000 } res0: Option[(Int, Int, Int)] = Some((334,334,334)) Already reviewed by moors, so no review.
* temporary fix for compiler crash in dependend m...Lukas Rytz2010-10-112-0/+8
| | | | | | temporary fix for compiler crash in dependend method types with annotations. review by moors.
* One last batch of test cleanups and I think I'l...Paul Phillips2010-10-031-0/+8
| | | | | | | One last batch of test cleanups and I think I'll call it a day. If you're worried I didn't leave any for anyone else, let me put your fears to rest. PLENTY left to sift through. No review.
* Sorting through the tests in pending from oldes...Paul Phillips2010-10-024-0/+76
| | | | | | | | | | | | | | | | | Sorting through the tests in pending from oldest to newest because I don't believe in having useless appendages. The verdict on the oldest fifteen tests is: 15/15 are fixed. Many were already in files under a different name. I moved a few and deleted the rest. Fun fact of the day: apparently there was a time when to call into java varargs with no arguments you might have to write something like: getClass().getMethod("getCount", Array[java.lang.Class[T] forSome { type T }]()) On this basis I retract any complaints I've ever had about anything. There is one question mark outlined in pos/testCoercionThis.scala, a file formerly called pos/moors.scala and therefore... review by moors.
* Another attempt for #1591.Hubert Plociniczak2010-10-012-0/+20
|
* Revert changes related to #1591. no review.Hubert Plociniczak2010-09-291-7/+0
|
* closes #3859.Adriaan Moors2010-09-281-0/+4
| | | | | review by odersky
* Cleaning up the contents of test.Paul Phillips2010-09-2825-9/+49
| | | | | | | | | | | including "CheckEither", written against scalacheck 1.2 in the year 471 AD. Removed all the duplicates I could find, mostly between pending and files. Renamed a bunch of tests so they wouldn't look like likely duplicates next time around. Nominated somebody else to do this once in a while. No review.
* close #3864.Lukas Rytz2010-09-272-0/+79
|
* closes #3808.Adriaan Moors2010-09-241-0/+11
| | | | | | | | moved typing indentation to where it belongs, now inliner shuold be able to do its job in implicits as well no review
* closes #3800.Adriaan Moors2010-09-231-0/+6
| | | | | | | | appliedType goes under annotations. removed some dead code in isSubtypeHK0. review by rytz
* Test case closes #3498, no review.Paul Phillips2010-09-221-0/+15
|
* Test case closes #2619, no review.Paul Phillips2010-09-221-0/+80
|
* closes #3792: type equality for singleton types...Adriaan Moors2010-09-221-0/+4
| | | | | | | | | closes #3792: type equality for singleton types did not take type aliases into account while chasing the chain of underlying types (if the underlying type is an alias of a singleton type, it should be followed) review by odersky
* Closes #1591.Hubert Plociniczak2010-09-221-0/+7
|