summaryrefslogtreecommitdiff
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | | | |
| * | | | SI-5897 don't check sensicality in matchAdriaan Moors2012-07-242-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | | the pattern matching analysis should be more precise anyway (don't warn twice)
* | | | | 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-02165-222/+222
| | | | | | | | | | | | | | | | | | | | Removes the stubs left out to appease the old starr, fixes macro tests.
* | | | | removes -Xmacro-(.*)-classpath compiler optionsEugene Burmako2012-08-021-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | These options were meant to be used to bootstrap macros defined in our codebase However we can bootstrap perfectly without any additional effort, because library classpath classloader can delegate to tool classpath classloader to load macro implementations from starr. Since then (for several months) this functionality hasn't proven to be useful, neither anyone on the mailing list or stackoverflow asked questions about it (even despite it was explicitly mentioned in the "cannot load macro impl" error message). Hence I suggest that it is totally unnecessary and should be removed.
* | | | | 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 #1016 from hubertp/2.10.x-issue/5031Josh Suereth2012-07-306-0/+26
|\ \ \ \ \ | | | | | | | | | | | | Fixed SI-5031. Only consider classes when looking for companion class.
| * | | | | Fixed SI-5031. Only consider classes when looking for companion class.Hubert Plociniczak2012-07-306-0/+26
| |/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | sym.effectiveOwner revealed this piece of inconsistency. companionModule is fine because similar check is there already. Review by @paulp.
* | | | | Merge pull request #1011 from odersky/ticket/5882Josh Suereth2012-07-304-0/+32
|\ \ \ \ \ | | | | | | | | | | | | Closes SI-5882
| * | | | | SI-5799 Secondary constructors in value classes not allowedMartin Odersky2012-07-292-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | I changed the SIP and added a test.
| * | | | | Closes SI-5882Martin Odersky2012-07-282-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | I have added a restriction that value classes may not contain inner classes or objects. This makes sense as the "outer" field of any such classes or objects would be ephemeral, with surprising results. SIP-15 has been changed accordingly.
* | | | | | Merge pull request #981 from adriaanm/ticket-2038Josh Suereth2012-07-301-0/+5
|\ \ \ \ \ \ | | | | | | | | | | | | | | SI-2038 make pt fully-defined when typing Typed
| * | | | | | SI-2038 make pt fully-defined when typing TypedAdriaan Moors2012-07-231-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | dropExistential turns existentials in the expected type (pt) that's passed to `typed` into `BoundedWildcardType`s, but those should not end up in trees when typing a `Typed` node, we didn't check for the type being fully defined (`isFullyDefined`) (and thus did not make it fully defined by turning these BWTs into existentials again using `makeFullyDefined`)
* | | | | | | 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 #1013 from odersky/ticket/5878odersky2012-07-302-0/+19
|\ \ \ \ \ \ | | | | | | | | | | | | | | Closes SI-5878
| * | | | | | Closes SI-5878Martin Odersky2012-07-292-0/+19
| | |_|/ / / | |/| | | | | | | | | | | | | | | | We need to impose an additional rule on value classes: They may not unbox directly or indirectly to themselves.
* | | | | | 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.
* | | | | | Merge pull request #996 from gkossakowski/instrumentation-fixesJosh Suereth2012-07-292-0/+20
|\ \ \ \ \ \ | | | | | | | | | | | | | | Partest instrumentation fixes
| * | | | | | Instrument all classes in `instrumented` package.Grzegorz Kossakowski2012-07-262-0/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Extend instrumenting infrastructure to instrument classes in `instrumented` package. This is useful because very often you need to put your classes into non-empty package. E.g. inliner doesn't work properly with empty package at the moment so in order to test any behaviour we need to put classes in some other package that is instrumented. Added testing code for that to instrumentation test-case. Review by @phaller.
* | | | | | | Merge pull request #990 from VladUreche/issue/6140Josh Suereth2012-07-292-0/+19
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | SI-6140 Scaladoc infinite recursion in wiki parser
| * | | | | | | SI-6140 Scaladoc infinite recursion in wiki parserVlad Ureche2012-07-252-0/+19
| |/ / / / / / | | | | | | | | | | | | | | | | | | | | | introduced by dc70d1b7.