summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* deprecates raw tree manipulation facilities in macros.ContextEugene Burmako2013-10-1831-65/+88
|
* Merge pull request #3030 from xeno-by/topic/fundep-viewsEugene Burmako2013-10-1816-0/+175
|\ | | | | SI-3346 implicit parameters can now guide implicit view inference
| * SI-3346 implicit parameters can now guide implicit view inferenceEugene Burmako2013-10-1116-0/+175
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This simple patch makes it possible for implicit views to benefit from fundep-guided type inference, eliminating a nasty special case in implicit inference. Here are the changes that I had to apply to the tests (they exposed quite a number of interesting questions that I was happy to answer): 1) neg/t5845.scala now works, so I moved it to pos. That easily makes sense, because the test was just a canary to track previous state of things. 2) neg/divergent_implicit.scala, neg/t5578.scala and neg/t7519.scala changed their messages to less informative ones, because inapplicable implicit views now get disqualified early and therefore don't display their error messages to the user. This is an unfortunate but necessary byproduct of this change, and one can argue that the behavior is now completely consistent with implicit vals (that also don't explain why this or that implicit val got disqualified, but rather display a generic implicit value not found message). 3) scaladoc/implicits-chaining.scala and scaladoc/implicits-base.scala. Immediate culling of apriori inapplicable implicit views messes things up for Scaladoc, because it's interested in potentially applicable views, having infrastructure to track various constraints (type bounds, requirements for implicit parameters, etc) that guide applicability of views and then present it to the user. Therefore, when scaladoc is detected, implicit search reverts to the old behavior. 4) We still cannot have Jason's workaround to type constructor inference mentioned in comments to SI-3346, because it's not really about implicit parameters of implicit views, but about type inference flowing from the implicit parameter list to a preceding parameter list in order to affect inference of an implicit view. This is something that's still too ambitious.
* | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-10-161-3/+0
|\ \ | | | | | | | | | | | | | | | Conflicts: build.number test/files/neg/classmanifests_new_deprecations.check
| * \ Merge pull request #2985 from retronym/ticket/7783Jason Zaugg2013-10-031-3/+0
| |\ \ | | | | | | | | Don't issue deprecation warnings for inferred TypeTrees
| | * | SI-7783 Don't issue deprecation warnings for inferred TypeTreesJason Zaugg2013-09-271-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Deprecation checks in RefChecks were looking into all TypeTrees to find references to deprecated type aliases. However, when the compiler infers a type argument or type of a member it creates a TypeTree (with a null original) that was also leading to warnings. I ran into this problem often when upgrading a build from SBT 0.12 to 0.13: a plugin I was using used the deprecated type alias, and I suffered transitively when I used methods from its API. This commit disables the checks for inferred TypeTree-s.
* | | | Merge pull request #3016 from xeno-by/topic/vampiresJason Zaugg2013-10-154-0/+61
|\ \ \ \ | | | | | | | | | | [master] assorted fixes for vampire macros
| * | | | no longer warns on calls to vampire macrosEugene Burmako2013-10-044-0/+61
| | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As eloquently elaborated and cleverly named by Travis Brown, macros defined in structural types are useful: http://meta.plasm.us/posts/2013/07/12/vampire-methods-for-structural-types/. However, since such macros are on the intersection of a number of language features, as usual, there are bugs. This commit fixes an unwanted interaction of macros defined in structural types with the scala.language.reflectiveCalls guard. Since macro calls aren't going to be carried to runtime, there's no need to warn about them.
* | | | Merge pull request #3037 from gkossakowski/fix-merge-3018v2.11.0-M6Grzegorz Kossakowski2013-10-143-1/+36
|\ \ \ \ | | | | | | | | | | [resubmit] Experimental Single Abstract Method support (sammy meets world)
| * \ \ \ Merge remote-tracking branch 'scala/master' into fix-merge-3018Grzegorz Kossakowski2013-10-146-0/+52
| |\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/typechecker/Typers.scala
| * | | | | Single Abstract Method support: java8 testAdriaan Moors2013-10-083-1/+36
| | |/ / / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inspired by test/files/run/t7398.scala and sammy_poly. Added some notes to original tests. Elaborating on that note: we don't yet desugar `f(a)` to `f.sam(a)`, like we do for regular functions: `f(a)` becomes `f.apply(a)`. It seems pleasingly symmetrical and is easy to implement, but not sure it's a good idea...
* | | | | Merge pull request #3038 from retronym/topic/by-name-revertGrzegorz Kossakowski2013-10-143-0/+26
|\ \ \ \ \ | |_|/ / / |/| | | | SI-7899 Allow by-name inference under -Yinfer-by-name
| * | | | SI-7899 Allow by-name inference under -Yinfer-by-nameJason Zaugg2013-10-143-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As usual, the hole has been exploited in the wild. While you can't abstract over by-name-ness without running into the ClassCastException or an un-applied Function0, there are cases like the enclosed test where you can tiptoe around those cases. I've proposed a small change to Scalaz to avoid tripping over this problem: https://github.com/scalaz/scalaz/pull/562/files But this commit I've also added a transitional flag, -Yinfer-by-name, that they could use to back-publish older versions without code changes. It is also an insurance policy for other projects that might be exploiting the same hole.
* | | | | Merge pull request #3024 from retronym/ticket/7895Paul Phillips2013-10-122-0/+15
|\ \ \ \ \ | |/ / / / |/| | | | SI-7895 Error reporting: avoid cascading, truncation
| * | | | SI-7985 Typecheck args after failure to typecheck functionJason Zaugg2013-10-092-0/+15
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `missing1.foo(missing2)` now reports `missing1` and `missing2` as not found. Previously, only the first was reported. The arguments are typed with an expected type ErrorType. We propagate this through as the inferred type of anonymous function parameters to avoid issuing cascading "missing parameter type" errors in code like: scala> Nil.mapp(x => abracadabra) <console>:8: error: value mapp is not a member of object Nil Nil.mapp(x => abracadabra) ^ <console>:8: error: not found: value abracadabra Nil.mapp(x => abracadabra) ^ This was in response to unwanted changes in the output of existing neg tests; no new test is added. Similarly, we refine the errors in neg/t6436b.scala by to avoid cascaded errors after: type mismatch; found: StringContext, required: ?{def q: ?}
* | | | Merge pull request #3020 from paulp/pr/overriding-pairsJason Zaugg2013-10-092-0/+18
|\ \ \ \ | | | | | | | | | | Generalize OverridingPairs to SymbolPairs.
| * | | | Generalize OverridingPairs to SymbolPairs.Paul Phillips2013-10-052-0/+18
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Increases your chance of knowing what is going on in OverridingPairs. Introduces some new abstractions which I hope for your own sakes you will put to use in some way: RelativeTo: operations relative to a prefix SymbolPair: two symbols being compared for something, and the enclosing class where the comparison is being performed Fixed a minor bug with access by accident by way of more principled pair analysis. See run/private-override.scala. Upgraded the error message issued on certain conflicts to give the line numbers of both conflicting methods, as opposed to just one and you go hunting.
* / / / SI-7899 Don't infer by-name types during, e.g. eta-expansionJason Zaugg2013-10-072-0/+19
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Given: def id[A](a: A): A = a def foo(f: (=> Int) => Int) = () foo(id) We eta-expanded `id` and inferred `A` to be `=> Int` to satisfy the expected type set forth by the formal parameter `f`. We really shouldn't go about inferring types that we can't *write*. Our attempt to do so led promptly into a `ClassCastException` in the enclosed test. This commit: - drops by-name-ness during `inferExprInstance` - tests that this results in a type error for the reported bug (neg/t7899) - tests that a method with a by-name parameter can still be eta expanded to match function with a corresponding by-name parameter (run/t7899) - discovers the same latent CCE in pos/t7584 - now that would be a type error - so we compensate by using placeholder functions rather than eta-expansion. - and move that that test to `run` for good measure.
* | | Merge pull request #3005 from paulp/pr/7886Paul Phillips2013-10-031-1/+1
|\ \ \ | | | | | | | | SI-7886 unsoundness in pattern matcher.
| * | | SI-6680 unsoundness in gadt typing.Paul Phillips2013-10-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduces -Xstrict-inference to deal with the significant gap between soundness and what presently compiles. I'm hopeful that it's TOO strict, because it finds e.g. 75 errors compiling immutable/IntMap.scala, but it might be that bad.
* | | | Merge pull request #3013 from retronym/topic/unspec-fix-windowsAdriaan Moors2013-10-031-1/+1
|\ \ \ \ | | | | | | | | | | Rework cff8b569 to heal the windows build.
| * | | | Rework cff8b569 to heal the windows build.Jason Zaugg2013-10-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - change newTermName to fix negative length names rather than reject them - restore the old logic in unspecializedName for names that result from AnyRef specialized type parameters. Why does fix the windows build? I remain none the wiser.
* | | | | Merge pull request #2965 from retronym/ticket/7859Grzegorz Kossakowski2013-10-032-0/+58
|\ \ \ \ \ | | | | | | | | | | | | SI-7859 Value classes may wrap a non-public member
| * | | | | SI-7859 Value classes may wrap a non-public memberJason Zaugg2013-09-292-0/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We allow value class constructors to be non-public, so to be regular, we should also allow the same for the param accessor. This commit uses the 'makeNotPrivate' machinery to ensure that the backend can generate the requisite unboxing calls. This commit: - refactors the code that enforced the restrictions, improving a few error messages and positions. The remaining restrictions needed some rewording in light of this change. - allows value classes to have non-public, val parameters. private[this] / protected[this] are still disallowed as value classes don't have a concept of `this`, and because trying to accomdate then would complicate the implementation. This means that `class C(x: Int) extends AnyVal` is not allowed, the user still must write `private val x: Int` or `val x: Int`. - Outlaw `class C()()(val x: Int) extends AnyVal` to curtail any bugs that might lurk in such a formulation. The tests: - Show that the privacy is respected in the typer phase, under joint and separate compilation. We don't want a repeat performance of SI-6601. - Show that code that needs compiler-generated unboxes works under both compilation scenarios - Checks that the remaining restrictions are enforced and well communicated.
* | | | | | macro bundles are now usable in replEugene Burmako2013-10-022-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the previous commits relaxed the top-level restriction for bundles, turning it into a requirement of staticness (i.e. bundles nested in static objects are also okay now). This means that we can now define bundles in repl. Almost. There's still a little problem remaining that arises from the fact that when compiling a line of input, repl doesn't automatically import all previously defined symbols, but rather uses an heuristic to scan the input and guess what symbols need to be imported. Unfortunately for bundles, this heuristic fails, because when scanning a macro definition that looks like `def foo = macro Macros.foo`, it thinks that it's only necessary to import a term symbol called Macros (a vanilla way of defining macro impls), but not a type symbol called Macros (a new way of writing macro impls in bundles). This commit fixes the problem by making the repl look for both term and type symbols corresponding to the identifiers used in macro definitions.
* | | | | | clearly establishes what macro bundles areEugene Burmako2013-10-028-3/+67
| |/ / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously it was enough to just extend scala.reflect.macros.Macro, which created some loopholes, but now scalac enforces that bundles: 1) Are static (not necessarily top-level, but just static) 2) Are traits (objects shouldn't be bundles anyway, and classes bring complications with their ctors which require special treatment in generated classes, so why support them if they don't bring anything new to the table?) 3) Are monomorphic (again, this brings unnecessary complications wrt auxiliary code generation, so I don't see merit in supporting polymorphic bundles, whatever that a polymorphic bundle could mean) 4) Don't provide concrete implementation for Macro.c (if they do then what is the point?)
* | | | | Removing unused code.Paul Phillips2013-10-022-8/+4
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | Most of this was revealed via -Xlint with a flag which assumes closed world. I can't see how to check the assumes-closed-world code in without it being an ordeal. I'll leave it in a branch in case anyone wants to finish the long slog to the merge.
* | | | Merge pull request #2991 from xeno-by/topic/unapply-copierEugene Burmako2013-09-303-0/+34
|\ \ \ \ | | | | | | | | | | transformers no longer ignore UnApply.fun
| * | | | transformers no longer ignore UnApply.funEugene Burmako2013-09-263-0/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Second time's the charm. I remember trying to do exactly the same somewhen around 2.10.0-M4, but then some continuations tests were failing. Luckily, today everything went smoothly. Please note that this fix changes the way that SI-5465 manifests itself. Previously it produced type errors, now it simply crashes the compiler. Therefore I had to attach the try/catch FatalError clause to invocations of toolbox methods, so that compiler crashes get caught and translated to ToolBoxErrors. Also fixes SI-7871, and that clears the way for implementing quasiquotes with conventional macros rather than relying on a special case in typer.
* | | | | Merge pull request #2998 from paulp/pr/6120Paul Phillips2013-09-272-0/+9
|\ \ \ \ \ | | | | | | | | | | | | SI-6120 multiple warnings at same position.
| * | | | | SI-6120 multiple warnings at same position.Paul Phillips2013-09-272-0/+9
| | |/ / / | |/| | | | | | | | | | | | | | | | | | 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-274-4/+103
|\ \ \ \ \ | |/ / / / |/| | / / | | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | 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
| * | | 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 #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.
* | | | 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-2410-56/+88
|\ \ \ \ | |/ / / |/| | | 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-248-56/+32
| | | | | | | | | | | | | | | | | | | | 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 #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.