summaryrefslogtreecommitdiff
path: root/test/files/run
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch '2.10.x'Adriaan Moors2012-08-0849-66/+2035
|\ | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/ast/TreeGen.scala src/compiler/scala/tools/nsc/settings/AestheticSettings.scala
| * Merge pull request #1080 from scalamacros/ticket/6186Josh Suereth2012-08-0716-35/+35
| |\ | | | | | | SI-6186 TypeTags no longer supported in macros
| | * SI-6186 TypeTags no longer supported in macrosEugene Burmako2012-08-0716-35/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-071-4/+4
| |\ \ | | |/ | |/| Removes AnyRef specialization from library
| | * Removes AnyRef specialization from libraryVlad Ureche2012-08-071-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 #1070 from paulp/topic/critical-2.10.xAdriaan Moors2012-08-076-7/+20
| |\ \ | | | | | | | | SI-6063, SI-4945 and restore :warnings in the REPL
| | * | Restored :warnings to working order.Paul Phillips2012-08-063-7/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-064-1/+15
| |\ \ | | |/ | |/| SI-6188
| | * SI-6157 don't inline callee with exception-handler(s) if potentially unsafeMiguel Garcia2012-08-061-1/+1
| | |
| | * 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.
| * | staticTpe => staticType, actualTpe => actualTypeEugene Burmako2012-08-041-1/+1
| |/
* | Merge remote-tracking branch 'origin/2.10.x' into merge-2.10.xPaul Phillips2012-08-02157-606/+674
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * origin/2.10.x: first stab at serialization of exprs and tags deploys a new starr that knows reify is a macro moves Expr from api to base evicts last traces of makro from our codebase reflect.makro => reflect.macros (Step I) removes -Xmacro-(.*)-classpath compiler options prepares our macro defs for refactoring (Step II) prepares our macro defs for refactoring (Step I) more refinements of reflection API SI-5888 Mirrors now have sane toStrings renames asType to toType and asXXXSymbol to asXXX miscellaneous refinements of reflection API navigation between fields and accessors moves most of symbol tests in API to descendants simplifies flag API SI-5732 members and derivatives now return Scope SI-5751 cleans up toolboxes for the release I actually managed to hit the limit of Scala signature annotation not fitting into a single string (high five everyone) and entered the undisovered region of arrEncode in GenASM. arrEncode returns Array[String] so asm.AnnotationWriter is not going to like it. Added more variants to achieve getLinkPos Checkfile update. Fixed maddening "..." lately in printed types. Removed resolveOverloaded SI-5866 Support casting null to value classes ClassTag.Nothing now throws an exception Fixed SI-5031. Only consider classes when looking for companion class. sym.effectiveOwner revealed this piece of inconsistency. companionModule is fine because similar check is there already. Fixed SI-5603. Early definitions now get transparent positions. This includes a fix for a minor problem described in #594 - ensureNonOverlapping still focuses on default position when outside of early defs. Review by @dragos, @odersky. SI-5799 Secondary constructors in value classes not allowed Closes SI-5878 Closes SI-5882 Closed 6029 ... New Worksheet mixing scheme Raw string interpolator Adds method askForResponse Disable interrupts during code instrumentation New Executor. SI-6142: warn @inline-methods ending up not inlined (rightfully or not) Avoids loading scala.package and scala.reflect.package from source if a classfile exists. `ScriptSourceFile` should not hard-code `OffsetPosition`. Fix `Instrumentation.getStatistics` method in partest. Instrument all classes in `instrumented` package. SI-5958 This deserves a stable type SI-6140 Scaladoc infinite recursion in wiki parser SI-4560 - improved test Revert "tentative fix for RC5 lift build problem." Revert "Closes #4560. Review by dragos." (introduction of safeREF) Revert fix part of "Closes 4560. Review by dragos." Fix SI-4560, NoSuchMethodErrors involving self types. SI-2038 make pt fully-defined when typing Typed Conflicts: src/compiler/scala/tools/nsc/interpreter/Imports.scala src/compiler/scala/tools/nsc/interpreter/JLineCompletion.scala src/compiler/scala/tools/nsc/interpreter/MemberHandlers.scala
| * first stab at serialization of exprs and tagsEugene Burmako2012-08-0210-20/+94
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of trying to serialize the entire universe and failing miserably (which happens now), exprs and type tags will now serialize their creators and deserialize into scala.reflect.basis. Since creators produced by reification are not serializable right now, serialization will crash. That's a small improvement over state of the art functionality-wise, but it's a step forward robustness-wise. Next step in this direction is generation of serialization code for creators. Related issues: SI-5919 and SI-5908. Also see the discussion at scala-internals http://groups.google.com/group/scala-internals/browse_thread/thread/ef63f8b5bd194c7c
| * evicts last traces of makro from our codebaseEugene Burmako2012-08-0291-95/+95
| | | | | | | | Removes the stubs left out to appease the old starr, fixes macro tests.
| * more refinements of reflection APIEugene Burmako2012-08-026-62/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a bunch of test methods to symbols to cover public flags: (e.g. isPrivate, isFinal, isOverride, isImplicit, etc). I'd argue that the API duplication w.r.t flag sets is trumped by unified interface to tests and better encapsulation. Also updated the API to be easier to understand after prior exposure to Java or .NET reflection APIs: 1) Added typeParams to TypeSymbol and ClassSymbol. 2) Renamed MethodSymbol.resultType to returnType. 3) Removed the distinction between MethodSymbol.params vs MethodSymbol.allParams now we just have MethodSymbol.params: List[List[Symbol]].
| * SI-5888 Mirrors now have sane toStringsEugene Burmako2012-08-022-0/+57
| | | | | | | | | | | | | | | | Adds informative toString for InstanceMirror, FieldMirror, MethodMirror (for methods and constructors), ClassMirror and ModuleMirror. Universe mirrors (e.g. JavaMirrors or compiler mirrors) already have good toString methods that show their affiliation and/or classpaths.
| * renames asType to toType and asXXXSymbol to asXXXEugene Burmako2012-08-0224-65/+65
| | | | | | | | | | | | | | This renaming arguably makes the intent of `asType` more clear, but more importantly it shaves 6 symbols off pervasive casts that are required to anything meaningful with reflection API (as in mirror.reflectMethod(tpe.member(newTermName("x")).asMethodSymbol)).
| * miscellaneous refinements of reflection APIEugene Burmako2012-08-028-0/+128
| | | | | | | | | | | | | | 1) Removed unnecessary (i.e. implementable with pattern matching) type APIs. 2) Renamed isHigherKinded to takesTypeArgs making it easier to understand. 2) typeParams and resultType have been moved from MethodType to MethodSymbol Strictly speaking they are superfluous, but they are used very often.
| * navigation between fields and accessorsEugene Burmako2012-08-022-0/+21
| | | | | | | | | | | | This works around SI-5736 that's been deemed too risky to be fixed in 2.10.0. A reflection newbie will be unlikely to acquire a field symbol from its name, but the `accessed` method provides an easy way to navigate to it from a getter.
| * SI-5732 members and derivatives now return ScopeEugene Burmako2012-08-025-57/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | Firstly this unifies the reflection API - now both decls and members return Scope (not Scope and List[Symbol] as it were before). Secondly this fixes SI-5732 without having to sort the result of members. Type.members now returns Scope, a distinguished type, which has the `sorted` method, which does the required sorting if necessary. Also removes nonPrivateMembers and nonPrivateDeclarations to keep the API minimalistic (as can be seen from their implementation in internal.Types they are just members and decls with bridges and private members removed).
| * Merge pull request #1030 from scalamacros/ticket/5751Josh Suereth2012-08-023-1/+16
| |\ | | | | | | SI-5751 cleans up toolboxes for the release
| | * SI-5751 cleans up toolboxes for the releaseEugene Burmako2012-07-313-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | Removes the `freeTypes` parameters on `typeCheckExpr` and `runExpr`, since we now have public `substituteTypes` on both trees and types. Also implements long-awaited `inferImplicitValue` and `inferImplicitView` (thanks to Miles Sabin for nudging me!)
| * | Merge pull request #1024 from paulp/topic/type-printingJosh Suereth2012-07-311-10/+10
| |\ \ | | |/ | |/| Fixed maddening "..." lately in printed types.
| | * Checkfile update.Paul Phillips2012-07-301-10/+10
| | | | | | | | | | | | | | | | | | I screwed around with type printing for a long time and now I have to be done, so I suggest we accept the imperfection in here for now because it's still way ahead of "..." as types go.
| * | Merge pull request #1020 from odersky/ticket/5866Josh Suereth2012-07-302-0/+13
| |\ \ | | | | | | | | SI-5866 Support casting null to value classes
| | * | SI-5866 Support casting null to value classesMartin Odersky2012-07-302-0/+13
| | | | | | | | | | | | | | | | The fix now supports null.asInstanceOf[C] where C is a value class that wraps a primitive type.
| * | | Merge pull request #1018 from scalamacros/topic/classtag-of-nothingJosh Suereth2012-07-301-30/+30
| |\ \ \ | | | | | | | | | | ClassTag.Nothing now throws an exception
| | * | | ClassTag.Nothing now throws an exceptionEugene Burmako2012-07-301-30/+30
| | |/ / | | | | | | | | | | | | | | | | Nothing is a bottom type, so it doesn't make much sense for it to have a meaningful erasure (ClassTag.Nothing.runtimeClass).
| * | | Merge pull request #960 from clhodapp/remove-resolve-overloadedJosh Suereth2012-07-309-347/+0
| |\ \ \ | | | | | | | | | | Remove resolveOverloaded
| | * | | Removed resolveOverloadedclhodapp2012-07-309-347/+0
| | | |/ | | |/| | | | | | | | | It was decided to remove it until the next release
| * | | Merge pull request #1015 from hubertp/2.10.x-issue/5603Josh Suereth2012-07-302-0/+71
| |\ \ \ | | |/ / | |/| | Fixed SI-5603. Early definitions now get transparent positions.
| | * | Fixed SI-5603. Early definitions now get transparent positions.Hubert Plociniczak2012-07-302-0/+71
| | |/ | | | | | | | | | | | | | | | This includes a fix for a minor problem described in #594 - ensureNonOverlapping still focuses on default position when outside of early defs. Review by @dragos, @odersky.
| * | Merge pull request #1005 from odersky/topic/worksheetodersky2012-07-302-0/+4
| |\ \ | | |/ | |/| IDE improvements, with particular focus on making worksheets work.
| | * Raw string interpolatorMartin Odersky2012-07-272-0/+4
| | | | | | | | | | | | Adds a raw string interpolator raw"..." which does not do any escape sequence processing.
| * | SI-4560 - improved testJohannes Rudolph2012-07-242-21/+52
| | | | | | | | | | | | | | | | | | Added all the known cases of failing self-types. Added tests for symbol access (SI-4601) as well which should now be fixed for all of the same cases as well.
| * | Fix SI-4560, NoSuchMethodErrors involving self types.Paul Phillips2012-07-242-0/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Following this commit are reversions of three prior commits which introduced difficulties of their own, plus extra tests for this issue and SI-4601, all of which I pinched from jrudolph. Maybe there was a good reason for some of the complicated code related to this ticket. I took the naive position that if we avoided generating a method call to a particular receiver if the receiver has no such method, we would encounter fewer NoSuchMethodErrors. I would believe one can construct a scenario which this doesn't handle correctly, but it's hard to believe this isn't a big improvement. Review by @jrudolph, @odersky.
* | | Merge pull request #1021 from paulp/issue/6154Josh Suereth2012-07-302-0/+11
|\ \ \ | | | | | | | | Fix for SI-6154, VerifyError originating in uncurry.
| * | | Fix for SI-6154, VerifyError originating in uncurry.Paul Phillips2012-07-302-0/+11
| | | | | | | | | | | | | | | | | | | | Lhs still might be an Ident. Miguel did all the work, I just wrote it down in code form.