summaryrefslogtreecommitdiff
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #1369 from som-snytt/issue/6406-regextractPaul Phillips2012-10-041-34/+64
|\ | | | | Regex.unapplySeq should not take Any (Fixes SI-6406)
| * Regex.unapplySeq should not take Any (Fixes SI-6406)Som Snytt2012-09-201-34/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This deprecates unapplySeq(Any) and adds overloaded unapplySeq(CharSequence) and unapplySeq(Match), with the putative advantage that you can't try to extract the unextractable. Regex is massaged so that the underlying Pattern is primary, rather than the String-valued expression. Regex and its unanchored companion (I almost wrote unmoored) share a Pattern object, so that unapplySeq(Match) can easily test whether the Match was generated by this Regex; in that case, the match result is used immediately, instead of reapplying the regex to the matched string. The documentation is massaged to reflect unanchored and also to align with the underlying terminology, e.g., "subgroup" really just means "group."
* | Merge pull request #1429 from paulp/topic/shortClassPaul Phillips2012-10-044-13/+46
|\ \ | | | | | | Added utility function shortClass.
| * | Added utility function shortClass.Paul Phillips2012-09-294-13/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pretty sick of names like scala> typeOf[List[Int]].getClass.getName res0: String = scala.reflect.internal.Types$TypeRef$$anon$1 I wrote this so I can see what the class of some arbitrary thing is in a way which my little brain can understand. For the example above we get scala> shortClassOfInstance(typeOf[List[Int]]) res0: String = ArgsTypeRef with AliasTypeRef Let's pimp a "shortClassName" onto AnyRef and be happy.
* | | Merge pull request #1456 from paulp/has-symbol-fieldPaul Phillips2012-10-0418-51/+52
|\ \ \ | | | | | | | | Renamed hasSymbol to hasSymbolField.
| * | | Renamed hasSymbol to hasSymbolField.Paul Phillips2012-10-0318-51/+52
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Suggestion by retronym that the obvious implementation of "hasSymbol" be called "hasSymbol" reminded me we have a method called "hasSymbol" which does not have that implementation, and which has burned us already with subtle bugginess. I think that "hasSymbolField" is self-documenting.
* | | | Merge pull request #1460 from axel22/issue/6467-cherry-masterJosh Suereth2012-10-044-9/+11
|\ \ \ \ | | | | | | | | | | SI-6467: Zero element in aggregate now by-name
| * | | | SI-6467: Zero element in aggregate now by-nameAleksandar Prokopec2012-10-044-9/+11
| | | | |
* | | | | Fix for gluttunous raw type creation.Paul Phillips2012-10-041-8/+10
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | ClassfileParser had a bug which led to it thinking pretty much anything might be a raw type, and thus creating extra symbols for no good reason. When compiling scala.collection, before this change it thought 1094 raw types had passed by; afterward it thought 237.
* | | | Merge pull request #1453 from vigdorchik/links_fixedPaul Phillips2012-10-032-3/+3
|\ \ \ \ | |/ / / |/| | | Fix scaladoc links in a couple of places.
| * | | Fix scaladoc links in a couple of places.Eugene Vigdorchik2012-10-032-3/+3
| | | |
* | | | Merge remote-tracking branch 'scala/2.10.x'Grzegorz Kossakowski2012-10-0332-131/+324
|\ \ \ \ | |/ / / |/| | | | | | | | | | | | | | | Conflicts: build.number src/reflect/scala/reflect/internal/Types.scala
| * | | Merge pull request #1434 from jsuereth/fix/SI-6449Grzegorz Kossakowski2012-10-022-5/+5
| |\ \ \ | | | | | | | | | | Fixes deprecation annotations for 2.10.0
| | * | | Fixes deprecation annotations for 2.10.0Josh Suereth2012-09-303-7/+7
| | | | |
| * | | | Merge pull request #1440 from VladUreche/issue/language-docGrzegorz Kossakowski2012-10-024-27/+77
| |\ \ \ \ | | | | | | | | | | | | Improved the `scala.language` documentation
| | * | | | Improved the `scala.language` documentationVlad Ureche2012-10-024-27/+77
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Also corrected the links in the library rootdoc. **Note: We need to fast track this commit so it reaches master in the next 12 hours, before we generate the next nightly docs.** Review by @odersky
| * | | | | Merge pull request #1425 from phaller/issue/6442Grzegorz Kossakowski2012-10-023-42/+61
| |\ \ \ \ \ | | |/ / / / | |/| | | | SI-6442 - Add ActorDSL object for actor migration kit
| | * | | | SI-6442 - Add ActorDSL object for actor migration kitphaller2012-09-293-42/+61
| | |/ / / | | | | | | | | | | | | | | | Removes MigrationSystem, since ActorDSL replaces it.
| * | | | Merge pull request #1435 from paulp/stringcontext-docPaul Phillips2012-10-011-6/+6
| |\ \ \ \ | | | | | | | | | | | | Fix StringContext documentation.
| | * | | | Fix StringContext documentation.Paul Phillips2012-10-011-6/+6
| | |/ / / | | | | | | | | | | | | | | | | | | | | It doesn't call "new", as I discovered after some head scratching.
| * | | | Merge pull request #1428 from paulp/issue/6311Paul Phillips2012-10-011-13/+2
| |\ \ \ \ | | | | | | | | | | | | Issue/6311
| | * | | | Revert "SI-4881 infer variance from formals, then result"Paul Phillips2012-09-291-13/+2
| | |/ / / | | | | | | | | | | | | | | | This reverts commit 5c5e8d4dcd151a6e2bf9e7c259c618b9b4eff00f.
| * | | | Merge pull request #1424 from soc/SI-6449Paul Phillips2012-10-0113-15/+15
| |\ \ \ \ | | |/ / / | |/| | | SI-6449 Adds version arg to @deprecated usages (non-compiler sources)
| | * | | Fix incomplete version strings (2.10 -> 2.10.0)Simon Ochsenreither2012-09-2910-11/+11
| | | | |
| | * | | SI-6449 Adds version arg to @deprecated usages (non-compiler sources)Simon Ochsenreither2012-09-293-4/+4
| | | | |
| * | | | Merge remote-tracking branch 'scala/2.10.x' into 2.10.0-wipGrzegorz Kossakowski2012-09-2922-181/+651
| |\ \ \ \ | | |/ / / | |/| | |
| | * | | Merge pull request #1415 from scalamacros/is-value-typeEugene Burmako2012-09-284-11/+125
| | |\ \ \ | | | | | | | | | | | | a fork of isValueType and isNonValueType
| | | * | | fully initializes symbols on `typeSignature`Eugene Burmako2012-09-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | only affects runtime reflection, because Symbol.typeSignature is only defined in the reflection API. the rest of the compiler uses Symbol.info instead.
| | | * | | Implementations of isValueType and isNonValueType.Paul Phillips2012-09-282-12/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Restrictions regarding how non-value types can be used have generally not been enforced explicitly, depending instead on the fact that the compiler wouldn't attempt to use them in strange ways like offering a method type as a type argument. Since users can now create most types from scratch, it has become important to enforce the restrictions in a more direct fashion. This was a lot harder than it probably should have been because there are so many types which go unmentioned by the specification. Hopefully a useful exercise in any case.
| | | * | | SI-6417 correctly reifies non-value typesEugene Burmako2012-09-281-3/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we're reifying non-value types (e.g. MethodTypes), we can't use them as type arguments for TypeTag/WeakTypeTag factory methods, otherwise the macro expansion won't typecheck: http://groups.google.com/group/scala-internals/browse_thread/thread/2d7bb85bfcdb2e2 This situation is impossible if one uses only reify and type tags, but c.reifyTree and c.reifyType exposes in the macro API let anyone feed anything into the reifier. Therefore I now check the tpe that is about to be used in TypeApply wrapping TypeTag/WeakTypeTag factory methods and replace it with AnyTpe if it doesn't fit.
| | | * | | showRaw no longer crashes on NoSymbolEugene Burmako2012-09-281-1/+2
| | | | | |
| | * | | | Merge pull request #1395 from odersky/topic/valueclass-cleanupGrzegorz Kossakowski2012-09-281-1/+1
| | |\ \ \ \ | | | | | | | | | | | | | | Removes discrepancy between SIP 15 and compiler
| | | * | | | Removes discrepancy between SIP 15 and compilerMartin Odersky2012-09-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a discrepancy in that the compiler alternatively accepts a val parameter or an unbox method for a value class but SIP 15 does not mention the unbox method. I commented out the line in the compiler that does it.
| | * | | | | Merge pull request #1347 from soc/SI-6380Grzegorz Kossakowski2012-09-285-15/+30
| | |\ \ \ \ \ | | | |_|/ / / | | |/| | | | SI-6380 Add @throws[Exception]
| | | * | | | SI-6380 #1 Add @throws[Exception]Simon Ochsenreither2012-09-215-15/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows an additional notation of the @throws annotation: Old-style: @throws(classOf[Exception]) New-style: @throws[Exception] The optional String argument moves @throws in line with @deprecated, @migration, etc. and prevents confusion caused by the default inheritance of ScalaDoc comments and the non-inheritance of annotations. Before: /** This method does ... * @throws IllegalArgumentException if `a` is less than 0. */ @throws(classOf[IllegalArgumentException]) def foo(a: Int) = ... Now: /** This method does ... */ @throws[IllegalArgumentException]("if `a` is less than 0") def foo(a: Int) = ... ScalaDoc @throws tags remain supported for cases where documentation of thrown exceptions is needed, but are not supposed to be added to the exception attribute of the class file. In this commit the necessary compiler support is added. The code to extract exceptions from annotations is now shared instead of being duplicated all over the place. The change is completely source and binary compatible, except that the code is now enforcing that the type thrown is a subtype of Throwable as mandated by the JVM spec instead of allowing something like @throws(classOf[String]). Not in this commit: - ScalaDoc support to add the String argument to ScalaDoc's exception list - Adaption of the library
| * | | | | | add a bit about unicode to scaladoc.Josh Suereth2012-09-281-0/+7
| | | | | | |
* | | | | | | Merge pull request #1431 from vigdorchik/model_factory_cleanupGrzegorz Kossakowski2012-10-031-23/+14
|\ \ \ \ \ \ \ | | | | | | | | | | | | | | | | More retrofit of doc model factory.
| * | | | | | | More retrofit of scaladoc model factory.Eugene Vigdorchik2012-10-011-23/+14
| | | | | | | |
* | | | | | | | Merge pull request #1437 from paulp/typevar-suspensionGrzegorz Kossakowski2012-10-021-205/+204
|\ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | Typevar suspension
| * | | | | | | | Fix for TypeVar instantiation.Paul Phillips2012-10-011-205/+204
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In an effort to reduce the enormous amount of duplication which now exists among methods which attempt to deduce something about the relationship between two types, a sampling (and only a sampling - this might not even be half of them) given here: def isAsSpecific(ftpe1: Type, ftpe2: Type): Boolean def isCompatibleByName(tp: Type, pt: Type): Boolean def isConservativelyCompatible(tp: Type, pt: Type): Boolean def isConsistent(tp1: Type, tp2: Type): Boolean def isDifferentType(tp1: Type, tp2: Type): Boolean def isDifferentTypeConstructor(tp1: Type, tp2: Type): Boolean def isDistinguishableFrom(t1: Type, t2: Type): Boolean def isNeverSubType(tp1: Type, tp2: Type): Boolean def isNumericSubType(tp1: Type, tp2: Type): Boolean def isPlausiblyCompatible(tp: Type, pt: Type): Boolean def isPopulated(tp1: Type, tp2: Type): Boolean def isSameType(tp1: Type, tp2: Type): Boolean def isSameType2(tp1: Type, tp2: Type): Boolean def isSubType(tp1: Type, tp2: Type): Boolean def isWeakSubType(tp1: Type, tp2: Type): Boolean def isWeaklyCompatible(tp: Type, pt: Type): Boolean def matches(tpe1: Type, tpe2: Type): Boolean def overlaps(tp1: Type, tp2: Type): Boolean def typesConform(tp: Type, pt: Type): Boolean I began pulling a thread left by moors in isPopulated: need to investgate why this can't be made symmetric -- neg/gadts1 fails, and run/existials also. Followed that to this code in TypeVar: val newInst = wildcardToTypeVarMap(tp) (constr isWithinBounds newInst) && { setInst(tp); true } -------^ That was the obstacle to symmetry, because it creates a cycle in e.g. run/existentials. Kept pulling the string, came back to my own comment of long ago: !!! Is it somehow guaranteed that this will not break under nesting? In general one has to save and restore the contents of the field... Decided that uncertainty could no longer be tolerated. Unless it can be proven somehow that there will never be crosstalk among the save/suspension points, we should do it this way even if nothing demands it yet. What's in this commit: - Made isPopulated symmetric. - Made setInst resistant to TypeVar cycles. - Fixed above mentioned bug in registerTypeEquality. - Added some rigor to the suspension/unsuspension of TypeVars so it will not break under nesting. - Recovered pos/t0851.scala from its deletion.
* | | | | | | | | Merge pull request #1430 from paulp/SI-5859-5353-4729Grzegorz Kossakowski2012-10-027-54/+69
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fixes for SI-5859, SI-5353, SI-4729.
| * | | | | | | | | Fix for SI-4729, overriding java varargs in scala.Paul Phillips2012-09-292-14/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This was a bad interaction between anonymous subclasses and bridge methods. new Foo { override def bar = 5 } Scala figures it can mark "bar" private since hey, what's the difference. The problem is that if it was overriding a java-defined varargs method in scala, the bridge method logic says "Oh, it's private? Then you don't need a varargs bridge." Hey scalac, you're the one that made me private! You made me like this! You!
| * | | | | | | | | Fix for SI-5353, imperfect error message.Paul Phillips2012-09-291-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The fix of course is a perfect error message.
| * | | | | | | | | Fix for SI-5859, inapplicable varargs.Paul Phillips2012-09-296-38/+35
| | |_|_|_|_|_|/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | And other polishing related to varargs handling.
* | | | | | | | | Merge pull request #1423 from paulp/issue/5130Grzegorz Kossakowski2012-10-021-6/+0
|\ \ \ \ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | Fix for SI-5130, precision disappearing from refinement.
| * | | | | | | | | Fix for SI-5130, precision disappearing from refinement.Paul Phillips2012-09-281-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Remove some code, win a prize.
* | | | | | | | | | Merge pull request #1418 from paulp/no-debruijnPaul Phillips2012-10-0110-128/+4
|\ \ \ \ \ \ \ \ \ \ | |_|_|/ / / / / / / |/| | | | | | | | | Purged DebruijnIndex.
| * | | | | | | | | Purged DebruijnIndex.Paul Phillips2012-09-2810-128/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Apparently everyone agrees it's not used anymore.
* | | | | | | | | | Fix for SI-6452, leak in ListBuffer.Paul Phillips2012-09-301-13/+31
| |_|/ / / / / / / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The private var which holds a pointer to the end of the list was not cleared even when the length of the buffer was reduced to 0.
* | | | | | | | | Some cleanups in Macros.Paul Phillips2012-09-281-40/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since I was in the neigborhood for SI-6447.