summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
...
* | | | | Merge pull request #2978 from som-snytt/issue/7848-forgotten-interp-msg-lgtmPaul Phillips2013-09-2710-28/+73
|\ \ \ \ \ | | | | | | | | | | | | SI-7848 Xlint no warn on $sym with params
| * | | | | SI-7848 Xlint no warn on $sym with paramsSom Snytt2013-09-2310-28/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This idea brought to you by retronym. Also improve implicitNotFound detection at typer; and avoid checking the standard interpolation expression for cases like s"some $$x". Some minor refactorings of implicitNotFound strings. The intersobralator allows extra spaces, i.e., trims.
* | | | | | Merge pull request #2996 from paulp/pr/3971Jason Zaugg2013-09-272-0/+33
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-3971 error message carat mispoints at curried methods.
| * | | | | | SI-3971 error message carat mispoints at curried methods.Paul Phillips2013-09-272-0/+33
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Point at the beginning of the first argument list when reporting an error, as this is most easily associated with the application taking place (which may involve multiple applies in succession.) Thanks to retronym for figuring out why issuing a better error message broke the compiler on non-erroneous compile runs. The changes to "treesInResult" are the consequence.
* | | | | | Merge pull request #2998 from paulp/pr/6120Paul Phillips2013-09-2717-11/+112
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6120 multiple warnings at same position.
| * | | | | | SI-6120 multiple warnings at same position.Paul Phillips2013-09-2717-11/+112
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | An error suppresses all further warnings at the same position, but multiple warnings can be heard.
* | | | | | Merge pull request #2987 from paulp/pr/emptySelfTypePaul Phillips2013-09-275-5/+7
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-6762 rename emptyValDef to emptySelfType.
| * | | | | | SI-6762 rename emptyValDef to noSelfType.Paul Phillips2013-09-275-5/+7
| |/ / / / / | | | | | | | | | | | | | | | | | | | | | | | | Looks like emptyValDef.isEmpty was already changed to return false, so now all that's left is a name which means something.
* | | | | | Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-master-2Jason Zaugg2013-09-275-4/+133
|\ \ \ \ \ \ | |/ / / / / |/| | | / / | | |_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf build.xml src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/library/scala/concurrent/Future.scala src/reflect/scala/reflect/internal/Types.scala
| * | | | Merge remote-tracking branch 'origin/2.10.3' into merge/2.10.3-to-2.10.xJason Zaugg2013-09-242-0/+67
| |\ \ \ \ | | |_|_|/ | |/| | |
| | * | | SI-7861 Don't execute internal callbacks on the user ExecutorJason Zaugg2013-09-212-0/+67
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callbacks internal to the implementation of Futures should be executed with the `InternalCallbackExecutor`, rather than the user supplied `Executor`. In a refactoring da54f34a6, `recoverWith` and `flatMap` no longer played by these rules. This was noticed by a persnickety test in Play. Before this patch, the enclosed test outputs: % scala-hash v2.10.3-RC2 test/files/run/future-flatmap-exec-count.scala mapping execute() flatmapping execute() execute() recovering execute() execute()
| * | | | Merge pull request #2919 from retronym/ticket/7815Jason Zaugg2013-09-231-0/+30
| |\ \ \ \ | | |/ / / | |/| | | SI-7815 Dealias before deeming method type as dependent
| | * | | SI-7815 Dealias before deeming method type as dependentJason Zaugg2013-09-071-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To enable eta-expansion of method types seen from a prefix that renders the result type as independent from the parameter symbols. The enclosed test shows that we dealias types before checking dependence, and that we do this deeply (e.g. type arguments are also dealised.) An existing test, neg/error_dependentMethodTpeConversionToFunction, confirms that bona-fide dependent methods are still prohibited from eta expansion.
| * | | | Merge pull request #2923 from retronym/ticket/7825Grzegorz Kossakowski2013-09-112-4/+36
| |\ \ \ \ | | | | | | | | | | | | SI-7825 Consider DEFAULTMETHOD when refchecking concreteness
| | * | | | SI-7398 Enable test for Java 8 source parser under Java 8Jason Zaugg2013-09-101-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is no need to skip it as it only depends on our changes to our JavaParser, and not on any bytecode features of Java 8.
| | * | | | SI-7825 Consider DEFAULTMETHOD when refchecking concretenessJason Zaugg2013-09-101-0/+34
| | |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A class should not be required to implement a Java default method. This commit uses `isDeferredNotDefault` in place of `isDeferred` when finding unimplemented methods. The test itself does not depend on Java 8 as we use scalac's Java source parser to set things up.
* | | | | Merge pull request #2979 from retronym/ticket/7870Jason Zaugg2013-09-262-0/+7
|\ \ \ \ \ | | | | | | | | | | | | SI-7870 Detect default getter clashes in constructors
| * | | | | SI-7870 Detect default getter clashes in constructorsJason Zaugg2013-09-232-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Default getters for constructors live in the companion module. These eluded the check for clashes in default getter names due to overloading, which aims to give a more user friendly error than "double definition: meth$default$1". This commit checks for default getters in the companion module, in addition to those in the template itself.
* | | | | | SI-7876 Scaladoc crasher due to regression in isFunctionType.Jason Zaugg2013-09-261-0/+26
| |_|_|_|/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `isFunctionType` and `isTupleType` started returing true for type constructors as of aeb73314. This led to a crash in type printing in ScalaDoc (specfically, in ModelFactoryTypeSupport.scala) This commit: - fixes those methods by guarding with !isHigherKinded - unit tests said methods - tests the reported crasher with a ScalaDoc test.
* | | | | Merge pull request #2982 from retronym/topic/checkinitAdriaan Moors2013-09-242-0/+8
|\ \ \ \ \ | | | | | | | | | | | | SI-4742 Make -Xcheckinit aware of constants.
| * | | | | SI-4742 Make -Xcheckinit aware of constants.Jason Zaugg2013-09-242-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Members defined as `final val x = <literal>` are given a ConstantType. The constant is folded into the accessor method `x`, and the field itself is never initialized. (Related discussion: SI-4605) As such, -Xcheckinit spuriously warns when calling that accessor. This commit disables the checks for constants. This will also fix the checkinit build (failure tracked as SI-7839), which is the victim of this a spurious scolding.
* | | | | | Merge pull request #2980 from huitseeker/revert-2957Jason Zaugg2013-09-2455-244/+177
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Revert #2957
| * | | | | Add position check for regression introduced by #2957François Garillot2013-09-242-0/+56
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The starting bound for ValDefs in #2957 is distinct from the expected result, e.g. [4:9]val x = [8:9]0 instead of [0:9]val x = [8:9]0
| * | | | | Revert "Merge pull request #2957 from paulp/pr/parser-improvements"François Garillot2013-09-2453-244/+121
| | |_|_|/ | |/| | | | | | | | | | | | | | | | | | This reverts commit 884e1ce762d98b29594146d37b85384581d9ba96, reversing changes made to f6fcc4431f272c707d49de68add532c452dd4b0f.
* | | | | Merge pull request #2975 from retronym/ticket/7868Jason Zaugg2013-09-233-0/+30
|\ \ \ \ \ | |/ / / / |/| | | | SI-7868 Account for numeric widening in match translation
| * | | | SI-7868 Account for numeric widening in match translationJason Zaugg2013-09-233-0/+30
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pattern match translation was unprepared for trees of the shape: (0: Short) match { case A.unapply(<unapply-selector>.toInt) <unapply> (_) => () case _ => () } While a scrutinee is inelibigle for implicit views in order to conform to the type of the extractor call, it is allowed to weakly conform. In this case, the typechecker will add the numeric widening with a `toInt` call. This commit: - Changes treeInfo.Unapplied to recognize this tree shape - Changes spliceApply to recognize and preserve the widening when substituting the unapply selector with the binder - Tests reification of such pattern matches, which also depends on treeInfo.Unapplied.
* | | | Merge pull request #2956 from som-snytt/issue/7848-forgotten-interp-msgJason Zaugg2013-09-235-3/+73
|\ \ \ \ | | | | | | | | | | SI-7848 Xlint says what looks interpolated
| * | | | SI-7848 Xlint no warn on $sym with paramsSom Snytt2013-09-182-1/+48
| | | | | | | | | | | | | | | | | | | | This idea brought to you by retronym.
| * | | | SI-7855 No missing interpolator warning post-typerSom Snytt2013-09-181-4/+1
| | | | | | | | | | | | | | | | | | | | Avoid extra work, extra warnings.
| * | | | SI-7848 Xlint says what looks interpolatedSom Snytt2013-09-174-2/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The motivating use case was an Expecty debug string getting flagged for `$eq`. The test case demonstrates a different bug, in which the position of the literal tree is changed when typer gets rid of the unused local, so that when the tree is re-typed in erasure, a second, spurious warning is emitted at the start of the method. Specifically, the second warning is not suppressed because of the different position.
* | | | | Merge pull request #2962 from densh/topic/syntactic-assignJason Zaugg2013-09-233-1/+45
|\ \ \ \ \ | | | | | | | | | | | | Quasiquotes: add syntactic extractor for assignment-like trees
| * | | | | add syntactic extractor for assignment-like treesDen Shabalin2013-09-183-1/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There are three kinds of assign-like trees: 1. Assign(lhs, rhs) // $lhs = $rhs 3. AssignOrNamedArg(lhs, rhs) // $lhs = $rhs 2. Apply(Select(f, nme.update), args :+ rhs) // $f(..$args) = $rhs New syntactic combinator unifies all of them and lets users not to think about these implementations details.
* | | | | | Merge pull request #2974 from retronym/ticket/7864Jason Zaugg2013-09-232-0/+6
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-7864 Harden "looks like an interpolated String" warning
| * | | | | | SI-7864 Harden "looks like an interpolated String" warningJason Zaugg2013-09-222-0/+6
| | |_|/ / / | |/| | | | | | | | | | | | | | | | | | | | | | We can't rely on the qualifier of an `Apply` having a non-null symbol in general.
* | | | | | Merge pull request #2954 from retronym/ticket/7852Jason Zaugg2013-09-233-0/+40
|\ \ \ \ \ \ | |/ / / / / |/| | | | | Avoid null checks when emitting "".== and SomeModule.==
| * | | | | SI-7852 Refactor null-elision tests to be more focussedJason Zaugg2013-09-182-49/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Directly count null checks, rather than diffing the textual bytecode of the entire method - Add a test to show that the LHS needs to be a direct module reference, not just a tree with a module type, to elide the null check.
| * | | | | SI-7852 Omit null check for SomeModule.==Jason Zaugg2013-09-181-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | For the same reasons outlined in the previous commits.
| * | | | | SI-7852 Test to show status quo of for SomeModule.==Jason Zaugg2013-09-172-7/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | For which we can also elide the null check, and will in the next commit.
| * | | | | SI-7852 Omit null check for "".==Jason Zaugg2013-09-171-17/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Although the same the code would be later optimized by -Yconst-opt, we can offer the same lean byte code to those compiling without that option by being more discerning when translating ==. This helps people using bytecode based code coverage tools such as jacoco that would emit "branch not covered" warnings for the impossible null check.
| * | | | | SI-7852 Test to show the status quo bytecode for "" == ...Jason Zaugg2013-09-173-0/+51
| | |/ / / | |/| | | | | | | | | | | | | Will be somewhat leaner after the next commit.
* | | | | add test case for SI-6719Den Shabalin2013-09-202-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug itself was fixed earlier in 95fe19545d60ae9aa79d2c8d5665c7f3b0cbdb1a It was caused by improper wrapping of blocks in the toolbox's parse method.
* | | | | SI-7854, SI-6768 better parsing/positioning in parserPaul Phillips2013-09-1847-111/+181
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The parser hole I found while working on the generated positions serves as the umbrella for a host of improvements. Upgraded positions assigned during some specific challenging situations mostly involving the creation of synthetic trees, e.g. for comprehensions and closures. While doing so improved some error messages. Eliminated some of the most glaring duplication in the parser. It's written like there is some payoff associated with being spectacularly imperative. Not so far.
* | | | | Position#show prints the point.Paul Phillips2013-09-1812-34/+87
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Can't ensure range position points are meaningful when we never see them. To limit noise, only print the point when it != start. [x:y] // point=x, start=x, end=y [p/x:y] // point=p, start=x, end=y I'm open to a different syntax. Also prints NoPosition as [X] rather than [NoPosition] because noise is for construction workers and attenders of rock concerts. Some range position and parser tests are included so we can see the checkfile change when the forthcoming fix happens (either an error message improvement or a positional one.)
* | | | | Merge pull request #2961 from paulp/pr/whitespaceJason Zaugg2013-09-18964-3659/+3453
|\ \ \ \ \ | |_|/ / / |/| | | | Cull extraneous whitespace.
| * | | | Cull extraneous whitespace.Paul Phillips2013-09-18964-3659/+3453
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* | | | | Merge pull request #2955 from retronym/ticket/7853Paul Phillips2013-09-184-2/+52
|\ \ \ \ \ | |/ / / / |/| | | | SI-7853 Regression in explicit outer
| * | | | SI-7853 A less ad-hoc place to call memberTypeJason Zaugg2013-09-181-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Rather than localizing the fix to the outerAccessor, this commit pushed the call to `memberType` into *all* usages of `newValDef` and `newDefDef`. The TPT of `applyOrElse` in synthetized partial functions must be set explicitly to pass the pos/t7853-partial-function.scala. Otherwise, the as-seen-from ends up cloning the type parameter `B1` of `applyOrElse` as it transforms (questionably) its bound from `List[Int @unchecked]` to `List[Int]`. Partial Function synthesis was already a delicate area, and this makes things more explicit which could be counted as an improvement.
| * | | | SI-7853 An unsatisfying fix regression in explicit outerJason Zaugg2013-09-183-2/+45
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The attempt to placate pos/t4970.scala in 55c6fd4 roused another dragon. We've got two levers here: the type of the symbol of the outer accessor, and the type of its DefDef. They have been historically out of sync due to the vaguaries of finalResultType (which is far less vague since 671e6e03c7), but the finicky operation of ExplicitOuter now has a hard time when we try to bring them into line. This stuff is notoriously difficult to understand because the trees you see from `-Xprint` show a tpt derived from the method symbol's info, and discards the actual tpt in the tree. Rather than letting `DefDef(acc)` call `TypeTree(sym)` and use `sym.tpe_*.finalResultType`, this commit computes the member type of the accessor from the current class and explicitly uses that as the return type of the outer accessor def. We should try to push this a little deeper. I tried to put it into `def TypeTree`, but that broke, among others, run/concurrent-stream.scala. Maybe `def DefDef` and `def ValDef`? But a localised fix is the right start as it addresses the regression in a minimal fashion to get the IDE building again.
* | | | Longer timeout for repl test.Paul Phillips2013-09-171-1/+1
| | | | | | | | | | | | | | | | | | | | 15 seconds is crazy aggressive. I have fast hardware and it's still really easy for a test to take to fifteen seconds under load.
* | | | Merge pull request #2951 from retronym/ticket/7847Grzegorz Kossakowski2013-09-172-0/+15
|\ \ \ \ | |/ / / |/| | | SI-7847 Static forwarders for case apply/unapply