summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
...
* | | Update description of explicitouter phase.Jason Zaugg2013-10-241-1/+1
| | | | | | | | | | | | Patern translation now happens earlier.
* | | Merge pull request #3057 from xeno-by/topic/fancy-java-classesJason Zaugg2013-10-233-0/+37
|\ \ \ | | | | | | | | fixes handling of fancy nested classes in runtime reflection
| * | | fixes handling of fancy nested classes in runtime reflectionEugene Burmako2013-10-193-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replaces the `jclazz.isMemberClass` check for whether we have an inner/nested class with `jclazz.getEnclosingClass != null`, because there exist classes produced by javac (see the attached jar file and the test log) which have the following properties: * They are nested within a parent class * getEnclosingClass returns a non-null value * isMemberClass returns false Previously such classes were incorrectly treated as non-nested, were incorrectly put into an enclosing package rather than an enclosing class, and had their names trimmed in the process, leading to situations when a package has multiple declarations with the same name. This is now fixed. When changing the check, we need to be careful with interpretation of what Class.getEnclosingXXX methods return. If getEnclosingClass produces a non-null result, this doesn't mean that the class is inner or nested, because getEnclosingClass is also not null for local classes (the ones with getEnclosingMethod != null || getEnclosingConstructor != null). This is expressed in the order of pattern match clauses in `sOwner`. Now when the bug is fixed, I also revert b18a2f8798b2, restoring a very important integrity check in runtime reflection, which I had to disable a couple hours ago to fix a master breakage. More details at scala-internals: https://groups.google.com/forum/#!topic/scala-internals/hcnUFk75MgQ
* | | | temporarily disables run/reflection-sync-subtypesEugene Burmako2013-10-232-20/+0
| | | | | | | | | | | | | | | | | | | | | | | | This test has been a source of spurious failures as in, for example https://github.com/scala/scala/pull/3029#issuecomment-26811129, so I'm disabling it for the time being while I investigate the issue.
* | | | Merge pull request #3047 from xeno-by/topic/deprecateEugene Burmako2013-10-2235-85/+103
|\ \ \ \ | | | | | | | | | | deprecates raw tree manipulation facilities in macros.Context
| * | | | changes some manual tree constructions in macro tests to quasiquotesEugene Burmako2013-10-1816-46/+41
| | | | |
| * | | | deprecates raw tree manipulation facilities in macros.ContextEugene Burmako2013-10-1831-65/+88
| | | | |
* | | | | Platform independence for SI-6240 test caseJason Zaugg2013-10-202-4/+4
| | | | | | | | | | | | | | | | | | | | File.pathSeparator, rather than ":"
* | | | | hotfix for reflection tests on WindowsEugene Burmako2013-10-202-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Removes the Unix-specific command-line sanity check put in place in recently committed reflection tests. On Windows, something like `C:\Java\jdk1.6.0_24-x64\jre\bin\java` might be a valid command (pointing to `java.exe` or `java.bat`) even if the eponymous file does not exist.
* | | | | Merge pull request #3007 from densh/pull/fresh-name-and-package-supportEugene Burmako2013-10-193-1/+18
|\ \ \ \ \ | |_|/ / / |/| | | | Add support for packages into quasiquotes and toolbox, improve handling of fresh names, unhardcode quasiquote expansion logic
| * | | | use concurrent hash map with atomic integersDen Shabalin2013-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | This should ensure that concurrent access to the fresh name creator is properly synchronized.
| * | | | SI-6841 SI-6657 add support for packages into quasiquotes and toolboxDen Shabalin2013-10-142-0/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to implement this a new parser entry point `parseStatsOrPackages` that augments current parseStats with ability to parse "package name { ... }" syntax.
* | | | | pull request feedbackEugene Burmako2013-10-184-2002/+3
| | | | | | | | | | | | | | | | | | | | https://github.com/scala/scala/pull/3029
* | | | | runtime reflection: death from thousand threadsEugene Burmako2013-10-184-0/+2051
| | | | | | | | | | | | | | | | | | | | not anymore
* | | | | SI-7045 reflection now auto-initializes selfTypeEugene Burmako2013-10-182-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | selfType joins the happy family of flags, annotations and privateWithin, which automatically trigger initialization, when used within runtime reflection.
* | | | | optimizes Scala reflection GILEugene Burmako2013-10-181-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | First of all, GIL should only apply to runtime reflection, because noone is going to run toolboxes in multiple threads: a) that's impossible, b/c the compiler isn't thread safe, b) ToolBox api prevents that. Secondly, the only things in symbols which require synchronization are: 1) info/validTo (completers aren't thread-safe), 2) rawInfo and its dependencies (it shares a mutable field with info) 3) non-trivial caches like in typeAsMemberOfLock If you think about it, other things like sourceModule or associatedFile don't need synchronization, because they are either set up when a symbol is created or cloned or when it's completed. The former is obviously safe, while the latter is safe as well, because before acquiring init-dependent state of symbols, the compiler calls `initialize`, which is synchronized. We can say that symbols can be in four possible states: 1) being created, 2) created, but not yet initialized, 3) initializing, 4) initialized. Of those only #3 is dangerous and needs protection, which is what this commit does.
* | | | | tests for fancy classloader configurationsEugene Burmako2013-10-189-0/+137
| | | | |
* | | | | eagerly initializes lazy vals and objects in runtime reflectionJason Zaugg2013-10-181-0/+82
| |/ / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code to do so is curated with the help of a generator. Because this needs to inspect code post-typer, the code generator is run during partest as a code-validator. We could concievably do the same with a macro, but this approach might be a better starting point which macros continue to stabilize. Removes Definitions.AnyRefModule and an already deprecated alias, as these have been throwing exceptions for more than a year since 6bb5975289. They used to be used by AnyRef specialization.
* | | | 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.