| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Regex.unapplySeq should not take Any (Fixes SI-6406)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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."
|
|\ \
| | |
| | | |
Added utility function shortClass.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
|\ \ \
| | | |
| | | | |
Renamed hasSymbol to hasSymbolField.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| | | | |
| | | | | |
SI-6467: Zero element in aggregate now by-name
|
| | | | | |
|
|/ / / /
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
|\ \ \ \
| |/ / /
|/| | | |
Fix scaladoc links in a couple of places.
|
| | | | |
|
|\ \ \ \
| |/ / /
|/| | |
| | | |
| | | |
| | | | |
Conflicts:
build.number
src/reflect/scala/reflect/internal/Types.scala
|
| |\ \ \
| | | | |
| | | | | |
Fixes deprecation annotations for 2.10.0
|
| | | | | |
|
| |\ \ \ \
| | | | | |
| | | | | | |
Improved the `scala.language` documentation
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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
|
| |\ \ \ \ \
| | |/ / / /
| |/| | | | |
SI-6442 - Add ActorDSL object for actor migration kit
|
| | |/ / /
| | | | |
| | | | |
| | | | | |
Removes MigrationSystem, since ActorDSL replaces it.
|
| |\ \ \ \
| | | | | |
| | | | | | |
Fix StringContext documentation.
|
| | |/ / /
| | | | |
| | | | |
| | | | |
| | | | | |
It doesn't call "new", as I discovered after some head
scratching.
|
| |\ \ \ \
| | | | | |
| | | | | | |
Issue/6311
|
| | |/ / /
| | | | |
| | | | |
| | | | | |
This reverts commit 5c5e8d4dcd151a6e2bf9e7c259c618b9b4eff00f.
|
| |\ \ \ \
| | |/ / /
| |/| | | |
SI-6449 Adds version arg to @deprecated usages (non-compiler sources)
|
| | | | | |
|
| | | | | |
|
| |\ \ \ \
| | |/ / /
| |/| | | |
|
| | |\ \ \
| | | | | |
| | | | | | |
a fork of isValueType and isNonValueType
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
only affects runtime reflection, because Symbol.typeSignature
is only defined in the reflection API. the rest of the compiler
uses Symbol.info instead.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
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.
|
| | | | | | |
|
| | |\ \ \ \
| | | | | | |
| | | | | | | |
Removes discrepancy between SIP 15 and compiler
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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.
|
| | |\ \ \ \ \
| | | |_|/ / /
| | |/| | | | |
SI-6380 Add @throws[Exception]
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
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
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
More retrofit of doc model factory.
|
| | | | | | | | |
|
|\ \ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | | |
Typevar suspension
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
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.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Fixes for SI-5859, SI-5353, SI-4729.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
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!
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
The fix of course is a perfect error message.
|
| | |_|_|_|_|_|/ /
| |/| | | | | | |
| | | | | | | | |
| | | | | | | | | |
And other polishing related to varargs handling.
|
|\ \ \ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
Fix for SI-5130, precision disappearing from refinement.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Remove some code, win a prize.
|
|\ \ \ \ \ \ \ \ \ \
| |_|_|/ / / / / / /
|/| | | | | | | | | |
Purged DebruijnIndex.
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
Apparently everyone agrees it's not used anymore.
|
| |_|/ / / / / / /
|/| | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
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.
|
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Since I was in the neigborhood for SI-6447.
|