summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* SI-7501 Pickler: owner adjustment for param syms in annotation argsJason Zaugg2013-08-173-0/+24
| | | | | | | | | | | | | | | | Pickling of trees within annotation arguments led to an unfortunate situation: the MethodType of a symbol contained a value parameter symbol that was pickled as though it were owned by the enclosing class (the root symbol of the pickle.) Under separate compilation, this would appear as a member of that class. Anyone using `@deprecatedName('oldName)` was exposed to this problem, as the argument expands to `Symbol.apply("oldName")`. This commit extends some similar treatment of local type parameters to also consider value parameters.
* Merge pull request #2843 from xeno-by/topic/kill-introduce-top-levelAdriaan Moors2013-08-1618-180/+0
|\ | | | | kills introduceTopLevel
| * kills introduceTopLevelEugene Burmako2013-08-1618-180/+0
| | | | | | | | | | | | | | | | | | | | | | 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-162-0/+40
|\ \ | | | | | | 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-162-0/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #2830 from densh/topic/stats-parsing-2Adriaan Moors2013-08-169-6/+87
|\ \ \ | | | | | | | | updated SI-7331, SI-6843, SI-7731, parser entry point refactoring, assertThrows utility function
| * | | SI-6843 well-positioned syntax errors for quasiquotesDen Shabalin2013-08-143-6/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-146-0/+40
| |/ / | | | | | | | | | | | | | | | | | | | | | 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.
* | | Merge pull request #2823 from som-snytt/issue/7715Adriaan Moors2013-08-164-0/+58
|\ \ \ | | | | | | | | SI-7715 String inpatternation s"$_" for s"${_}"
| * | | SI-7715 String inpatternation s"$_" for s"${_}"Som Snytt2013-08-124-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-167-2/+108
|\ \ \ \ | | | | | | | | | | SI-7470 implements fundep materialization
| * | | | SI-7470 implements fundep materializationEugene Burmako2013-08-137-2/+108
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | | | Merge pull request #2798 from som-snytt/issue/7544-errmsgAdriaan Moors2013-08-166-11/+7
|\ \ \ \ | |_|_|/ |/| | | SI-7544 Interpolation message for %% literal
| * | | StringContext#checkLengths reports bad args countSom Snytt2013-08-061-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Since interpolator args are of type Any, it's easy to write s(args) instead of s(args: _*). I wonder if Xlint would have warned me about that.
| * | | In tests, interpolation is no longer -Xperimental.Som Snytt2013-08-064-4/+0
| | | |
| * | | SI-7544 Interpolation message for %% literalSom Snytt2013-08-061-5/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new error text: "conversions must follow a splice; use %% for literal %, %n for newline". The error is emitted when % is not at the start of a part; only the non-conversions %% and %n are allowed. It would be nice if it were convenient to parse the part to see what the user may have intended, but c'est l'erreur.
* | | Merge pull request #2831 from soc/SI-7624Grzegorz Kossakowski2013-08-1520-52/+52
|\ \ \ | | | | | | | | SI-7624 Fix -feature and some -Xlint warnings
| * | | Whitespace fixes in scala/tools/scalapSimon Ochsenreither2013-08-1520-52/+52
| | |/ | |/|
* | | Merge pull request #2791 from som-snytt/issue/7265-2.11Adriaan Moors2013-08-141-27/+0
|\ \ \ | |/ / |/| | SI-7265 javaSpecVersion, adjust isJava... tests for 2.11
| * | SI-7265 javaSpecVersion, adjust isJava... testsSom Snytt2013-08-011-27/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make this and related properties public, because they are useful. This change ought to have been committed at 2.11 and then backported with restrictions, rather than vice-versa. Note that they are defined in the order, version, vendor and name, which is the order from the underlying javadoc. It would be a neat feature of the PR validator, as previously imagined, to run a "pending" test and then, on success and merge, to move it automatically to the canonical suite.
* | | Merge pull request #2804 from adriaanm/rebase-2763Adriaan Moors2013-08-121-0/+17
|\ \ \ | | | | | | | | SI-7690 ghost error message fails compile [Rebase of #2763]
| * | | SI-7690 ghost error message fails compilePaul Phillips2013-08-111-0/+17
| | |/ | |/| | | | | | | | | | | | | I won't even try to explain the error reporting code, because it would have no basis in reality. However this change appears to fix the symptom reported.
* | | Merge pull request #2807 from som-snytt/issue/partest-dirAdriaan Moors2013-08-123-8/+5
|\ \ \ | | | | | | | | SI-7729 Does Par-Test work? Absolutely!
| * | | Par-Test split checks work againSom Snytt2013-08-083-8/+5
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check files split into conditional blocks with partest flags have been broken since the new diff regime. For some reason, no one noticed. The clever scheme to "filter the diff" instead of just filtering the check file is abandoned as futile and unnecessary. Fix java6 checkfile for ifdiff fix.
* | | Merge pull request #2764 from folone/masterGrzegorz Kossakowski2013-08-121-0/+59
|\ \ \ | | | | | | | | Making map2Conserve occupy constant stack space in spirit of SI-2411.
| * | | Make map2Conserve occupy constant stack space in spirit of SI-2411George Leontiev2013-08-081-0/+59
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I recently discovered a StackOverflowError, caused by this function: https://gist.github.com/folone/7b2f2e2a16314ab28109 The circumstances are pretty extreme, still having a tail-recursive function seems to be a good idea. The function behaves the same way old function did (supported by tests), which is not really how map2 behaves. I did not change this behavior to not introduce any regression. I actually tried to make it behave like map2, and it does introduce regression.
* | | Merge pull request #2812 from xeno-by/topic/defdef-name-now-termnameGrzegorz Kossakowski2013-08-121-1/+1
|\ \ \ | | | | | | | | DefDef.name is now TermName again
| * | | DefDef.name is now TermName againEugene Burmako2013-08-101-1/+1
| |/ / | | | | | | | | | | | | Now when there's no hope left for type macros, it's reasonable to provide a more specific type for DefDef.name.
* | | Merge pull request #2797 from paulp/pr/erasure-n-squaredGrzegorz Kossakowski2013-08-121-0/+35
|\ \ \ | |/ / |/| | Fix N^2 spot in erasure.
| * | Fix N^2 spot in erasure.Paul Phillips2013-08-051-0/+35
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | An expression containing nested casts would type the same tree 2^N times where N is the number of nested casts. This was particularly visible in Vector.scala where one can find a six-cast expression. It's currently line "why was six afraid of seven", aka line 789. display5((index >> 25) & 31) .asInstanceOf[Array[AnyRef]]((index >> 20) & 31) .asInstanceOf[Array[AnyRef]]((index >> 15) & 31) .asInstanceOf[Array[AnyRef]]((index >> 10) & 31) .asInstanceOf[Array[AnyRef]]((index >> 5) & 31) .asInstanceOf[Array[AnyRef]](index & 31) .asInstanceOf[T] Compiling Vector.scala, before/after. < #unique types : 10805 > #unique types : 9722 < #created tree nodes : 26716 > #created tree nodes : 25647 I found a similar bug about a year ago in 39f01d4f48. It's interesting to consider how little defense we have against bugs of this nature - visually non-obvious differences in tree traversal can have spectacular impact on complexity.
* | Merge pull request #2776 from gkossakowski/symbolTable-refactoringsGrzegorz Kossakowski2013-08-061-4/+0
|\ \ | |/ |/| Refactor the cake so SymbolTable does not depend on Global
| * Remove dependency on typer phase in ClassfileParser.Grzegorz Kossakowski2013-07-271-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ClassfileParser depends on forcing infos during typer phase. It's not entirely clear why this is needed (git blame doesn't help much) but I decided to preserve the logic. Therefore, I introduced an abstract method called `lookupMemberAtTyperPhaseIfPossible` which preserves the original semantics but is implemented outside of ClassfileParser so the ClassfileParser itself doesn't need to depend on typer phase and phase mutation utilities. I removed `loaders` override in `test/files/presentation/doc`. I would have to update it to implement the `lookupMemberAtTyperPhaseIfPossible` method. However, the override doesn't seem to be doing anything useful so I just removed it.
* | Merge remote-tracking branch 'scala/master' into merge-2.10.xGrzegorz Kossakowski2013-07-2920-42/+49
|\ \
| * \ Merge pull request #2746 from soc/topic/paulp-typer-debug-outputAdriaan Moors2013-07-2919-40/+47
| |\ \ | | | | | | | | Improve type printing (toString/debugging)
| | * | Make -Ytyper-debug output readable.Paul Phillips2013-07-1717-34/+36
| | | |
| | * | Cleanups in type printing.Paul Phillips2013-07-174-6/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | More consistency as to how to understand aliases, singletons, specialized symbols, subclasses. Fewer weird special casings, like normalizing tuples and functions during type printing, but nothing else. I avoid "normalize" entirely now, and do not make special cases for dealiasing, which is already well handled when printing error messages. Look at the change to test/files/neg/t2641.check to get a sense of why we should resist calling normalize during the early days of a compilation run. Anonymous and refinement classes can be printed far more usefully by revealing their parents, and that too is here. Hardened toString against undesirable side effects. Make toString final to discourage any further rogue toString overriders. Make safeToString a little safer.
* | | | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-07-2921-18/+248
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/reify/phases/Reshape.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/transform/Mixin.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/StdAttachments.scala test/files/neg/macro-override-macro-overrides-abstract-method-b.check test/files/run/t7569.check
| * | | Rename t7636-neg.check to the standard t7636.check.Adriaan Moors2013-07-291-0/+0
| | | | | | | | | | | | | | | | Not sure which partest bug allowed this, but the old name was wrong.
| * | | Merge pull request #2750 from retronym/ticket/7455-2.10.xGrzegorz Kossakowski2013-07-273-0/+65
| |\ \ \ | | | | | | | | | | SI-7455 Drop dummy param for synthetic access constructor
| | * | | SI-7455 Drop dummy param for synthetic access constructorJason Zaugg2013-07-283-0/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Java synthesizes public constructors in private classes to allow access from inner classes. The signature of that synthetic constructor (known as a "access constructor") has a dummy parameter appended to avoid overloading clashes. javac chooses the type "Enclosing$1" for the dummy parameter (called the "access constructor tag") which is either an existing anonymous class or a synthesized class for this purpose. In OpenJDK, this transformation is performed in: langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java (Incidentally, scalac would just emits a byte-code public constructor in this situation, rather than a private constructor / access constructor pair.) Scala parses the signature of the access contructor, and drops the $outer parameter, but retains the dummy parameter. This causes havoc when it tries to parse the bytecode for that anonymous class; the class file parser doesn't have the enclosing type parameters of Vector in scope and crash ensues. In any case, we shouldn't allow user code to see that constructor; it should only be called from within its own compilation unit. This commit drops the dummy parameter from access constructor signatures in class file parsing.
| * | | | Merge pull request #2738 from retronym/ticket/7636Grzegorz Kossakowski2013-07-272-0/+17
| |\ \ \ \ | | | | | | | | | | | | SI-7636 Fix a NPE in typing class constructors
| | * | | | SI-7636 Fix a NPE in typing class constructorsChristopher Vogt2013-07-162-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we encountered an erroneous super call due to a failure in parent type argument inference, we must avoid inspecting the untyped children of erroneous trees.
| * | | | | [backport] SI-7569 Fix end position in PostfixSelect treeFrançois Garillot2013-07-242-0/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | introduced in 5b54681: the end position of Postfix operators should take the operator length into account. review by @som-snytt
| * | | | | SI-7657 clarifies the "macro overrides method" ruleEugene Burmako2013-07-146-18/+38
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently we allow macros to override non-abstract methods (in order to provide performance enhancements such as foreach for collections), and we also disallow macros to override abstract methods (otherwise downcasting might lead to AbstractMethodErrors). This patch fixes an oversight in the disallowing rule that prohibited macros from overriding a concrete method if that concrete method itself overrides an abstract method. RefCheck entertains all overriding pairs, not only the immediate ones, so the disallowing rule was triggered. Now macros can override abstract methods if and only if either the base type or the self type contain a matching non-abstract method.
| * | | | Merge pull request #2674 from richdougherty/2.10.x-si7336-try2Adriaan Moors2013-07-121-0/+31
| |\ \ \ \ | | | | | | | | | | | | SI-7336 Link flatMapped promises to avoid memory leaks
| | * | | | SI-7336 - Link flatMapped promises to avoid memory leaksRich Dougherty2013-07-061-0/+31
| | |/ / /