summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* SI-4425 do some validity checking on unapplies.Paul Phillips2013-08-175-4/+109
| | | | | | Filter out unapplies which can't be called (such as those with a second non-implicit parameter list) and report the error in a meaningful fashion.
* Move most of Typers#Typer#typedTyped into PatternTypers.Paul Phillips2013-08-172-54/+64
| | | | | | Again moving pattern-typing logic out of Typers. You can tell I like writing Typers#Typer#typedTyped.
* Turned TreeMaker into case class.Paul Phillips2013-08-171-9/+11
| | | | Type aliases are better than naked tuples, but only barely.
* Compressed central TreeMaker pattern match.Paul Phillips2013-08-171-79/+73
| | | | | It's easier to follow the logic when it can all be seen at once. I moved the specification excerpts down below for continued reference.
* Pulled pattern typing methods from Typers.Paul Phillips2013-08-172-274/+322
| | | | | | To the extent possible this commit is purely the extraction of those methods into the newly created PatternTypers trait. The slicing and dicing of those methods will follow shortly.
* Broke up typed1's giant pattern match.Paul Phillips2013-08-171-45/+66
| | | | | | | | | | | Another level of dispatch based on what trees on can expect to see during what mode. This should be beneficial for both performance (smaller methods, fewer type tests) and correctness (prevent trees from reaching inappropriate typing methods by construction rather than via ad hoc checks.) This work also revealed that UnApply trees never reach here, so I removed typedUnApply as dead code.
* Deduplicate mkZero in pattern matcher.Paul Phillips2013-08-171-19/+10
|
* Simplified the MaybeBoundTyped extractor a bit.Paul Phillips2013-08-173-6/+23
|
* Segreated CPS hacks in pattern matcher.Paul Phillips2013-08-171-21/+34
|
* Remedied glaring omission in error output.Paul Phillips2013-08-171-1/+1
| | | | | | Catching an assert and providing beautifully formatted contextual information is a questionable service if you forget to provide the error message from the assert.
* An Unapplied extractor.Paul Phillips2013-08-172-15/+14
| | | | | This makes it a lot less error prone and redundant to find the part you need when unwrapping an UnApply tree.
* Minor improvement in pattern typer inference.Paul Phillips2013-08-171-9/+12
| | | | | | | | This exploits the infrastructure developed for checking the checkability of type patterns to improve pattern type inference, which suffered from a similar deficit. There was a hack for SI-2486, the best I could manage at the time I wrote it; that is replaced with the principled approach.
* Add checkability condition.Paul Phillips2013-08-171-2/+4
| | | | | All parents of an intersection type must be checkable for the type to be checkable.
* Cleanups in Unapplies.Paul Phillips2013-08-173-33/+27
|
* Cosmetic cleanup in the matcher.Paul Phillips2013-08-173-27/+25
|
* Positioned variations of inform/warning/globalError.Paul Phillips2013-08-171-9/+14
| | | | Because who doesn't want a little positioning in their life.
* Removed some dead code in Uncurry.Paul Phillips2013-08-171-21/+4
|
* Pushed some noisy logging down to debuglog.Paul Phillips2013-08-174-4/+11
|
* Add a helper method drop to ScalaRunTime.Paul Phillips2013-08-171-1/+5
| | | | | | | | We should do a lot more of this - it's ridiculously difficult and error prone to generate code of this kind involving implicits, type inference, etc. where the same goal is trivially accomplished by generating a method call and letting the typer work out the details.
* Expand the understanding of bytecode tests.Paul Phillips2013-08-172-6/+18
| | | | | | | | The new method is the same as sameMethodAndFieldSignatures, but ignores generic signatures. This allows for testing methods which receive the same descriptor but differing generic signatures. In particular, this happens with value classes, which get a generic signature where a method written in terms of the underlying values does not.
* Some general purpose methods.Paul Phillips2013-08-174-6/+76
| | | | Motivated by pattern matcher work, also useful elsewhere.
* Add some standard names used in pattern matcher.Paul Phillips2013-08-171-0/+3
|
* Make memberType less crashy.Paul Phillips2013-08-171-1/+1
| | | | | | | | It's a source of constant peril that sym.tpe on NoSymbol is fine (it's NoType) but tpe memberType sym on NoSymbol throws a NSDNHO. The last thing we should be doing is discouraging people from using memberType in favor of sym.tpe, the latter being almost always the wrong thing.
* Repair NPE in -Ytyper-debug output.Paul Phillips2013-08-171-1/+1
|
* Crasher in symbol tracer.Paul Phillips2013-08-171-1/+1
|
* Merge pull request #2845 from soc/SI-7704-reduxAdriaan Moors2013-08-161-1/+1
|\ | | | | SI-7704 Fix partest's test category selection (again)
| * SI-7704 Fix partest's test category selection (again)Simon Ochsenreither2013-08-161-1/+1
|/ | | | | Looks like multiple, different fixes for this issue managed to break it again.
* Merge pull request #2843 from xeno-by/topic/kill-introduce-top-levelAdriaan Moors2013-08-1623-358/+3
|\ | | | | kills introduceTopLevel
| * kills introduceTopLevelEugene Burmako2013-08-1623-358/+3
| | | | | | | | | | | | | | | | | | | | | | As we've figured out from the practice, introduceTopLevel is seductively useful but unfortunately not robust, potentially bringing compilation order problems. Therefore, as discussed, I'm removing it from the public macro API. Alternatives are either: 1) delving into internals, or 2) using macro paradise and experimenting with macro annotations: http://docs.scala-lang.org/overviews/macros/annotations.html.
* | Merge pull request #2841 from gourlaysama/wip/t6507Adriaan Moors2013-08-164-3/+45
|\ \ | | | | | | SI-6507 do not call .toString on REPL results when :silent is on.
| * | SI-6507 do not call .toString on REPL results when :silent is on.Antoine Gourlay2013-08-164-3/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Member handlers used to always call .toString on REPL results, even when :silent was on, which could force evaluation or cause unwanted side effects. This forwards the current value of `printResults` to the member handlers (through Request) for them to decide what to do when the results must not be printed. 2 handlers now do not return any extraction code when silent: - ValHandler, so that it doesn't call toString on the val - Assign, so that it doesn't call toString on the right-hand side of the assignement.
* | | Merge pull request #2837 from soc/SI-7630Adriaan Moors2013-08-161-4/+9
|\ \ \ | | | | | | | | SI-7630 [Avian] Skip test run/repl-javap-outdir-funs on Avian
| * | | SI-7630 [Avian] Skip test run/repl-javap-outdir-funs on AvianSimon Ochsenreither2013-08-161-4/+9
| | |/ | |/| | | | | | | | | | | | | | | | | | | The test fails, because the REPL command reports that no anonfuns were found. I have spent a considerable amount of time to figure out what's the issue here with no success. Skip it for now, so that we don't lose sight of the big picture.
* | | Merge pull request #2836 from soc/SI-7564-reduxAdriaan Moors2013-08-161-18/+18
|\ \ \ | | | | | | | | SI-7564 [Avian] Whitespace fixes to run/tailcalls.check
| * | | SI-7564 [Avian] Whitespace fixes to run/tailcalls.checkSimon Ochsenreither2013-08-161-18/+18
| | |/ | |/| | | | | | | | | | Looks like the differences in the whitespace caused the test to fail on Avian.
* | | Merge pull request #2777 from soc/SI-7681-dead-code-daemonthreadfactoryAdriaan Moors2013-08-163-77/+35
|\ \ \ | | | | | | | | SI-7681 Remove DaemonThreadFactory, clean up IMain
| * | | Clean up imports in s.t.n.interpreter.IMainSimon Ochsenreither2013-08-151-38/+33
| | | |
| * | | SI-7681 Remove scala.tools.nsc.io.DaemonThreadFactorySimon Ochsenreither2013-08-153-40/+3
| |/ /
* | | Merge pull request #2830 from densh/topic/stats-parsing-2Adriaan Moors2013-08-1626-143/+368
|\ \ \ | | | | | | | | updated SI-7331, SI-6843, SI-7731, parser entry point refactoring, assertThrows utility function
| * | | addresses feedback regarding new junit testsDen Shabalin2013-08-154-21/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. don't recreate symbol table manually and just let JUnit do it automatically behind the scenes 2. minor changes to assertThrow's description 3. add one more test case to check that exception's subclasses are catched too 4. refine rethrow test to ensure that the exception wasn't swallowed
| * | | SI-6843 well-positioned syntax errors for quasiquotesDen Shabalin2013-08-147-56/+116
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is achieved in a following way: 1. Similarly to toolbox quasiquotes can go away with wrapping for parsing purpose after introduction of `parseStats` and `parseRule` entry points. 2. In case of syntax error quasiquote computes equivalent corresponding position in the source code with the help of `corrrespondingPosition` mapper which relies on position data collected into `posMap` during code generation.
| * | | SI-7331 remove all the wrapping code from toolboxDen Shabalin2013-08-147-7/+43
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Change toolbox parsing to use `parseStats` parser entry point instead of current code-wrappign technique that makes positions much less useful to end users. There is also no need to create a compiler `Run` for parsing.
| * | | refactor repl to use new new parser entry pointDen Shabalin2013-08-146-42/+36
| | | | | | | | | | | | | | | | | | | | | | | | This commit refactors repl to use `parseStats` entry point and streamlines hacky error handling that was previously used to encode errors that happen during parsing.
| * | | refactor parser entry points and extract a few methods outDen Shabalin2013-08-143-32/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains three logical changes: 1. Split `templateStatSeq` into two methods as we need more reliable parsing of template body alone for new `parseStats` entry point. 2. Add new parser entry point called `parseStats` which is aimed towards use in tools that require parsing of Scala code that can be written inside of a template. Such functionality is required for parsing lines in repl, parsing code through toolbox, parsing and running scala scripts and lastly for quasiquotes. All of them are refactored to use this very method in the next commits. A new method called `templateStatsCompat` is also added to make this commit pass the tests but it's a temporary hack that will be removed in next commit in favor of `parseStats`. 3. Extract out a few methods like `isCaseDefStart`, `expectedMsgTemplate` and `parseRule`. These are needed to override parser behaviour in updated quasiquotes parser (see next commits).
| * | | SI-7731 make CannotHaveAttrs more consistentDen Shabalin2013-08-142-4/+76
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously setPos, pos_=, setType, tpe_= all behaved inconsistently between each other even though they all represent similar attributes that cannot be changed on CannotHaveAttrs trees. In order to simplify handling of such trees in compiler code each of these fields now supports assignment to its current default value: NoType for tpe and NoPosition for pos. Such assignments don't mutate underlying trees.
| * | | add assertThrows testing utility functionDen Shabalin2013-08-142-0/+44
| |/ / | | | | | | | | | This is much easier to use than built-in JUnit method-level checks.
* | | Merge pull request #2823 from som-snytt/issue/7715Adriaan Moors2013-08-166-42/+125
|\ \ \ | | | | | | | | SI-7715 String inpatternation s"$_" for s"${_}"
| * | | SI-7715 String inpatternation s"$_" for s"${_}"Som Snytt2013-08-126-42/+125
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In a pattern, ``` scala> implicit class RX(val sc: StringContext) { | def rx = sc.parts.mkString("(.+)").r } defined class RX scala> "2 by 4" match { case rx"$a by $_" => a } res0: String = 2 scala> val rx"$_ by $b" = "2 by 4" b: String = 4 ```
* | | | Merge pull request #2821 from xeno-by/topic/fundep-materializationAdriaan Moors2013-08-168-14/+160
|\ \ \ \ | | | | | | | | | | SI-7470 implements fundep materialization
| * | | | SI-7470 implements fundep materializationEugene Burmako2013-08-138-14/+160
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This fix provides implicit macros with an ability to affect type inference in a more or less sane manner. That's crucial for materialization of multi-parametric type class instances (e.g. Iso's from shapeless). Details of the technique can be found in comments.