summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* Regex.unapplySeq should not take Any (Fixes SI-6406)Som Snytt2012-09-202-0/+34
| | | | | | | | | | | | | | | | | | This deprecates unapplySeq(Any) and adds overloaded unapplySeq(CharSequence) and unapplySeq(Match), with the putative advantage that you can't try to extract the unextractable. Regex is massaged so that the underlying Pattern is primary, rather than the String-valued expression. Regex and its unanchored companion (I almost wrote unmoored) share a Pattern object, so that unapplySeq(Match) can easily test whether the Match was generated by this Regex; in that case, the match result is used immediately, instead of reapplying the regex to the matched string. The documentation is massaged to reflect unanchored and also to align with the underlying terminology, e.g., "subgroup" really just means "group."
* Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2012-09-1579-237/+916
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: (68 commits) Eliminate breaking relative names in source. "Hot fix" for broken build. Fix SI-4813 - Clone doesn't work on LinkedList. Made 'def clone()' consistent with parens everywhere. accommodates pull request feedback SI-6310 redeploys the starr SI-6310 AbsTypeTag => WeakTypeTag SI-6323 outlaws free types from TypeTag SI-6323 prohibits reflection against free types improvements for reification of free symbols removes build.newFreeExistential SI-6359 Deep prohibition of templates in value class Fixes SI-6259. Unable to use typeOf in super call of top-level object. Fixes binary repo push for new typesafe repo layouts. Better error message for pattern arity errors. Rescued TreeBuilder from the parser. Pending test for SI-3943 Test case for a bug fixed in M7. Fix for SI-6367, exponential time in inference. SI-6306 Remove incorrect eta-expansion optimization in Uncurry ... Conflicts: src/compiler/scala/tools/nsc/transform/AddInterfaces.scala src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
| * Merge pull request #1271 from retronym/ticket/6331Josh Suereth2012-09-144-0/+144
| |\ | | | | | | SI-6331 deconst If type / refine equality of floating point Constant types.
| | * Test for consistency of Constant#{equals, hashCode}.Jason Zaugg2012-09-091-1/+9
| | | | | | | | | | | | | | | | | | For the examples I've constructed, they are consistent, but I put this down to good luck, rather than good management. The next commit will address this.
| | * Refine equality of Constant types over floating point values.Jason Zaugg2012-09-082-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The constant types for 0d and -0d should not be equal. This is implemented by checking equality of the result of doubleToRawLongBits / floatToRawIntBits, which also correctly considers two NaNs of the same flavour to be equal. Followup to SI-6331.
| | * SI-6331 Avoid typing an If tree with a constant type.Jason Zaugg2012-09-082-0/+50
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fast path in typedIf added in 8552740b avoided lubbing the if/else branch types if they are identical, but this fails to deconst the type. This could lead to the entire if expression being replaced by a constant. Also introduces a new tool in partest for nicer checkfiles. // in Test.scala trace(if (t) -0d else 0d) // in Test.check trace> if (Test.this.t) -0.0 else 0.0 res: Double = -0.0
| * | Merge pull request #1281 from jsuereth/fix/SI-4813Josh Suereth2012-09-141-0/+37
| |\ \ | | | | | | | | Fix SI-4813 - Clone doesn't work on LinkedList.
| | * | Fix SI-4813 - Clone doesn't work on LinkedList.Josh Suereth2012-09-141-0/+37
| | | | | | | | | | | | | | | | | | | | * Added extensive test for clone across all standard mutable collections * Fixed clone implementations when needed so they work.
| * | | SI-6310 AbsTypeTag => WeakTypeTagEugene Burmako2012-09-1443-110/+110
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new name for AbsTypeTag was a matter of a lengthy discussion: http://groups.google.com/group/scala-internals/browse_thread/thread/fb2007e61b505c4d I couldn't decide until having fixed SI-6323 today, which is about trying to reflect against a local class using typeOf. The problem with local classes is that they aren't pickled, so their metadata isn't preserved between Scala compilation runs. Sure, we can restore some of that metadata with Java reflection, but you get the idea. Before today typeOf of a local class created a free type, a synthetic symbol, with a bunch of synthetic children that remember the metadata, effectively creating a mini symbol table. That might be useful at time, but the problem is that this free type cannot be reflected, because the global symbol table of Scala reflection doesn't know about its mini symbol table. And then it struck me. It's not the presence of abs types (type parameters and abs type members) that differentiates arbitrary type tags from good type tags. It's the presence of types that don't map well on the runtime world - ones that can't be used to instantiate values, ones that can't be reflected. So we just need a name for these types. Phantom types are compile-time only concept, whereas our types can have partial correspondence with the runtime. "Weak types" sound more or less okish, so let's try them out.
| * | | SI-6323 outlaws free types from TypeTagEugene Burmako2012-09-142-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Free types are no longer acceptable in normal type tags. Like type parameters or abstract type members they don't map on any real type, therefore I think this is a justified change. The main reason for doing is this is to prohibit people from using `typeOf` on local classes. Sure, the guard introduced in the previous commit will raise runtime errors about that, but this commit provides static checking. Those especially persistent might use `absTypeOf` and then try to play around with the weak type it returns, but that's advanced usage scenario, and I don't worry much about it. Bottom line: `typeOf` should just work. Things that work with additional effort should be explicitly marked as such.
| * | | SI-6323 prohibits reflection against free typesEugene Burmako2012-09-142-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the use cases for free types is reification of local classes. The result is very seamless. Despite that local classes are not pickled, free types recreated the symbols referenced by local classes, so that we get our own symbol table, which can be analyzed with usual precision of pickled symbols and types. However when we try to use those symbols for reflection, we hit a problem. Scala runtime reflection uses its own mechanism for dealing with non-pickled types, which is incompatible with mini symbol tables used in free types. Therefore to prevent confusion, I prohibit using those symbols for reflection.
| * | | improvements for reification of free symbolsEugene Burmako2012-09-147-21/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Free symbols no longer carry signatures in their constructors. Previously to reify a free symbol (i.e. to generate a ValDef that creates it) one had to reify sym.info first. However reification of sym.info might lead to unexpected side effects, including stack overflows, if reification of sym.info recursively required reifying sym itself. Now it's not a problem. First we reify a "header" of a free symbol by emitting something like: val free$Foo1 = build.newFreeTerm("Foo", Foo.this, NoFlags)` Afterwards, when doing code generation for the reification symbol table, we populate free symbols by inserting calls to `build.setTypeSignature($sym.info)` This techniques transforms recursion into memoized iteration, because even if reifying sym.info indirectly requires reification of sym itself, we remember that we already reified sym and simply return things like Ident(free$Foo1). 2) Unfortunately I haven't been able to get rid of recursion completely. Since some symbols (e.g. local classes) aren't pickled, we need to recreate them during reification (this is necessary e.g. to reify RefinedTypes). Reifier uses a special function, named `reifySymDef`, for that purpose. Here's an example of how it works: val symdef$_1 = build.newNestedSymbol(free$U1, newTypeName("_"), NoPosition, DEFERRED | PARAM, false); `reifySymDef` expands into a call to `newNestedSymbol`, which requires an owner This essentially turns `reifySymDef` into a recursion of `reifySymDef` calls, so that the entire owner chain get reified. This is an implementation strategy that was employed in the first revision of the reifier written by Martin, and personally I have no clue whether it's really necessary to reify the parents. I leave this as a future work. 3) When working with free symbols, it's necessary to attach free symbols to their reification. This is required in obscure nested reification scenarios, when a symbol that was free for an inner reifee is no longer free for an outer reifee. In that case we need to remove that free symbol from the symbol table of the inner reification. Back then we didn't have tree attachments, so I had to introduce a phantom "value" parameter for `newFreeType` to keep track of the original symbols for free types. Now when we have attachments, this is no longer necessary and allowed me to clean up the code.
| * | | Fixes SI-6259. Unable to use typeOf in super call of top-level object.Josh Suereth2012-09-134-65/+91
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | This works around the issue of the inability to use classOf for top-level object classes by inventing a new anonymous class and instantiating it just to grab its class. Since the class is a nested type of the top-level object it'll be in the same classloader unless some kind of evil behavior is afoot. This patch should be undone if ever SI-2453 ever gets fixed, or we wind up with a direct way to grab the class of an object.
| * | Merge pull request #1255 from Blaisorblade/issue/6306Josh Suereth2012-09-122-0/+45
| |\ \ | | | | | | | | Fix SI-6306 on testcase
| | * | SI-6306 Remove incorrect eta-expansion optimization in UncurryPaolo Giarrusso2012-09-122-0/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix SI-6306 by removing the offending code. Moreover, clarify comment and add testcase. This pattern match only matches on testcases triggering SI-6306; the transformation it performs in that case is unsafe. The intended optimization is to undo eta-expansion of nullary functions, that is, transform `() => foo()` to `foo`. But that's only valid when `foo` is an instance of `Function0`, so the optimization is unsafe. Moreover, the pattern match will fail because at the end of typer that code has become `() => foo.apply()`, and `isExprSafeToInline(foo.apply)` always (correctly) fails the isExprSafeToInline test. The pattern match should thus be different - this code was dead even when it was introduced (45bcd02f6ba099277bedbf83ec2bda07435c7797), since it was not invoked either when building the compiler or when compiling function attempt2() in the included testcase. Thanks to all commenters on SI-6306 and https://github.com/scala/scala/pull/1255, in particular to Jason Zaugg for diagnosing the underlying fault and Lukas Rytz for understanding the goal of the code.
| * | | Merge pull request #1247 from jsuereth/fix/SI-6114Josh Suereth2012-09-121-0/+61
| |\ \ \ | | | | | | | | | | Fix t6114 - ++ on JList wrapper modifies underlying collection.
| | * | | Fix t6114 - ++ on JList wrapper modifies underlying collection.Josh Suereth2012-09-111-0/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We solve this by overriding clone for JListWrapper to actually do a full clone. Note: This fix may need to be included other places, *but* we're not sure we've cloned the collection sensibly. I.e. is ArrayList a good default?
| * | | | Merge pull request #1286 from paulp/topic/inliner-loggingJosh Suereth2012-09-111-6/+6
| |\ \ \ \ | | | | | | | | | | | | Topic/inliner logging
| | * | | | Merge branch '2.10.x' into topic/inliner-loggingPaul Phillips2012-09-1141-150/+562
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/backend/icode/GenICode.scala
| | * | | | Large logging cleanup effort.Paul Phillips2012-09-011-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Quieted down many logging statements which contribute disproportionate noise. Made others emit something more sensible. Spent lots of time on the inliner trying to find a regular format to make the logs more readable. Long way to go here but it'd be so worth it to have readable logs instead of mind-numbing indiscriminate text dumps.
| * | | | | Merge pull request #1262 from jsuereth/fix/SI-6271Josh Suereth2012-09-111-0/+32
| |\ \ \ \ \ | | |_|/ / / | |/| | | | Fixes SI-6271 - Missing isEmpty override for views.
| | * | | | Fixes SI-6271 - Missing isEmpty override for views.Josh Suereth2012-09-061-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | GenIterableView didn't override isEmpty for views to look at *filtered* iterator, but was instead pulling unfiltered iterator and causing issues. Chalk up another bizzare bug to lack of insight/visibility into linearization and what havoc overriding new methods can spew on our library.
| * | | | | Merge pull request #1270 from paulp/issue/6327Josh Suereth2012-09-102-0/+26
| |\ \ \ \ \ | | | | | | | | | | | | | | Fix for SI-6327, wrongness in Dynamic.
| | * | | | | Fix for SI-6327, wrongness in Dynamic.Paul Phillips2012-09-082-0/+26
| | | | | | |
| * | | | | | Merge pull request #1269 from jsuereth/wip/si-6333Josh Suereth2012-09-101-0/+29
| |\ \ \ \ \ \ | | | | | | | | | | | | | | | | Wip/si 6333
| | * | | | | | Fix for SI-6333 - Try throws from combinators.Josh Suereth2012-09-071-0/+29
| | |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Added more comprehensive tests to Try. * Delineated what methods do and don't catch exceptions in docs. * Fixed combinator methods that should catch exceptions.
| * / / / / / Makes getClass of a value class work.Martin Odersky2012-09-082-0/+12
| |/ / / / /
| * | | | | Merge pull request #1265 from scalamacros/ticket/6318Josh Suereth2012-09-064-0/+125
| |\ \ \ \ \ | | | | | | | | | | | | | | SI-6318 fixes ClassTag.unapply for primitives
| | * | | | | SI-6318 fixes ClassTag.unapply for primitivesEugene Burmako2012-09-064-0/+125
| | | |_|_|/ | | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ClassTag.unapply now has overloads for primitive value classes so that it can preserve boxiness when performing subtyping tests. First I wanted to annotate ClassTag.unapply with a ClassTag itself, i.e. to transform its signature from "def unapply(x: Any): Option[T]" to "def unapply[U: ClassTag](x: U): Option[T]". But then virtpatmat_typetag.scala exhibited a nasty problem. When pattern matching with this unapply, patmat first infers U as something and then tries to pattern match against this inferred type. And if U gets inferred as an abstract type itself, bad things happen: warning: The outer reference in this type test cannot be checked at run time. That's why I decided to drop the ClassTag idea and go with 9 extra overloads. Not very beautiful, but definitely robust.
| * | | | | fixes Manifest.Nothing and Manifest.NullEugene Burmako2012-09-068-38/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also introduces an important change to Manifest.Nothing and Manifest.Null. Previously their `erasure` was equal to classOf[Object]. Now it's correctly set to classOf[scala.runtime.Nothing$] and classOf[scala.runtime.Null$] correspondingly. See a discussion here: https://groups.google.com/forum/#!topic/scala-internals/Y0ALGo7QPqE
| * | | | | SI-6246 deprecated apis for core class tagsEugene Burmako2012-09-062-0/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Aliases ClassTag.XXX to Manifest.XXX to reuse already existing implementations of deprecated APIs.
| * | | | | removes Type.isConcreteEugene Burmako2012-09-066-6/+6
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This method was no longer used anywhere, except for a place where it wasn't really necessary. Its implementation is non-trivial, and I have doubts about it, so I propose to remove it altogether instead of living with some dubious code necessary for some dubious matter.
* | | | | Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2012-09-0418-109/+223
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Eugene Burmako (10) and others # Via Josh Suereth (10) and Paul Phillips (9) * origin/2.10.x: (32 commits) Removing duplication from Duration. Fixed positions in de-aliased special symbols and for automatically added `apply` methods. Fixes SI-6285 - ParIterableLike no longer says sequential foreach. SI-6274 Fix owners when eta-expanding function with byName param Fixes typos in the ScalaDoc of StringContext Allow nested calls to `askForResponse` in the presentation compiler. Made Dynamic extend Any. Fix for SI-6273, repl string interpolation. Formatting cleanup in def typed. Better errors for Any/AnyRef issues. Fix for SI-6263, futile adaptation. Suppressed 'possible cause' mis-warning. Fix for SI-6034, covariant value classes. Fixes SI-6290 by creating real instnaces of language features. SBT build now works with SBT 0.12. Removed previosuly uncommented code, added more diagnosis output to REPL. Made instrumenter more robust by looking at tokens Removed dead code. Two fixes for the worksheet instrumenter Fix SI-6294. ...
| * | | | Merge pull request #1251 from dragos/issue/fix-5064Paul Phillips2012-09-042-0/+48
| |\ \ \ \ | | |/ / / | |/| | | Fixed positions in de-aliased special symbols..
| | * | | Fixed positions in de-aliased special symbols and for automatically added ↵Iulian Dragos2012-09-042-0/+48
| | | |/ | | |/| | | | | | | | | | | | | `apply` methods. Fixed #5064, thanks to @paulp who showed the right direction (and how to test it).
| * / | Made Dynamic extend Any.Paul Phillips2012-09-032-0/+26
| |/ / | | | | | | | | | So it can be used in value classes.
| * | Merge pull request #1202 from scalamacros/topic/reflectionPaul Phillips2012-09-024-5/+5
| |\ \ | | | | | | | | further polishing of reflection
| | * | definitive way to learn if a symbol is a val/varEugene Burmako2012-08-274-5/+5
| | | | | | | | | | | | | | | | | | | | I think `isVal` and `isVar` are the right names, because they exactly map on Scala syntax.
| * | | Merge pull request #1231 from paulp/issue/6273Josh Suereth2012-09-022-0/+30
| |\ \ \ | | | | | | | | | | Fix for SI-6273, repl string interpolation.
| | * | | Fix for SI-6273, repl string interpolation.Paul Phillips2012-09-012-0/+30
| | | |/ | | |/| | | | | | | | | | | | | | | | | As usual the hard part is tracing through all the needless abstraction. Begone, 25 layers of parsing error issuing methods!
| * / | Better errors for Any/AnyRef issues.Paul Phillips2012-09-016-101/+101
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When an error occurs because some type does not conform to AnyRef (and an AnyRef-derived type would have sufficed) try to say something useful about the situation. This commit also initializes scope members before printing error messages because the + version seems more useful than the - version (taken from one of the checkfile diffs.) - def <init>: <?> - def methodIntIntInt: <?> + def <init>(): X + def methodIntIntInt(x: scala.Int,y: scala.Int): scala.Int
| * | Merge pull request #1201 from axel22/issue/4581Josh Suereth2012-09-011-3/+9
| |\ \ | | | | | | | | Fix SI-4581.
| | * | Fix SI-4581.Aleksandar Prokopec2012-08-271-3/+9
| | |/ | | | | | | | | | | | | | | | | | | Specifically, the final flag on the generated static field is no longer ommitted. Fix 2 failing test-cases.
| * | Merge pull request #1225 from jsuereth/fix/si-6290Josh Suereth2012-09-011-0/+4
| |\ \ | | | | | | | | Fixes SI-6290 by creating real instnaces of language features.
| | * | Fixes SI-6290 by creating real instnaces of language features.Josh Suereth2012-08-311-0/+4
| | | |
* | | | Merge remote-tracking branch 'origin/2.10.x' into merge-210Paul Phillips2012-09-0130-98/+532
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | # By Ruediger Klaehn (14) and others # Via Josh Suereth (13) and others * origin/2.10.x: (49 commits) More useful -Xlog-implicits output. Reflection tuning Two more value classes. Fixed cloning a double-linked list. Expanded the reach of value classes. Added/fixed test files for SI-6227 Two fixes for the worksheet instrumenter Fix crasher from bug in maven ant tasks. Yippie. Closes SI-6227 Fix for SI-6283, no abstract value classes. hotfix for SI-6293 Commented out assertions removes Symbol.kind and Type.kind Add missing tests for SI-6190 SI-6281 macroArgs for defs with implicit args SI-6280 Scaladoc: Reloading preserves anchors Added test to ensure that ListMap.tail is O(1) Made ListMap.tail O(1) instead of O(N) SI-6052 - fix groupBy on parallel collections SI-6272 Support lazy vals defined in try in template. ...
| * | | Merge pull request #1213 from paulp/topic/anyvalJosh Suereth2012-08-303-11/+7
| |\ \ \ | | | | | | | | | | Expanded the reach of value classes.
| | * | | Expanded the reach of value classes.Paul Phillips2012-08-293-11/+7
| | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Now extending AnyVal: - RichInt, RichDouble, etc. - ArrayOps.ofRef, ofBoolean, etc - StringAdd - StringFormat The rest of it is the changes necessary to enable those.
| * | | Merge pull request #1160 from rklaehn/SI-6220Josh Suereth2012-08-301-0/+92
| |\ \ \ | | | | | | | | | | Si 6220
| | * | | Added test that should cover all code paths of the changes done in SI-6220Ruediger Klaehn2012-08-181-0/+92
| | | | | | | | | | | | | | | | | | | | This test will pass even with an older version of the scala library, since as mentioned this is just a performance improvement.