summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* Fix for SI-5953, extension methods crasher.Paul Phillips2012-06-191-0/+16
| | | | | | | | | | | | | As usual, .tpe -> .tpeHK. As a side note following an old theme, if symbols of type parameters knew that they were symbols of type parameters, they could call tpeHK themselves rather than every call site having to do it. It's the operation which injects dummies which should require explicit programmer action, not the operation which faithfully reproduces the unapplied type. Were it that way, errors could be caught much more quickly via ill-kindedness. Seems like an improvement over lurking compiler crashes at every call to tparam.tpe.
* Merge pull request #743 from axel22/issue/4541Adriaan Moors2012-06-194-0/+46
|\ | | | | Fix SI-4541.
| * Fix SI-4541.Aleksandar Prokopec2012-06-184-0/+46
| | | | | | | | | | | | | | | | | | | | | | Catch type errors when duplicating trees. In this case, to access a protected member from a specialized class is an error, so we would have to make the member public anyway. Better it is then to report an error and have the user make the field public explicitly. Review by @dragos.
* | Merge pull request #723 from paulp/topic/5910Adriaan Moors2012-06-191-0/+2
|\ \ | | | | | | Fix for java parser edge case.
| * | Fix for java parser edge case.Paul Phillips2012-06-141-0/+2
| | | | | | | | | | | | Empty statements are A-OK. Closes SI-5910. Review by @dragos.
* | | Merge pull request #737 from scalamacros/topic/reifyanonymousAdriaan Moors2012-06-194-26/+0
|\ \ \ | | | | | | | | enables reification of anonymous classes
| * | | enables reification of anonymous classesEugene Burmako2012-06-184-26/+0
| | |/ | |/|
* | | Merge pull request #729 from scalamacros/topic/showrawAdriaan Moors2012-06-1916-0/+107
|\ \ \ | | | | | | | | improve showRaw
| * | | improves showRawEugene Burmako2012-06-1916-0/+107
| | |/ | |/| | | | | | | addresses concerns raised in http://groups.google.com/group/scala-user/browse_thread/thread/de5a5be2e083cf8e
* | | Merge pull request #697 from retronym/ticket/4270-3Adriaan Moors2012-06-194-0/+45
|\ \ \ | | | | | | | | SI-4270 Disqualify in scope implicits that are shadowed.
| * | | SI-4270 Disqualify in scope implicits that are shadowed.Jason Zaugg2012-06-104-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If an expression wouldn't type check explicitly, it shouldn't be allowed implicitly. Employs typedIdent, which already does this sort of thing rather well, instead of continuing to reimplement it in Implicits. Remove check for non-implicit synonym, which is subsumed by typing an Ident. Workaround Scaladoc oddity, by using an attributed select when the context is deficient.
* | | | Merge pull request #739 from jsuereth/feature/collection-conversionsJosh Suereth2012-06-183-1/+167
|\ \ \ \ | | | | | | | | | | Adding copyInto and toVector methods to collections.
| * | | | Migrate build to @odersky's suggestion of convertTo.Josh Suereth2012-06-182-8/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Move method into TraversableOnce from Iterator and Traversable to make the build pass. * Udpate IDE tests with new collection methods. * Rewire default toXYZ methods to use convertTo.
| * | | | Rename copyTo to build based on consensus of 3Josh Suereth2012-06-181-7/+7
| | | | |
| * | | | Fixes from review.Josh Suereth2012-06-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Fixed typo * Renamed copyInto to copyTo * Added tparam doc.
| * | | | Adding copyInto and toVector methods to collections.Josh Suereth2012-06-182-0/+164
| | |_|/ | |/| | | | | | | | | | | | | | * Added generic copyInto method for collections. For any collection with a CanBuildFrom, can convert a generic collection into it using the builder. * Added specifici toVector method for collections. This is more efficient than copyInto if the collection is a Vector.
* | | | Merge pull request #741 from axel22/issue/4954Josh Suereth2012-06-181-0/+45
|\ \ \ \ | | | | | | | | | | Fix SI-4954.
| * | | | Fix SI-4954.Aleksandar Prokopec2012-06-181-0/+45
| |/ / / | | | | | | | | | | | | | | | | | | | | Override inner classes in `LinkedHashMap` that correspond to `filterKeys`, `mapValues` and `keys` to retain a proper ordering of elements when they are transformed.
* | | | Merge pull request #720 from phaller/cps-ticket-1681Josh Suereth2012-06-188-0/+134
|\ \ \ \ | |/ / / |/| | | CPS: enable return expressions in CPS code if they are in tail position
| * | | Replace context stack of AnnotationChecker with new mode for typing returnsphaller2012-06-152-0/+31
| | | |
| * | | CPS: enable return expressions in CPS code if they are in tail positionphaller2012-06-146-0/+103
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Adds a stack of context trees to AnnotationChecker(s). Here, it is used to enforce that adaptAnnotations will only adapt the annotation of a return expression if the expected type is a CPS type. The remove-tail-return transform is reasonably general, covering cases such as try-catch-finally. Moreover, an error is thrown if, in a CPS method, a return is encountered which is not in a tail position such that it will be removed subsequently.
* / | fixes SI-5912Eugene Burmako2012-06-151-0/+6
|/ /
* | Suppress non-local return unchecked warnings.Paul Phillips2012-06-122-0/+7
| | | | | | | | | | There doesn't seem to be any way to do that by adding a synthetic annotation.
* | Merge pull request #698 from retronym/ticket/5696Adriaan Moors2012-06-112-0/+66
|\ \ | | | | | | SI-5696 Detect excess constructor argument lists.
| * | SI-5696 Detect excess constructor argument lists.Jason Zaugg2012-06-102-0/+66
| | | | | | | | | | | | An apply method fooled the usual mechanism.
* | | SI-5162 Exclude super.foo from the erasure cast of SI-4283Jason Zaugg2012-06-119-0/+68
|/ / | | | | | | | | | | | | | | | | If the target method is defined in Java, treat the super reference as an error, otherwise allow it in the knowledge that Scala loosens the access restrictions on its generated classes. Moves the test for that bug out of pending-ville. It's sufficient to place Test in the empty package to exercise the right code paths.
* | Merge pull request #694 from retronym/ticket/4831-2Adriaan Moors2012-06-093-0/+29
|\ \ | | | | | | SI-4831 Fix ambiguous import detection for renamed imports.
| * | SI-4831 Fix ambiguous import detection for renamed imports.Jason Zaugg2012-06-093-0/+29
| |/
* | Merge pull request #695 from adriaanm/topic-virtpatmatAdriaan Moors2012-06-093-0/+17
|\ \ | | | | | | better unreachability for selections
| * | better unreachability for selectionsAdriaan Moors2012-06-093-0/+17
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Consts are hashconsed modulo static-approximation-for-dynamic-value-equality thus, two value-equality tests in patterns should reuse the same ValueConst if and only if the tested values are guaranteed to be equal in all possible executions the implementation uses unique types to track unique consts for an Ident with a stable symbol, we simply use the corresponding singleton type for a Select, we have to indirect some more: we store all the unique trees we've encountered and a unique type for each of them this unique type is then used to find the uniqut const that approximates the run-time value this may seem roundabout, but we need to standardize on types for representing "value" tests, as a type test against a singleton type must give rise to the same ValueConst as a value test using a tree that refers to the same symbol as the singleton type test
* | test case, closes SI-5840Eugene Burmako2012-06-091-0/+7
| |
* | test case, closes SI-5881Eugene Burmako2012-06-092-0/+8
| |
* | test case, closes SI-5816Eugene Burmako2012-06-092-0/+18
| |
* | test case, closes SI-5738Eugene Burmako2012-06-091-0/+8
| |
* | test case, closes SI-5742Eugene Burmako2012-06-091-0/+8
|/
* Merge pull request #660 from retronym/ticket/5167-3Josh Suereth2012-06-084-0/+25
|\ | | | | SI-5167 An impl class method should refer to its own parameter symbols.
| * SI-5167 An impl class method should refer to its own parameter symbols.Jason Zaugg2012-06-034-0/+25
| | | | | | | | | | | | | | | | Rather than those of the original method in the trait. If they are shared, parameter renaming in the implementaion class is visible in the original method. This led to a crash in the resident compiler when looking up the default argument getter.
* | Merge pull request #631 from retronym/ticket/5652-3Adriaan Moors2012-06-088-0/+55
|\ \ | | | | | | SI-5652 Mangle names of potentially public lambda lifted methods.
| * | SI-5652 Mangle names of potentially public lambda lifted methods.Jason Zaugg2012-05-268-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This can happen if they are accessed from an inner class. If a subclass is happens to lift a public method to the same name, a VerifyError ensues. The enclosed tests: - demonstrate the absense of the VerifyError - show the names generated for the lifted methods (which are unchanged if not called from an inner class, or if lifted into a trait implementation class.) - ensure that the callers are rewritten to call the correct method when multiple with the same name are lifted. It's not ideal that this phase needs a priori knowledge of the later phases to perform this mangling. A better fix would defer this until the point when the methods are publicised, and leave the unmangled private method in place and install an public, mangled forwarder.
* | | Merge pull request #679 from axel22/issue/5853Adriaan Moors2012-06-081-0/+55
|\ \ \ | | | | | | | | Fix SI-5853.
| * | | Fix SI-5853.Aleksandar Prokopec2012-06-071-0/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This solves two issues. First, up to now the newly generated symbols for normalized members were not being added to the declaration list of the owner during `specialize`. Now they are. Second, during `extmethods`, the extension methods generated get an additional curried parameter list for `$this`. Trouble was, after that, during `uncurry` and before `specialize`, these curried parameter lists were merged into one list. Specialization afterwards treats extension methods just like normal methods and generates new symbols without the curried parameter list. The `extensionMethod` now takes this into account by checking if the first parameter of a potential extension method has the name `$this`. Review by @dragos. Review by @odersky.
* | | | Reduce time spent in lubsMartin Odersky2012-06-081-0/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduce time spent in lubs by making depth more adaptive. It now takes into account separately the depth of the lub types and the maximal depth of theior base type sequences. It cuts depth more aggressively if it is the base types instead of the types themselves that grow deep. The old truncation behavior is retained under option -Xfull-lubs Another change is that we now track depth more precisely, which should also help or at least allow better statistics. Also added statistics that measure #lubs and time spent in them.
* | | | tests and fixes for the mirror APIEugene Burmako2012-06-0845-33/+372
| | | |
* | | | don't warn about abstract types that are checkableAdriaan Moors2012-06-081-0/+1
| | | |
* | | | turn unchecked type patterns into checked onesAdriaan Moors2012-06-083-14/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the pattern `(_: T)` is made checkable using (ct: ClassTag[T]).unapply by rewriting it to `ct(_: T)` (if there's a ClassTag[T] available) similarly for extractors: if the formal type of the unapply method is an uncheckable type, wrap in the corresponding classtag extractor (if available) don't trigger rewrite on non-toplevel unchecked types (i.e., only look at type constructor part of T when looking for unchecked types) TODO: find outer match to figure out if we're supposed to be unchecked would like to give users a chance to opt-out from the wrapping, but finding the match to which this pattern belongs turned out to be tricky...
* | | | fixes some issues with reflectField brought up todayEugene Burmako2012-06-0812-0/+135
| | | |
* | | | TypeTag => AbsTypeTag, ConcreteTypeTag => TypeTagEugene Burmako2012-06-0883-364/+336
| | | | | | | | | | | | | | | | | | | | This protects everyone from the confusion caused by stuff like this: https://issues.scala-lang.org/browse/SI-5884
* | | | removes array tagsEugene Burmako2012-06-0836-262/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Before 2.10 we had a notion of ClassManifest that could be used to retain erasures of abstract types (type parameters, abstract type members) for being used at runtime. With the advent of ClassManifest (and its subtype Manifest) it became possible to write: def mkGenericArray[T: Manifest] = Array[T]() When compiling array instantiation, scalac would use a ClassManifest implicit parameter from scope (in this case, provided by a context bound) to remember Ts that have been passed to invoke mkGenericArray and use that information to instantiate arrays at runtime (via Java reflection). When redesigning manifests into what is now known as type tags, we decided to explore a notion of ArrayTags that would stand for abstract and pure array creators. Sure, ClassManifests were perfectly fine for this job, but they did too much - technically speaking, one doesn't necessarily need a java.lang.Class to create an array. Depending on a platform, e.g. within JavaScript runtime, one would want to use a different mechanism. As tempting as this idea was, it has also proven to be problematic. First, it created an extra abstraction inside the compiler. Along with class tags and type tags, we had a third flavor of tags - array tags. This has threaded the additional complexity though implicits and typers. Second, consequently, when redesigning tags multiple times over the course of Scala 2.10.0 development, we had to carry this extra abstraction with us, which exacerbated the overall feeling towards array tags. Finally, array tags didn't fit into the naming scheme we had for tags. Both class tags and type tags sound logical, because, they are descriptors for the things they are supposed to tag, according to their names. However array tags are the odd ones, because they don't actually tag any arrays. As funny as it might sound, the naming problem was the last straw that made us do away with the array tags. Hence this commit.
* | | | Introduces scala-reflect.jarEugene Burmako2012-06-081-2/+2
| | | |
* | | | repairs the tests after the refactoring spreeEugene Burmako2012-06-08503-1563/+2455
| | | |