summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | Merge pull request #822 from scalamacros/ticket/5959Adriaan Moors2012-07-062-0/+75
|\ \ \ \ | |_|/ / |/| | | SI-5959 type equality now accounts for mirrors
| * | | SI-5959 type equality now accounts for mirrorsEugene Burmako2012-07-042-0/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TypeRef(ThisType(<package1>), sym, args) should always be equal to TypeRef(ThisType(<package2>), sym, args) regardless of whether package1 and package2 actually represent the same symbols of not. This goes for subtyping (<:<) and type equality (=:=). However regular equality (==) and hashconsing is unaffected as per http://groups.google.com/group/scala-internals/browse_thread/thread/4bef4e6987bb68fe This is done to account for the fact that mirrors share normal symbols, but never share package symbols. Therefore at times it will occur that the same types loaded by different mirrors appear different because of the package symbols. More details: https://issues.scala-lang.org/browse/SI-5959.
* | | | Merge pull request #821 from adriaanm/64acb46ab7Adriaan Moors2012-07-054-29/+92
|\ \ \ \ | | | | | | | | | | SI-5830 switches: support guards, unreachability
| * | | | SI-5830 switches: support guards, unreachabilityAdriaan Moors2012-07-034-29/+92
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | turn switches with guards into guard-free switches by collecting all cases that are (possibly) guarded by different guards but that switch on the same constant, and pushing the implied if-then-else into the collapsed case body ``` case C if G1 => B1 case C if Gi => Bi case C if GN => BN ``` becomes ``` case C => if (G1) B1 else if (Gi) Bi else if (GN) BN else default() // not necessary if GN == EmptyTree ``` default() is a jump to the default case; to enable this, we wrap a default() { } labeldef around the last case's body (the user-defined default or the synthetic case that throws the matcherror) so we can jump to the default case after the last guard is checked (assuming unreachability is checked, once we ended up in a non-default case, one of the guards either matches or we go to the default case) the unreachability analysis is minimal -- we simply check (after rewriting to guard-free form) that: - there are no duplicate cases - the default case comes last misc notes: - can't jump in exception handlers (TODO: a more fine-grained analysis on when we need to jump) - work around SI-6015 (test file run/t5830.scala crashed the inliner) - propagate type of case body to label def of default case (needed for existentials, see e.g., t2683) - the default(){} LabelDef breaks SelectiveANFTransform -- workaround: don't write guarded switches in CPS code (do the above transformation manually)
* | | | Merge pull request #818 from scalamacros/topic/tags-for-anyval-and-anyrefAdriaan Moors2012-07-046-52/+76
|\ \ \ \ | | | | | | | | | | tags for AnyVal and AnyRef
| * | | | tags for AnyVal and AnyRefEugene Burmako2012-07-046-52/+76
| | |/ / | |/| |
* | | | Merge pull request #809 from dragos/issue/fix-5929Adriaan Moors2012-07-041-0/+25
|\ \ \ \ | | | | | | | | | | Fix SI-5929 - Verify error with finally and pattern match
| * | | | Fix SI-5929 - Verify error with finally and pattern matchIulian Dragos2012-07-021-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | Don't enter all labels in a method when emitting a forward jump, since some labels will be duplicated (if defined inside finally blocks). For each forward jump, enter only the label that is needed for that jump.
* | | | | Merge pull request #772 from magarciaEPFL/recoveringOptimizedStabilityCAdriaan Moors2012-07-041-73/+65
|\ \ \ \ \ | |_|/ / / |/| | | | recovering optimized stability
| * | | | inliner makes fields public only when actually inliningMiguel Garcia2012-06-251-73/+65
| | | | |
* | | | | SI-5990 u.build now correctly invokes missing symbol hooksEugene Burmako2012-07-032-0/+30
| |_|/ / |/| | |
* | | | reify no longer dealiases symbols and typesEugene Burmako2012-07-0231-163/+45
| | | | | | | | | | | | | | | | | | | | this uncovers a bug in toolboxes: https://issues.scala-lang.org/browse/SI-6007 however that bug is not critical, so it will be dealt with later
* | | | removes ClassTag.String and TypeTag.StringEugene Burmako2012-07-028-38/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TypeTag.String is removed because it's unclear whether it should point to scala.Predef.String or to java.lang.String. ClassTag.String is removed to be consistent with TypeTag.String. This requires re-bootstrapping, because Definitions.scala in locker expects classTag[String] being automatically generated, whereas starr disagrees with locker on how to generate that class tag.
* | | | further improves reflection printersEugene Burmako2012-07-0211-43/+46
| | | |
* | | | Improves backward compatibility of manifestsEugene Burmako2012-07-029-36/+16
| |_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) type ClassManifest[T] = ClassTag[T] (solves a problem with toArray[T: ClassManifest] defined on most of the collections; if these types weren't aliases, then we won't be able to change the signature of that method to toArray[T: ClassTag], because that would break source compatibility for those who override toArray in their custom collections) 2) Compiler-generated manifests no longer trigger deprecation warnings (this is implemented by using ClassManifestFactory instead of ClassManifest and ManifestFactory instead of Manifest) 3) Deprecation messages got improved to reflect the changes that were introduced in 2.10.0-M4.
* | | Merge pull request #792 from jsuereth/fixup/from-reprJosh Suereth2012-06-292-22/+63
|\ \ \ | | | | | | | | Split @milessabin HasRepr into IsTraversableOnce and IsTraversableLike t...
| * | | Split @milessabin HasRepr into IsTraversableOnce and IsTraversableLike type ↵Josh Suereth2012-06-272-22/+63
| | | | | | | | | | | | | | | | class-ish things.
* | | | Merge pull request #793 from jsuereth/fix/convert-toJosh Suereth2012-06-291-8/+8
|\ \ \ \ | |_|_|/ |/| | | Renaming convertTo to to on GenTraversableOnce.
| * | | Renaming convertTo to to on GenTraversableOnce.Josh Suereth2012-06-281-8/+8
| | | |
* | | | Merge branch 'master' into issue/5846,4597,4027,4112Aleksandar Prokopec2012-06-2840-1/+669
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/library/scala/collection/MapLike.scala src/library/scala/collection/SortedMapLike.scala
| * \ \ \ Merge pull request #790 from axel22/issue/3326Josh Suereth2012-06-282-0/+82
| |\ \ \ \ | | |/ / / | |/| | | Fix SI-3326.
| | * | | Fix SI-3326.Aleksandar Prokopec2012-06-272-0/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The heart of the problem - we want to retain the ordering when using `++` on sorted maps. There are 2 `++` overloads - a generic one in traversables and a map-specific one in `MapLike` - which knows about the ordering. The problem here is that the expected return type for the expression in which `++` appears drives the decision of the overload that needs to be taken. The `collection.SortedMap` does not have `++` overridden to return `SortedMap`, but `immutable.Map` instead. This is why `collection.SortedMap` used to resort to the generic `TraversableLike.++` which knows nothing about the ordering. To avoid `collection.SortedMap`s resort to the more generic `TraverableLike.++`, we override the `MapLike.++` overload in `collection.SortedMap` to return the proper type `SortedMap`.
| * | | | Merge pull request #786 from axel22/issue/5986-cherryJosh Suereth2012-06-272-0/+51
| |\ \ \ \ | | | | | | | | | | | | Fix SI-5986.
| | * | | | Fix SI-5986.Aleksandar Prokopec2012-06-272-0/+51
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here we had an issue that RedBlack does not work the same way for sets - which are not supposed to replace an element if it is the same (wrt equals) and maps - which should replace the corresponding values. Adding an overwrite parameter which decides whether to overwrite added keys if they are the same in the ordering. Fix tests.
| * | | | Merge pull request #785 from axel22/feature/to-parJosh Suereth2012-06-272-1/+27
| |\ \ \ \ | | |_|/ / | |/| | | Parallelize convertTo in parallel collection.
| | * | | Parallelize convertTo in parallel collection.Aleksandar Prokopec2012-06-272-1/+27
| | | | |
| * | | | Merge pull request #787 from axel22/issue/5971Josh Suereth2012-06-272-0/+27
| |\ \ \ \ | | | | | | | | | | | | Fix SI-5971.
| | * | | | Fix SI-5971.Aleksandar Prokopec2012-06-272-0/+27
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When using `AbstractTransformed` abstract inner class in views in order to force generating bridges, one must take care to push the corresponding collection trait (such as `Iterable` or `Seq`) as far as possible to the left in the linearization order -- otherwise, overridden methods from these traits can override the already overridden methods in view. This was the case with `takeWhile`.
| * | | | Merge pull request #754 from scalamacros/topic/removereflectcompatAdriaan Moors2012-06-271-1/+0
| |\ \ \ \ | | | | | | | | | | | | removes pre-M4 compatibility stubs for the IDE
| | * | | | removes pre-M4 compatibility stubs for the IDEEugene Burmako2012-06-211-1/+0
| | | | | |
| * | | | | make tests independent of compiler apiAdriaan Moors2012-06-271-6/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TODO: t5899 should also be refactored, but I couldn't figure out how I tried the obvious Cake Light pattern with abstract types etc, but that didn't trigger it there must be something with indirection through paths as well
| * | | | | SI-5914 handle null in classtag extractorAdriaan Moors2012-06-262-0/+10
| | |/ / / | |/| | |
| * | | | fix for SI-4935Miguel Garcia2012-06-263-0/+11
| | | | |
| * | | | Merge pull request #760 from retronym/ticket/5966-3Adriaan Moors2012-06-252-0/+12
| |\ \ \ \ | | |_|_|/ | |/| | | SI-5966 Fix eta expansion for repeated parameters with zero arguments.
| | * | | SI-5966 Fix eta expansion for repeated parameters with zero arguments.Jason Zaugg2012-06-232-0/+12
| | |/ / | | | | | | | | | | | | | | | | Reworks part of e33901 / SI-5610, which was inserting an <empty> tree as an argument in this case, which turns into a null in icode.
| * | | Merge pull request #756 from axel22/issue/4809Josh Suereth2012-06-221-0/+34
| |\ \ \ | | | | | | | | | | Fix SI-4809.
| | * | | Fix SI-4809.Aleksandar Prokopec2012-06-211-0/+34
| | | |/ | | |/|
| * | | Fix SI-5284.Aleksandar Prokopec2012-06-216-0/+86
| | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The problem was the false assumption that methods specialized on their type parameter, such as this one: class Foo[@spec(Int) T](val x: T) { def bar[@spec(Int) S >: T](f: S => S) = f(x) } have their normalized versions (`bar$mIc$sp`) never called from the base specialization class `Foo`. This meant that the implementation of `bar$mIc$sp` in `Foo` simply threw an exception. This assumption is not true, however. See this: object Baz { def apply[T]() = new Foo[T] } Calling `Baz.apply[Int]()` will create an instance of the base specialization class `Foo` at `Int`. Calling `bar` on this instance will be rewritten by specialization to calling `bar$mIc$sp`, hence the error. So, we have to emit a valid implementation for `bar`, obviously. Problem is, such an implementation would have conflicting type bounds in the base specialization class `Foo`, since we don't know if `T` is a subtype of `S = Int`. In other words, we cannot emit: def bar$mIc$sp(f: Int => Int) = f(x) // x: T without typechecking errors. However, notice that the bounds are valid if and only if `T = Int`. In the same time, invocations of `bar$mIc$sp` will only be emitted in callsites where the type bounds hold. This means we can cast the expressions in method applications to the required specialized type bound. The following changes have been made: 1) The decision of whether or not to create a normalized version of the specialized method is not done on the `conflicting` relation anymore. Instead, it's done based on the `satisfiable` relation, which is true if there is possibly an instantiation of the type parameters where the bounds hold. 2) The `satisfiable` method has a new variant called `satisfiableConstraints`, which does unification to figure out how the type parameters should be instantiated in order to satisfy the bounds. 3) The `Duplicators` are changed to transform a tree using the `castType` method which just returns the tree by default. In specialization, the `castType` in `Duplicators` is overridden, and uses a map from type parameters to types. This map is obtained by `satisfiableConstraints` from 2). If the type of the expression is not equal to the expected type, and this map contains a mapping to the expected type, then the tree is cast, as discussed above. Additional tests added. Review by @dragos Review by @VladUreche Conflicts: src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
| * | 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 #739 from jsuereth/feature/collection-conversionsJosh Suereth2012-06-182-0/+164
| |\ \ \ | | | | | | | | | | Adding copyInto and toVector methods to collections.
| | * | | Migrate build to @odersky's suggestion of convertTo.Josh Suereth2012-06-181-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * 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.
| * / | 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.
* / / Fix SI-5846 and SI-4027.Aleksandar Prokopec2012-06-282-0/+39
|/ /
* / fixes SI-5912Eugene Burmako2012-06-151-0/+6
|/
* SI-5162 Exclude super.foo from the erasure cast of SI-4283Jason Zaugg2012-06-115-0/+51
| | | | | | | | | 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.
* test case, closes SI-5840Eugene Burmako2012-06-091-0/+7
|