summaryrefslogtreecommitdiff
path: root/test/files
Commit message (Collapse)AuthorAgeFilesLines
* SI-5314 - CPS transform of return statement failsphaller2012-08-0814-0/+197
| | | | | | | | | | | | | | | | | | | | | | | | | Enable return expressions in CPS code if they are in tail position. Note that tail returns are only removed in methods that do not call `shift` or `reset` (otherwise, an error is reported). Addresses the issues pointed out in a previous pull request: https://github.com/scala/scala/pull/720 - Addresses all issues mentioned here: https://github.com/scala/scala/pull/720#issuecomment-6429705 - Move transformation methods to SelectiveANFTransform.scala: https://github.com/scala/scala/pull/720#commitcomment-1477497 - Do not keep a list of tail returns. Tests: - continuations-neg/t5314-missing-result-type.scala - continuations-neg/t5314-type-error.scala - continuations-neg/t5314-npe.scala - continuations-neg/t5314-return-reset.scala - continuations-run/t5314.scala - continuations-run/t5314-2.scala - continuations-run/t5314-3.scala
* Merge pull request #1056 from heathermiller/try-based-futuresAdriaan Moors2012-08-086-227/+224
|\ | | | | Bases futures on Try instead of Either
| * Fix test for ExecutionContext.preparephaller2012-08-081-1/+1
| |
| * Doc fix on exec ctx prepare method, fix to testsHeather Miller2012-08-082-2/+3
| |
| * Added tests, removal of unnecessary methods, fixes prepareHeather Miller2012-08-072-6/+20
| |
| * Merge branch 'try-based-futures' of https://github.com/heathermiller/scala ↵Heather Miller2012-08-051-0/+61
| |\ | | | | | | | | | into try-based-futures
| | * SI-6185 - add "prepare" hook to ExecutionContextphaller2012-08-051-0/+61
| | | | | | | | | | | | | | | Enables important abstractions to be built on top of futures, such as Twitter's "Local" for handling data local to a callback chain.
| * | Temporarily skips failing test due to optimizer bug SI-6188Heather Miller2012-08-051-5/+5
| |/ | | | | | | Also swaps the arguments to method transform on Try, so as to mirror transform on scala.concurrent.Future.
| * Basing Futures on Try instead of EitherHeather Miller2012-08-046-227/+148
| |
* | Merge pull request #1079 from scalamacros/ticket/5947Adriaan Moors2012-08-0821-6/+570
|\ \ | | | | | | reflection now correctly supports inner classes and modules
| * | SI-5947 works around getDeclaredClassesEugene Burmako2012-08-0819-2/+568
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Our name mangling scheme w.r.t stuff nested into objects conflicts with JVM's ideas of beauty, which messes up getDeclaredClasses. Scala reflection needs getDeclaredClasses to convert between Scala and Java, so the situation looked grim. Greg suggested a workaround described in: https://issues.scala-lang.org/browse/SI-4023?focusedCommentId=54759#comment-54759. Luckily the workaround worked!
| * | SI-5498 completes ModuleMirror.instanceEugene Burmako2012-08-072-4/+2
| | | | | | | | | | | | | | | As per referenced issue, this patch implements `instance` for ModuleMirrors corresponding to nested and inner modules.
* | | Merge pull request #1075 from adriaanm/ticket-6040Adriaan Moors2012-08-086-0/+14
|\ \ \ | | | | | | | | SI-6040 error on unauthorized extension Dynamic
| * | | SI-6040 error on unauthorized extension DynamicAdriaan Moors2012-08-086-0/+14
| | | | | | | | | | | | | | | | authorization is easy to get: `import language.dynamics`
* | | | Merge pull request #1085 from gkossakowski/inline-in-constructorsAdriaan Moors2012-08-075-0/+39
|\ \ \ \ | | | | | | | | | | Enable inlining in constructors.
| * | | | Enable inlining in constructors.Grzegorz Kossakowski2012-08-075-0/+39
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Inlining in constructors has been disabled a long time ago due to some VerifyErrors. Unfortunately, @dragos cannot recall what exactly was the problem. I tried to enable inlining in constructors and I didn't see any problem. `Predef.assert` calls in class constructors are one of the biggest contributors to closure allocation in a compiler so we better off get rid of it. Added a test-case that checks if inlining in constructors works properly. Review by @magarciaEPFL and @paulp.
* | | | Merge pull request #1080 from scalamacros/ticket/6186Josh Suereth2012-08-0725-53/+53
|\ \ \ \ | | | | | | | | | | SI-6186 TypeTags no longer supported in macros
| * | | | SI-6186 TypeTags no longer supported in macrosEugene Burmako2012-08-0725-53/+53
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The original idea was to support both both TypeTags and ConcreteTypeTags as context bounds on macro implementations. Back then TypeTags were the implied default flavor of type tags. Basically because "TypeTag" is shorter than "ConcreteTypeTag" everyone jumped onto them and used them everywhere. That led to problems, because at that time TypeTags could reify unresolved type parameters ("unresolved" = not having TypeTag annotations for them). This led to a series of creepy errors, when one forgets to add a context bound in the middle of a chain of methods that all pass a type tag around, and then suddenly all the tags turn into pumpkins (because that unlucky method just reifies TypeRef(NoPrefix, <type parameter symbol>, Nil and passes it down the chain). Hence we decided to rename ConcreteTypeTag => TypeTag & TypeTag => AbsTypeTag, which makes a lot of sense from a reflection point of view. Unfortunately this broke macros (in a sense), because now everyone writes TypeTag context bounds on macro implementations, which breaks in trivial situations like: "def foo[T](x: T) = identity_macro(x)" (the type of x is not concrete, so macro expansion will emit an error when trying to materialize the corresponding TypeTag). Now we restore the broken balance by banning TypeTag from macro impls. This forces anyone to use AbsTypeTags, and if someone wants to check the input for presence of abstract types, it's possible to do that manually.
* | | | Merge pull request #1082 from VladUreche/topic/remove-anyref-from-libraryJosh Suereth2012-08-072-5/+5
|\ \ \ \ | |/ / / |/| | | Removes AnyRef specialization from library
| * | | Removes AnyRef specialization from libraryVlad Ureche2012-08-072-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed in #999, #1025 and https://groups.google.com/forum/?hl=en&fromgroups#!topic/scala-internals/5P5TS9ZWe_w instrumented.jar is generated from the current source, there's no need for a bootstrap commit. Review by @paulp.
* | | | Merge pull request #1067 from scalamacros/topic/ultimate-reflection-pull-requestAdriaan Moors2012-08-0718-18/+1940
|\ \ \ \ | | | | | | | | | | Ultimate reflection pull request #2
| * | | | SI-6199 unit-returning methods now return unitEugene Burmako2012-08-065-1/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Scala reflection relies on Java reflection to perform member invocations, it inherits some of the quirks of the underlying platform. One of such quirks is returning null when invoking a void-returning method. This is now fixed by introducing a check after calling invoke.
| * | | | mirrors now support overriden fields and methodsEugene Burmako2012-08-062-22/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously `checkMemberOf` was blocking base fields and methods that are overriden in receiver.getClass. Now this is fixed. The fix also uncovered an issue with field mirrors. Currently their `get` and `set` methods don't respect overriding and always return field values from a base class. After discussing this on a reflection meeting, we decided that this behavior is desirable and that for overriding people should use reflectMethod and then apply on getters/setters. See the discussion at: https://github.com/scala/scala/pull/1054.
| * | | | sanity check for reflectConstructorEugene Burmako2012-08-062-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 911bbc4 I've completely overlooked the fact that reflectConstructor exists and that is also needs sanity checks. Now reflectConstructor checks that the incoming symbol is actually a ctor, and that it is actually a ctor of the class reflected by the current mirror.
| * | | | SI-6181 method mirrors now support by-name argsEugene Burmako2012-08-062-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | Arguments provided in by-name positions are now automatically wrapped in Function0 instances by method mirrors.
| * | | | SI-6179 mirrors now work with value classesEugene Burmako2012-08-066-0/+1629
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | mirrors now carry a class tag of the receiver, so that they can detect value classes being reflected upon and adjust accordingly (e.g. allow Int_+ for ints, but disallow it for Integers). Surprisingly enough derived value classes (SIP-15 guys that inherit from AnyVal) have been working all along, so no modification were required to fix them.
| * | | | SI-6178 reflective invocation of magic symbolsEugene Burmako2012-08-064-0/+226
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Scala there are some methods that only exist in symbol tables, but don't have corresponding method entries in Java class files. To the best of my knowledge, these methods can be subdivided into five groups: 1) stuff weaved onto Any, AnyVal and AnyRef (aka Object), 2) magic methods that Scala exposes to fix Java arrays, 3) magic methods declared on Scala primitive value classes, 4) compile-time methods (such as classOf and all kinds of macros), 5) miscellaneous stuff (currently only String_+). To support these magic symbols, I've modified the `checkMemberOf` validator to special case Any/AnyVal/AnyRef methods and adjusted MethodMirror and ConstructorMirror classes to use special invokers for those instead of relying on Java reflection. Support for value classes will arrive in the subsequent commit, because it requires some unrelated changes to the mirror API (currently mirrors only support AnyRefs as their targets).
* | | | Merge pull request #1063 from VladUreche/issue/5788-quickJosh Suereth2012-08-071-0/+4
|\ \ \ \ | |_|/ / |/| | | SI-5788 Tailcalls LabelDefs correctly duplicated
| * | | SI-5788 Tailcalls LabelDefs correctly duplicatedVlad Ureche2012-08-061-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... in specialization. This is a quick hack to get SI-5788 fixed in 2.10.x. The full patch, which fixes the tailcalls LabelDefs will be merged into trunk, as it's too late for big changes. For reference, the complete fix is: e86afe65c8
* | | | Merge pull request #1070 from paulp/topic/critical-2.10.xAdriaan Moors2012-08-077-378/+390
|\ \ \ \ | | | | | | | | | | SI-6063, SI-4945 and restore :warnings in the REPL
| * | | | Restored :warnings to working order.Paul Phillips2012-08-064-378/+370
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As seen here. scala> class A { @deprecated("foo") def a = 1 } warning: there were 1 deprecation warnings; re-run with -deprecation for details defined class A scala> :warnings <console>:7: warning: @deprecated now takes two arguments; see the scaladoc. class A { @deprecated("foo") def a = 1 } ^ scala> val x = 5 toString warning: there were 1 feature warnings; re-run with -feature for details x: String = 5 scala> :warnings <console>:7: warning: postfix operator toString should be enabled by making the implicit value language.postfixOps visible. This can be achieved by adding the import clause 'import language.postfixOps' or by setting the compiler option -language:postfixOps. See the Scala docs for value scala.language.postfixOps for a discussion why the feature should be explicitly enabled. val x = 5 toString ^
| * | | | Fix for SI-6063, broken static forwarders.Paul Phillips2012-08-063-0/+20
| | |/ / | |/| | | | | | | | | | Have to rule out access boundaries as well as private/protected.
* | | | Merge pull request #1066 from magarciaEPFL/ticket-SI-6102Adriaan Moors2012-08-073-0/+15
|\ \ \ \ | |/ / / |/| | | SI-6102 Wrong bytecode in lazyval + no-op finally clause
| * | | test case for SI-6102Miguel Garcia2012-08-063-0/+15
| |/ /
* | | Merge pull request #1059 from magarciaEPFL/ticket-SI-6188Josh Suereth2012-08-066-1/+41
|\ \ \ | |/ / |/| | SI-6188
| * | SI-6157 don't inline callee with exception-handler(s) if potentially unsafeMiguel Garcia2012-08-063-1/+27
| | |
| * | SI-6188 ICodeReader notes exception handlers, Inliner takes them into accountMiguel Garcia2012-08-063-0/+14
| | |
* | | Merge pull request #1045 from scalamacros/ticket/6175Josh Suereth2012-08-061-0/+5
|\ \ \ | |/ / |/| | SI-6175 reflect over classes with symbolic names
| * | SI-6175 reflect over classes with symbolic namesEugene Burmako2012-08-031-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Top-level classes with symbolic names (having binary names like $colon$colon) have previously been incorrectly treated as local classes by Scala reflection. As a result they were loaded as if they weren't pickled (i.e. as Java classes). Moreover this bug also had a more subtle, but more dangerous manifestation. If such a class has already been loaded indirectly by unpickling another class (which refers to it in its pickle) and then someone tried to load it explicitly via classToScala, then it would be loaded twice (once as a Scala artifact and once as a Java artifact). This is a short route to ambiguities and crashes. The fix first checks whether a class with a suspicious name (having dollars) can be loaded as a Scala artifact (by looking it up in a symbol table). If this fails, the class is then loaded in Java style (as it was done before). Ambiguous names that can be interpreted both ways (e.g. foo_$colon$colon) are first resolved as Scala and then as Java. This prioritization cannot lead to errors, because Scala and Java artifacts with the same name cannot coexist, therefore loading a Scala artifact won't shadow a homonymous Java artifact.
* | | Merge pull request #1051 from lrytz/t6074Adriaan Moors2012-08-052-0/+10
|\ \ \ | | | | | | | | SI-6074 disallow implicit enrichment with constructor
| * | | SI-6074Lukas Rytz2012-08-042-0/+10
| | | | | | | | | | | | | | | | | | | | When selecting a non-accessible constructor, don't infer a view to something with an accessible constructor.
* | | | Merge pull request #1012 from paulp/topic/unchecked-goes-hollywoodAdriaan Moors2012-08-055-15/+55
|\ \ \ \ | |_|_|/ |/| | | Promote unchecked warnings into being emitted by default.
| * | | Promote unchecked warnings into being emitted by default.Paul Phillips2012-07-285-15/+55
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | To make that viable, suppression of unchecked warnings is now available on a per-type-argument basis. The @unchecked annotation has hereby been generalized beyond exhaustiveness to mean context-dependent "disable further compiler checking on this entity." Example of new usage: def f(x: Any) = x match { case xs: List[String @unchecked] => xs.head // no warning case xs: List[Int] => xs.head // unchecked warning } It turns out -unchecked has been put to other noisy uses such as the pattern matcher complaining about its budget like a careworn spouse. This actually simplified the path forward: I left -unchecked in place for that and general compatibility, so those warnings can be enabled as before with -unchecked. The erasure warnings I turned into regular warnings, subject to suppression by @unchecked. Review by @odersky.
* | | | Merge pull request #1023 from paulp/issue/6084Adriaan Moors2012-08-041-0/+15
|\ \ \ \ | | | | | | | | | | Fix for SI-6084, type alias crasher.
| * | | | Fix for SI-6084, type alias crasher.Paul Phillips2012-07-301-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | "no need for pt.normalize here, is done in erasure" ORLY? Review by @adriaanm.
* | | | | Merge pull request #1040 from hubertp/issue/asm-long-signatures-againJosh Suereth2012-08-041-0/+3005
|\ \ \ \ \ | | | | | | | | | | | | Fixes SI-6172.
| * | | | | Fixes SI-6172.Hubert Plociniczak2012-08-021-0/+3005
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | All the credit for fixing magical constants in the encoding algorithm goes to @magarciaEPFL. This time provided a test case that exercises GenASM.
* | | | | | staticTpe => staticType, actualTpe => actualTypeEugene Burmako2012-08-042-2/+2
| |_|_|/ / |/| | | |
* | | | | Merge pull request #982 from adriaanm/ticket-wolfcryJosh Suereth2012-08-034-0/+12
|\ \ \ \ \ | |_|_|_|/ |/| | | | SI-5930 SI-5897 reduce redundant warnings in matches, fix flags usage
| * | | | SI-5930 don't warn about dead code in jump to caseAdriaan Moors2012-07-242-0/+5
| | | | |