summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge remote-tracking branch 'adriaanm/topic/partialfun' into developPaul Phillips2012-03-301-3/+3
|\ \ \ \ \ | |_|/ / / |/| | | |
| * | | | a fast, functional PartialFunction implementationPavel Pavlov2012-03-301-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | runtime.AbstractPartialFunction provides a default implementation for the new-style partial function. In principle this class is only subclassed by compiler-generated partial functions arising from matches. Either - the apply method (old-style partialfun) or - the applyOrElse method (current scheme) must be overridden, and the isDefinedAt method implemented. The applyOrElse method implementation is provided to ease the transition from the old scheme, since starr still generates old-style PartialFunctions, but locker's library has the new AbstractPartialFunction. Thus, this implementation is intended as a drop-in replacement for the old partial function, and does not require changes to the compiler. (compiler patches, both for old and new-style pattern matching, follow) - runtime.AbstractPartialFunction is based on PartialFunction.WithDefault Original version of FunctionWithDefault by Odersky (http://article.gmane.org/gmane.comp.lang.scala.internals/4032) - better performance for OrElse#applyOrElse, OrElse#lift, PF.cond - new combinator methods: PF#run, PF#runWith, PF.apply authored by @pavelpavlov, refactored by @adriaanm, review by @paulp
* | | | | Fix for regression with inference at arity 21+.Paul Phillips2012-03-301-0/+14
| | | | | | | | | | | | | | | | | | | | A classic "off by two" error. Closes SI-4545, SI-5633.
| | | | |
| \ \ \ \
*-. \ \ \ \ Merge remote-tracking branches 'heathermiller/doc/linking' and ↵Paul Phillips2012-03-301-1/+1
|\ \ \ \ \ \ | |_|/ / / / |/| | / / / | | |/ / / 'axel22/feature/future-compat' into develop
| | * | | Work on source compatibility between akka and scala futures.Aleksandar Prokopec2012-03-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | Removed some methods from execution contexts. Changed Awaitable interface.
* | | | | A couple tests for pending.Paul Phillips2012-03-294-0/+62
|/ / / /
* | | | Revert the lisp test.Paul Phillips2012-03-282-3/+4
| | | | | | | | | | | | | | | | The lisp test enjoys the suffering of others.
* | | | Never write final fields outside of constructors.Paul Phillips2012-03-283-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | Closes SI-3569, SI-3770. Also threw in experimental -Yoverride-vars. It's not robust.
* | | | Revived the lisp test.Paul Phillips2012-03-282-4/+3
|/ / / | | | | | | | | | | | | | | | All hail the lisp test! Closes SI-4579.
* | | Merge remote-tracking branch 'axel22/feature/collection-concurrent' into developPaul Phillips2012-03-278-64/+65
|\| |
| * | Rename ConcurrentTrieMap to concurrent.TrieMap.Aleksandar Prokopec2012-03-278-64/+65
| | | | | | | | | | | | | | | | | | | | | | | | Introduced the collection.concurrent package and introduced the concurrent.Map trait there. Deprecated the mutable.ConcurrentMap trait. Pending work - introduce the appropriate changes to JavaConversions and JavaConverters.
* | | Workaround for "package is not a value".Paul Phillips2012-03-272-0/+83
| |/ |/| | | | | | | | | Not actually a fix, but when we see a package where a module is expected, it's not a great stretch to try the package object. References SI-5604.
* | Fixes SI-5373Vlad Ureche2012-03-278-5/+39
| | | | | | | | | | And adds basic support for scaladoc model tests (class partest.ScaladocModelTest)
* | Merge remote-tracking branch 'adriaanm/topic/virtpatmat' into developPaul Phillips2012-03-233-0/+16
|\ \
| * | do nothing when closing closed block in ignoremodeAdriaan Moors2012-03-231-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | this came to light with the virtual pattern matcher, which emits jumps like `matchEnd3(_test(Test.this, false))`, where _test is a tailcall the nested jumping caused double-closing (the second time in ignore mode) thus. when closing a closed block in ignore mode, simply do nothing from genLoad for label-jumps: note: when one of the args to genLoadLabelArguments is a jump to a label, it will call back into genLoad and arrive at this case, which will then set ctx1.bb.ignore to true, this is okay, since we're jumping unconditionally, so the loads and jumps emitted by the outer call to genLoad (by calling genLoadLabelArguments and emitOnly) can safely be ignored, however, as emitOnly will close the block, which reverses its instructions (when it's still open), we better not reverse when the block has already been closed but is in ignore mode (if it's not in ignore mode, double-closing is an error) @dragos figured it out, all I did was write the comment and the `if` test case to repro basic blocks crasher the tailcall in the forward jump `matchEnd3(_test(Test.this, false))` in the following program crashes the back-end (error below) @scala.annotation.tailrec final def test(meh: Boolean): Boolean = { <synthetic> val _$this: Test.type = Test.this; _test(_$this,meh){ case <synthetic> val x1: Some[String] = new Some[String]("a"); case3(){ matchEnd2({ case <synthetic> val x1: Some[String] = x1; case4(){ if (x1.ne(null)) matchEnd3(if (meh) _test(Test.this, false) else false) else case5() }; case5(){ matchEnd3(_test(Test.this, false)) }; matchEnd3(x){ x } }) }; matchEnd2(x){ x } } }; The last instruction (of basic block 11) is not a control flow instruction: CONSTANT(false) // methods def test(meh: Boolean (BOOL)): Boolean { locals: value meh, value _$this, value x1, value x, value x, value x1 startBlock: 1 blocks: [1,2,3,4,5,6,7,8,9,10,11,12,13] 1: 4 JUMP 2 2: 5 NEW REF(class Some) 5 DUP(REF(class Some)) 5 CONSTANT("a") 5 CALL_METHOD scala.Some.<init> (static-instance) 5 STORE_LOCAL(value x1) 5 SCOPE_ENTER value x1 5 JUMP 3 3: 5 LOAD_LOCAL(value x1) 7 STORE_LOCAL(value x1) 7 SCOPE_ENTER value x1 7 JUMP 4 4: 7 LOAD_LOCAL(value x1) 7 CZJUMP (REF(class Object))NE ? 5 : 6 5: 8 LOAD_LOCAL(value meh) 8 CZJUMP (BOOL)NE ? 8 : 9 6: ? JUMP 11 7: 7 DROP BOOL 7 JUMP 11 8: 8 CONSTANT(false) 8 STORE_LOCAL(value meh) 8 JUMP 2 9: 8 CONSTANT(false) 8 JUMP 10 10: 8 STORE_LOCAL(value x) 8 JUMP 12 11: 9 JUMP 2 9 STORE_LOCAL(value meh) 9 CONSTANT(false) 12: 7 LOAD_LOCAL(value x) 7 SCOPE_EXIT value x1 7 STORE_LOCAL(value x) 7 JUMP 13 13: 5 LOAD_LOCAL(value x) 5 SCOPE_EXIT value x1 5 RETURN(BOOL)
| * | [vpm] avoid verifyerror: leave jump to tail-pos labelAdriaan Moors2012-03-233-0/+15
| | | | | | | | | | | | | | | the following commit deals with the fall-out in basicblocks (double closing of blocks in ignore mode)
* | | Adapted scaladoc testVlad Ureche2012-03-231-6/+9
| | |
* | | Document regex replacement strings behavior.Daniel C. Sobral2012-03-232-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | All replacement methods use dolar signs to identify groups in the matched string, and backslashes to escape characters. Document this behavior, and provide a method that can be used to properly quote replacement strings when this behavior is not desired. Closes SI-4750.
* | | Regex improvementsDaniel C. Sobral2012-03-231-0/+32
|/ / | | | | | | | | | | | | | | | | | | | | This adds findAllMatchIn to Regex to mirror other similar methods. It also overloads StringLike's "r", adding a version that accepts group names. It includes test cases for both methods. Closes SI-2460.
* | Undo the revert.Lukas Rytz2012-03-232-16/+0
| | | | | | | | | | reverts 3db29dde051614d976bca92a1cdeb109c9c0ab01 and 5af2bf54d21ac63236cd6e68586b2c38fa0f28c3 restores 19a48510c2e18430a35319c04dfe3bad7119f23f
* | Test case for cause of previous commit's reversion.Paul Phillips2012-03-222-0/+16
| |
| |
| \
| \
| \
| \
| \
*-----. \ Merge remote-tracking branches 'axel22/feature/pc-execution-contexts', ↵Paul Phillips2012-03-2263-223/+1031
|\ \ \ \ \ | |_|_|_|/ |/| | | | | | | | | 'VladUreche/issue/5593', 'dragos/master', 'VladUreche/issue/5599', 'adriaanm/ticket/treeannot' and 'heathermiller/issue/5291' into develop
| | | | * Test case closes SI-4987.Paul Phillips2012-03-222-0/+6
| | | |/
| | * / Increased the timeout from 5s to 60s to make the presentation compiler ↵Iulian Dragos2012-03-221-1/+1
| | |/ | | | | | | | | | shutdown test more resilient on slow machines.
| | * An illustrative delayedInit test.Paul Phillips2012-03-214-0/+242
| | |
| | * Merge branch 'issue/SI-5580' of /scala/trunk into developPaul Phillips2012-03-216-0/+79
| | |\
| | | * Overhaul of JavaConver{sions,ters}.Paul Phillips2012-03-215-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initially motivated by SI-5580, then just motivated. I broke up the opaquely named JavaConversions and JavaConverters into the following traits encapsulating some permutation of { to java, to scala, bidirectional } { wrappers, decorators } I named everything consistently in terms of either Wrappers or Decorators. Decorators install those asJava/asScala methods onto collections of the right kind; Wrappers hide the process. JavaConversions then reduces to an object which (ill-advisedly) extends both WrapAsJava and WrapAsScala. And JavaConverters is an object extending DecorateAsScala and DecorateAsJava. However other more clearly named vals exist in the newly created scala.collection.convert package object. val decorateAsJava = new DecorateAsJava { } val decorateAsScala = new DecorateAsScala { } val decorateAll = new DecorateAsJava with DecorateAsScala { } val wrapAsJava = new WrapAsJava { } val wrapAsScala = new WrapAsScala { } val wrapAll = new WrapAsJava with WrapAsScala { } So for instance to import asScala decorators, and only those: scala> import scala.collection.convert.decorateAsScala._ import scala.collection.convert.decorateAsScala._ scala> new java.util.ArrayList[String].asScala groupBy (x => x) res0: scala.collection.immutable.Map[String,scala.collection.mutable.Buffer[String]] = Map() I propose we put those vals or a subset of them in the scala package object rather than way down in scala.collection.convert.
| | | * Clarifying MethodSynthesis.Paul Phillips2012-03-211-0/+17
| | |/ | |/| | | | | | | | | | Tried to paint a picture of how one might synthesize an implicit method to accompany an implicit class.
| | * Fixed test cases.Martin Odersky2012-03-213-28/+10
| | |
| | * Fixed SI-5063.Martin Odersky2012-03-212-0/+7
| | |
| | * Allows now private primary constructors in value classes.Martin Odersky2012-03-211-15/+69
| |/
| * Restore irrefutability commits.Paul Phillips2012-03-209-0/+134
| | | | | | | | This reverts commit d8ba5d091e5641553b438ef9930a6023a2709dcd.
| * Fix for stability failure.Paul Phillips2012-03-201-0/+37
| | | | | | | | | | | | | | Pattern matcher! Totally unrelated to irrefutability, the pattern matcher at some point stopped sorting its lookup switch cases, and the butterfly's wings flapped enough to swap two cases. Now they're sorted in ascending order like they're supposed to be.
| * Lots of tedious warning and tree printing work.Paul Phillips2012-03-2013-81/+104
| | | | | | | | | | | | | | | | | | | | | | Fewer deprecation warnings, prettier trees, prettier symbols, more polished error messages. Oh the interesting people you meet handling warnings, I feel sorry for you all that I get to do it all the time. One of the characters I met invited me into the "Dead Code Society" and that's what I'm doing on Tuesdays now. No of course you haven't, it's a SECRET society.
| * Revert irrefutability commits.Paul Phillips2012-03-209-134/+0
| | | | | | | | | | Temporary reversion of irrefutability commits in interests of stable milestone. Expect to restore shortly.
| *-. Merge remote-tracking branches 'vjovanov/duration-cleanup', ↵Paul Phillips2012-03-2029-97/+475
| |\ \ | | | | | | | | | | | | 'adriaanm/topic/virtpatmat' and 'vjovanov/actor-hierarchy' into develop
| | * | [vpm] fix half of my existential troublesAdriaan Moors2012-03-201-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | no need for the clunky repackExistential pack the type of each case instead, since the skolems we've created shouldn't last beyond the case anyway this way we don't end up with fresh, incompatible, skolems for every case, but a neatly packed existential
| | * | [vpm] typer synths Function{} for empty-sel matchAdriaan Moors2012-03-207-88/+200
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | typedMatchAnonFun is called from typedFunction when the function's body is a match this is work-in-progres: the compiler currently won't bootstrap under -Yvirtpatmat see also the pending test make sure to use the right context in typeFunction when the body is a Match when typer is set up for type checking a Function, the current owner is the symbol for the function, but we'll type check a Block(List(ClassDef(cd)), New(cd)) when the function is a match, and the function symbol is nowhere to be found, so go to outer context in patmatvirt: - simplified default case gen (no need for a Casegen instance) - using CASE | SYNTHETIC to detect generated matches (for switches) and avoid typing them endlessly more uniform, and necessary for new-style anon Function class instance gen for matches
| | * | [vpm] TODO note: make unapply type list stricterAdriaan Moors2012-03-203-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when an unapply returns Option[T] where T is some ProductN, does that mean the unapply returns 1 result, i.e., that T, or did it mean to return N results? to disambiguate, falling back to stricter spec-adherence, which requires T be exactly TupleN for N results for now, allow extractor result to be any product, not just tuple
| | * | [vpm] test file for regression on old patmatAdriaan Moors2012-03-202-0/+9
| | |/ | | | | | | | | | it's a warning on new patmat -- TODO: dig deeper
| | * Merge branch 'issue/5054-usecase-cleanup'Vlad Ureche2012-03-202-0/+54
| | |\ | | | | | | | | | | | | | | | | Conflicts: test/scaladoc/scala/html/HtmlFactoryTest.scala
| | | * Adapted indentation in scaladoc code blocksVlad Ureche2012-03-202-1/+55
| | | | | | | | | | | | | | | | | | | | and fixed a pesky crash in the syntax highlighting caused by invalid chars (0x0E) in MarkupParser.scala.
| | * | Test cases closes SI-4574.Paul Phillips2012-03-192-0/+15
| | | | | | | | | | | | | | | | Looks like I got that irrefutability bug too.
| | * | Spiced up the irrefutability tests a bit.Paul Phillips2012-03-194-29/+36
| | | |
| | * | Discovered filter was still being generated.Paul Phillips2012-03-191-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than withFilter, for a subset of for comprehension structures. Not sure if this was somewhat by design - only seems possible because refchecks was only looking for nme.filter, not nme.withFilter, so perhaps this was intended as some secret irrefutability backchannel? Really have to document that sort of thing if it's intentional. I assumed it wasn't and unified everything.
| | * | Finally did something about broken irrefutability.Paul Phillips2012-03-194-0/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser has always been confused about tuple patterns in for comprehensions. It thinks it can fail to recognize an irrefutable pattern and have it removed in refchecks, but it is sadly mistaken, because the unnecessary filter has a tendency to fail the compile in typer. Look more intently for irrefutable patterns and don't insert the unnecessary filter. Closes SI-5589, SI-1336.
| | * | SI-5189: refined GADT soundness fixAdriaan Moors2012-03-195-9/+30
| | | | | | | | | | | | | | | | | | | | extrapolate GADT skolems: only complicate types when needed make sure we only deskolemize GADT skolems after typedCase
| * | | Cleaned up Duration for the standard library.Vojin Jovanovic2012-03-201-1/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Removed Timeout from the library. Each library should provide its own implementation of Timeout - Removed duration package object and replaced it with regular object - Removed usages of post Java 1.5 TimeUnit members - Added factory methods for FiniteDuration - Cleaned up some unnecessary comments - Merged duration DSL with Duration.scala file Review by: @phaller
* | | Merge branch 'master' into feature/pc-execution-contextsAleksandar Prokopec2012-03-21117-339/+2310
|\| |
| * | Merge branch 'mar17-colorize'Paul Phillips2012-03-182-0/+726
| |\ \