summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #2930 from retronym/topic/patmat-inference-prepJason Zaugg2013-09-1147-165/+19
|\ | | | | Topic/patmat inference prep
| * Restore --show-diff to partest-ack.Paul Phillips2013-08-291-3/+4
| | | | | | | | | | Looks like that issue was operator error. However partest option --show-log really has gone missing.
| * Limit bad advice given for erroneous pattern.Paul Phillips2013-08-294-2/+15
| | | | | | | | | | Don't suggest "_: <none>" as an alternative when the pattern type doesn't conform to the expected type.
| * Removing orphan check/flag files.Paul Phillips2013-08-2942-160/+0
| |
* | Merge pull request #2910 from densh/topic/quasiquote-improvement-finalJason Zaugg2013-09-1127-570/+1275
|\ \ | | | | | | Various bugfixes and improvements for the quasiquotes
| * | streamline implementation of annotation splicingDen Shabalin2013-09-055-37/+34
| | | | | | | | | | | | | | | | | | Syntax spec mislead me to believe that annotation can't have type parameters or multiple argument lists... I guess the lesson here is don't trust the spec.
| * | unify handling of references to scala members for functions and tuplesDen Shabalin2013-09-052-20/+36
| | |
| * | make the postfixOps warning go awayDen Shabalin2013-09-051-1/+1
| | |
| * | better support for ValDefs, VarDefs and DefDefsDen Shabalin2013-09-055-0/+64
| | |
| * | rename TupleN and TupleTypeN into SyntacticTuple and SyntacticTupleTypeDen Shabalin2013-09-054-11/+11
| | |
| * | SI-7723 better support for deconstruction of new expressionsDen Shabalin2013-09-055-1/+43
| | |
| * | SI-7803 support for matching of anonymous function literalsDen Shabalin2013-09-058-8/+60
| | |
| * | first-class early def splicing and extraction supportDen Shabalin2013-09-0510-66/+334
| | |
| * | extract out isHole(name)Den Shabalin2013-09-051-3/+5
| | |
| * | add support for function type splicing and extractionDen Shabalin2013-09-0510-3/+62
| | |
| * | reify ScalaPackage symbol with the help of ScalaDotDen Shabalin2013-09-055-1/+24
| | |
| * | refine block and applied/typeapplied splicing/matching semanticsDen Shabalin2013-09-0512-60/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. blocks now match single term-level expressions to account for automatic block elimination. E.g. val q"{ ..$stats }" = q"foo" will match into stats = List(q"foo"). This is useful to uniformly deal with blocks on term level. 2. blocks in quasiquotes collapse into single expressions 3. Applied and TypeApplied now have constructors too which helps to unify matching and extraction in quasiquote reifier 4. TypeApplied now matches AppliedTypeTree too 5. Add Syntactic prefix to Applied and TypeApplied
| * | SI-7196 add support for refineStat splicing and extractionDen Shabalin2013-09-059-25/+67
| | |
| * | reduce amount of clutter on -Yquasiquote-debugDen Shabalin2013-09-051-3/+3
| | |
| * | minor changes to TreeGen.mkTemplateDen Shabalin2013-09-051-8/+9
| | | | | | | | | | | | | | | 1. Make superPos parameter optional with default value NoPosition 2. use Option instead of List for local optional constructor variable
| * | move mkNew from tools.nsc.ast.TreeGen to reflect.internal.TreeGenDen Shabalin2013-09-052-36/+35
| | | | | | | | | | | | This is needed for quasiquotes to implement SyntacticNew combinator.
| * | use NoMods and NoFlags for reification of empty valuesDen Shabalin2013-09-053-41/+49
| | |
| * | merge flagsFromBits and FlagsAsBits into FlagsReprDen Shabalin2013-09-058-22/+30
| | |
| * | rename mkAnnotationCtor into mkAnnotationDen Shabalin2013-09-054-5/+5
| | |
| * | add missing copyTypeDef utility functionDen Shabalin2013-09-051-0/+16
| | |
| * | refactor definition tests into separate subsuiteDen Shabalin2013-09-055-249/+326
| | |
| * | add toolbox-based utility methods to quasiquotes' testsDen Shabalin2013-09-051-6/+15
| | |
* | | Merge pull request #2904 from som-snytt/issue/reflect-priv-ctorJason Zaugg2013-09-103-1/+24
|\ \ \ | | | | | | | | SI-7810 Reflect private constructor
| * | | SI-7810 Reflect private constructorSom Snytt2013-09-033-1/+24
| | | | | | | | | | | | | | | | | | | | `JavaMirror.constructorToJava` uses `getDeclaredConstructor` now instead of `getConstructor`.
* | | | Merge pull request #2926 from paulp/pr/treecheckersJason Zaugg2013-09-1010-121/+283
|\ \ \ \ | | | | | | | | | | Noise reduction + minor enhance in TreeCheckers.
| * \ \ \ Merge pull request #10 from retronym/topic/tree-checker-higher-order-tparamPaul Phillips2013-09-091-1/+1
| |\ \ \ \ | | | | | | | | | | | | Avoid spurious tree checker warning for higher order type params
| | * | | | Avoid spurious tree checker warning for higher order type paramsJason Zaugg2013-09-101-1/+1
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | TreeCheckers is trying to find references to a) local types (term owned) or b) to type parameters from a trees that are not ancestors of the a) term or b) type param owner. Such references are ill-scoped and suggest that a tree has been transplanted without proper substitution. However, this check failed to account for higher order type parameters, as seen in the spurious warning emitted by: test/pending/pos/treecheckers/c5.scala.
| * | | | Noise reduction + minor enhance in TreeCheckers.Paul Phillips2013-09-0910-121/+283
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Misc irrelevant work, which I can only offer as-is. It lowers the noise in -Ycheck:* output and performs some common sense chillaxes like not screaming ERROR IN INTERNAL CHECKING! WE'RE ALL GOING TO DIE! when a tree doesn't hit all nine points at the Jiffy Tree. You can see some reasonably well reduced symbol flailing if you run the included pending tests: test/partest --show-diff test/pending/pos/treecheckers Example output, Out of scope symbol reference { tree TypeTree Factory[Traversable] position OffsetPosition test/pending/pos/treecheckers/c5.scala:3 with sym ClassSymbol Factory: Factory[CC] and tpe ClassArgsTypeRef Factory[Traversable] encl(1) ModuleSymbol object Test5 ref to AbstractTypeSymbol X (<deferred> <param>) }
* | | | | Merge pull request #2915 from retronym/ticket/7817Jason Zaugg2013-09-105-1/+202
|\ \ \ \ \ | | | | | | | | | | | | SI-7817 Fix regression in structural types
| * | | | | SI-7817 Fix regression in structural typesJason Zaugg2013-09-093-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Calls to structural types are converted to reflective calls in the `cleanup` phase, which, along with `mixin`, does its work after `flatten`. `Symbol#owner` behaves in a phase dependent manner; after flatten the owner of lifted class is given as the enclosing package. Except when they're not. `ModuleSymbol`s representing an object nested inside a class are viewed dually as modules *and* methods (see the comments on `isModuleNotMethod` for some background). When it comes time to flatten, we're presented with a quandary: the method must clearly stay owned by the enclosing class, but surely the lifted module should be owned by the enclosing package, to have the same owner as its associated module class. The `method` nature of this symbol seems to win: override def owner = { if (Statistics.hotEnabled) Statistics.incCounter(ownerCount) if (!isMethod && needsFlatClasses) rawowner.owner else rawowner This wrinkle leads to a wrong turn in `TreeGen#mkAttributedRef`, which incorrectly rewrites `REF(O)` to `p1.`package`.O`. It seems this problem has gone unnoticed because the tree emitted referred to a static symbol (the reflection cache for structural types), and the backend simply elided the qualifier `p1.package`. A recent change to the backend makes it more conservative about dropping qualifiers on the floor, and it started emitting a reference to a package object that doesn't exist. This commit despairingly checks `isDefinedInPackage` of both the module *and* the module class. The test cases from the previous commit illustrated the status quo, and this commit updates the joint compilation test with the bug fix. A new test is to show that the symptom (structural type crash) is now fixed.
| * | | | | SI-7817 Tests to show the foibles of mkAttributedRefJason Zaugg2013-09-094-0/+201
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To `package`, or not `package`, that is the question. This lines marked with !!! get this wrong, and be remedied by the next commit. This problem is culpable for the crash in the enclosed `pending` test.
* | | | | | Merge pull request #2925 from retronym/topic/opt-implicit-logPaul Phillips2013-09-091-1/+1
|\ \ \ \ \ \ | |_|/ / / / |/| | | | | Avoid needless Type stringification when logging is disabled.
| * | | | | Avoid needless Type stringification when logging is disabled.Jason Zaugg2013-09-091-1/+1
|/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since 4d6be05c28, we've been a tad wasteful in implicit searches. This adds a by-name parameter to the local logging method to avoid that.
* | | | | Merge pull request #2907 from paulp/pr/typetree-original-rangeposJason Zaugg2013-09-096-35/+43
|\ \ \ \ \ | | | | | | | | | | | | Eliminate TypeTrees with null original.
| * | | | | Eliminate TypeTrees with null original.Paul Phillips2013-09-046-35/+43
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a retry of #2801 after figuring out the range position error. Should there be anyone out there who compiles with -Xdev, know that this commit eliminates the 1406 errors one presently incurs compiling src/library. A val declared in source code receives only one tree from the parser, but two are needed - one for the field and one for the getter. I discovered long ago that if the val had an existential type, this was creating issues with incompatible existentials between the field and the getter. However the remedy for that did not take into account the whole of the wide range of super subtle issues which accompany tree duplication. In particular, the duplicated tree must be given not only a fresh TypeTree(), but that TypeTree cannot share the same original without running afoul of range position invariants. That's because typedTypeTree resurrects the original tree with whatever position it has - so the "original" needs to be a duplicate of the original with a focused position. Should the call to TypeTree.duplicate also duplicate the original? I think so, but I bequeath this question to others. This commit also eliminated some duplicate error messages, because duplicate suppression depends on the errors having the same position. See c478eb770d, 7a6fa80937 for previous related work.
* | | | | Merge pull request #2885 from som-snytt/issue/7791-script-linenumsJason Zaugg2013-09-087-14/+73
|\ \ \ \ \ | | | | | | | | | | | | SI-7791 Line number table reflects underlying file
| * | | | | SI-7791 Line number table reflects underlying fileSom Snytt2013-09-057-14/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since positions ultimately know their ultimate positions in their ultimate source, use that line number, ultimately, when emitting line number table entries. It is possible, but possibly not useful, to emit both the actual (ultimate) line number and the nominal one. The `int`-valued line number of the `StackTraceElement` is "derived" from the attribute. In global, wrapping a `BatchSourceFile` as a `ScriptSource` happens in `compileSources` to facilitate testing. A `ScriptTest` facility is provided to facilitate testing the script facility. It is rather facile.
* | | | | | Merge pull request #2865 from folone/trampolinesGrzegorz Kossakowski2013-09-072-9/+67
|\ \ \ \ \ \ | | | | | | | | | | | | | | Alter TailRec to have map and flatMap
| * | | | | | Stackless implementation of TailRec in constant memory.Runar Bjarnason2013-08-241-24/+34
| | | | | | |
| * | | | | | Alter TailRec to have map and flatMapGeorge Leontiev2013-08-242-7/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in the "Stackless Scala with Free Monads" paper scala> import scala.util.control.TailCalls._ import scala.util.control.TailCalls._ scala> :paste // Entering paste mode (ctrl-D to finish) def isEven(xs: List[Int]): TailRec[Boolean] = if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail)) def isOdd(xs: List[Int]): TailRec[Boolean] = if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail)) // Exiting paste mode, now interpreting. isEven: (xs: List[Int])util.control.TailCalls.TailRec[Boolean] isOdd: (xs: List[Int])util.control.TailCalls.TailRec[Boolean] scala> isEven((1 to 100000).toList).result res0: Boolean = true scala> def fib(n: Int): TailRec[Int] = | if (n < 2) done(n) else for { | x <- tailcall(fib(n - 1)) | y <- tailcall(fib(n - 2)) | } yield (x + y) fib: (n: Int)util.control.TailCalls.TailRec[Int] scala> fib(40).result res1: Int = 102334155
* | | | | | | Merge pull request #2900 from nermin/masterGrzegorz Kossakowski2013-09-074-4/+4
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | Correcting scaladoc for all classes defining withDefaultValue method.
| * | | | | | | Correcting scaladoc for all classes defining withDefaultValue method.nermin2013-08-304-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The description of the single parameter seems to be a copy and paste mistake from withDefault method.
* | | | | | | | Merge pull request #2917 from som-snytt/issue/7805-repl-iGrzegorz Kossakowski2013-09-076-9/+82
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | SI-7805 REPL -i startup
| * | | | | | | | SI-7805 REPL -i startupSom Snytt2013-09-066-9/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Tested with a ReplTest that loads an include script. ReplTests can choose to be `Welcoming` and keep a normalized welcome message in their check transcript. One recent SessionTest is updated to use the normalizing API.
* | | | | | | | | Merge pull request #2912 from retronym/ticket/7643Grzegorz Kossakowski2013-09-077-10/+21
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | SI-7643 Enable newPatternMatching in interactive.