| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Initially motivated by SI-5580, then just motivated. I broke up
the opaquely named JavaConversions and JavaConverters into the following
traits encapsulating some permutation of
{ to java, to scala, bidirectional }
{ wrappers, decorators }
I named everything consistently in terms of either Wrappers
or Decorators. Decorators install those asJava/asScala methods
onto collections of the right kind; Wrappers hide the process.
JavaConversions then reduces to an object which (ill-advisedly)
extends both WrapAsJava and WrapAsScala. And JavaConverters is
an object extending DecorateAsScala and DecorateAsJava. However
other more clearly named vals exist in the newly created
scala.collection.convert package object.
val decorateAsJava = new DecorateAsJava { }
val decorateAsScala = new DecorateAsScala { }
val decorateAll = new DecorateAsJava with DecorateAsScala { }
val wrapAsJava = new WrapAsJava { }
val wrapAsScala = new WrapAsScala { }
val wrapAll = new WrapAsJava with WrapAsScala { }
So for instance to import asScala decorators, and only those:
scala> import scala.collection.convert.decorateAsScala._
import scala.collection.convert.decorateAsScala._
scala> new java.util.ArrayList[String].asScala groupBy (x => x)
res0: scala.collection.immutable.Map[String,scala.collection.mutable.Buffer[String]] = Map()
I propose we put those vals or a subset of them in the scala
package object rather than way down in scala.collection.convert.
|
| | |
|
|/ |
|
|
|
|
| |
This reverts commit d8ba5d091e5641553b438ef9930a6023a2709dcd.
|
|
|
|
|
|
|
|
|
|
|
| |
Fewer deprecation warnings, prettier trees, prettier
symbols, more polished error messages.
Oh the interesting people you meet handling warnings, I
feel sorry for you all that I get to do it all the time.
One of the characters I met invited me into the "Dead Code
Society" and that's what I'm doing on Tuesdays now. No of
course you haven't, it's a SECRET society.
|
|
|
|
|
| |
Temporary reversion of irrefutability commits in interests
of stable milestone. Expect to restore shortly.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
The parser has always been confused about tuple patterns in
for comprehensions. It thinks it can fail to recognize an
irrefutable pattern and have it removed in refchecks, but it
is sadly mistaken, because the unnecessary filter has a tendency
to fail the compile in typer.
Look more intently for irrefutable patterns and don't insert
the unnecessary filter. Closes SI-5589, SI-1336.
|
|
|
|
|
| |
extrapolate GADT skolems: only complicate types when needed
make sure we only deskolemize GADT skolems after typedCase
|
|\ \
| | |
| | |
| | | |
'acruise/t1118', 'hubertp/issue/5572', 'hubertp/topic/nightly-checkinit', 'axel22/feature/pc-ctrie', 'jsuereth/master-version-fixin' and 'axel22/feature/checkinit-transient' into develop
|
| |/ |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
lib/scala-compiler.jar.desired.sha1
lib/scala-library-src.jar.desired.sha1
lib/scala-library.jar.desired.sha1
src/compiler/scala/reflect/internal/Definitions.scala
src/compiler/scala/reflect/internal/Symbols.scala
src/compiler/scala/tools/nsc/Global.scala
src/compiler/scala/tools/nsc/transform/Constructors.scala
src/compiler/scala/tools/nsc/transform/Erasure.scala
src/compiler/scala/tools/nsc/transform/SpecializeTypes.scala
src/compiler/scala/tools/nsc/typechecker/Contexts.scala
src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
src/compiler/scala/tools/nsc/typechecker/SyntheticMethods.scala
src/library/scala/Function0.scala
src/library/scala/Function1.scala
src/library/scala/Function10.scala
src/library/scala/Function11.scala
src/library/scala/Function12.scala
src/library/scala/Function13.scala
src/library/scala/Function14.scala
src/library/scala/Function15.scala
src/library/scala/Function16.scala
src/library/scala/Function17.scala
src/library/scala/Function18.scala
src/library/scala/Function19.scala
src/library/scala/Function2.scala
src/library/scala/Function20.scala
src/library/scala/Function21.scala
src/library/scala/Function22.scala
src/library/scala/Function3.scala
src/library/scala/Function4.scala
src/library/scala/Function5.scala
src/library/scala/Function6.scala
src/library/scala/Function7.scala
src/library/scala/Function8.scala
src/library/scala/Function9.scala
test/files/codelib/code.jar.desired.sha1
test/files/neg/anyval-children-2.check
test/files/run/programmatic-main.check
|
| | |
| | |
| | |
| | | |
as errors. Fixed erasure scheme.
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
new STARR!
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
enforced. Super calls and specialized still missing.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
...since it works from source. The parser must be forcibly restrained
from adding a bogus constructor, but other than that it's pretty much
smooth sailing. To give an idea how smooth, if I change scala.Short like so:
trait Bippy extends Any
final class Short extends AnyVal with Bippy
Then it just works, at least until the fiction is revealed.
scala> def f(x: Bippy) = x
f: (x: Bippy)Bippy
scala> f(5)
<console>:9: error: type mismatch;
found : Int(5)
required: Bippy
f(5)
^
scala> f(5: Short)
java.lang.ClassCastException: java.lang.Short cannot be cast to scala.Bippy
at .<init>(<console>:9)
at .<clinit>(<console>)
at .<init>(<console>:11)
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
And grueling recovery from branch drift.
Merges a portion (and only a portion) of topic/inline into master.
The major changes which come with this merge are:
AnyVal is unsealed, can be extended directly.
ScalaObject is no longer with us.
|
| |\ \ \
| | |/ /
| |/| /
| | |/
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
lib/scala-compiler.jar.desired.sha1
lib/scala-library-src.jar.desired.sha1
lib/scala-library.jar.desired.sha1
src/compiler/scala/reflect/internal/Definitions.scala
src/compiler/scala/reflect/internal/Importers.scala
src/compiler/scala/reflect/internal/Symbols.scala
src/compiler/scala/reflect/internal/Trees.scala
src/compiler/scala/reflect/internal/Types.scala
src/compiler/scala/tools/nsc/Global.scala
src/compiler/scala/tools/nsc/transform/Erasure.scala
src/compiler/scala/tools/nsc/transform/LiftCode.scala
src/compiler/scala/tools/nsc/transform/UnCurry.scala
src/compiler/scala/tools/nsc/typechecker/RefChecks.scala
src/compiler/scala/tools/nsc/typechecker/Typers.scala
test/files/run/programmatic-main.check
test/files/speclib/instrumented.jar.desired.sha1
|
| | |
| | |
| | |
| | | |
And with that one, I believe all tests pass.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
-- traits can extend Any, AnyRef, or AnyVal
-- classes can extend AnyRef or AnyVal but not Any.
This breaks reflection for the moment as it smuggles AnyVal so far
downstream that it's reflecting its way into bytecode (or something)
but the following test case goes five for six as anticipated.
trait Foo1 extends Any
trait Foo2 extends AnyVal
trait Foo3 extends AnyRef
class Bar1 extends Any // fail
@inline class Bar2 extends AnyVal
class Bar3 extends AnyRef
Eliminated various hijinx from definitions.
|
| | | |
|
| |\ \ |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Fail compile if AnyVal is inherited by a trait, a non-@inline
class, or a class with an AnyRef parent somewhere. Added tests.
Added logging, like
[log extmethods] Inline class class Bippy spawns extension method.
Old: def getClass: Class[_ <: Bippy]
New: final def extension$getClass($this: Bippy): Class[_ <: Bippy]
Fixed what I hope was a bug in ExtensionMethods where the original
method params were dropped.
Since adding a NonNull parent was also inflicting an AnyRef on AnyVal
subclasses, suppressed that for those. Had the bright idea that AnyVal
could extend NotNull. It doesn't seem to accomplish much, but then,
I don't think NotNull accomplishes much. Still, maybe it's time to
restrict the ways one can use AnyVal so one can't do this:
scala> var x: AnyVal = _
x: AnyVal = null
|
| | | | |
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
src/compiler/scala/reflect/internal/Definitions.scala
|
| |\ \ \ \
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Temporarily removed getClass from AnyVal to get build going.
Disabled anyval-childen test.
Fixed some other build problems.
Implemented step 1 + 2 of inline classes proposal.
|
| |_|_|_|/
|/| | | |
| | | | |
| | | | |
| | | | |
| | | | | |
- Renamed t960 to a more sensible name, because SI-960 is not related
to the test and I couldn't find a ticket number.
- Some minor fixes to @deprecated like switched or missing versions.
|
| | | | | | |
| \ \ \ \ | |
|\ \ \ \ \ \
| | | | | | |
| | | | | | |
| | | | | | | |
'jsuereth/better-starr-flow' into develop
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
several fixes to the standard library due to
- the safer type checker this fix gives us (thus, some casts had to be inserted)
- SI-5548
- type inference gets a bit more complicated, it needs help (chainl1 in combinator.Parsers)
To deal with the type slack between actual (run-time) types and statically known
types, for each abstract type T, reflect its variance as a skolem that is
upper-bounded by T (covariant position), or lower-bounded by T (contravariant).
Consider the following example:
class AbsWrapperCov[+A]
case class Wrapper[B](x: Wrapped[B]) extends AbsWrapperCov[B]
def unwrap[T](x: AbsWrapperCov[T]): Wrapped[T] = x match {
case Wrapper(wrapped) =>
// Wrapper's type parameter must not be assumed to be equal to T,
// it's *upper-bounded* by it
wrapped // : Wrapped[_ <: T]
}
this method should type check if and only if Wrapped is covariant in its type
parameter
before inferring Wrapper's type parameter B from x's type AbsWrapperCov[T], we must
take into account that x's actual type is:
AbsWrapperCov[Tactual] forSome {type Tactual <: T}
since AbsWrapperCov is covariant in A -- in other words, we must not assume we know
T exactly, all we know is its upper bound
since method application is the only way to generate this slack between run-time and
compile-time types (TODO: right!?), we can simply replace skolems that represent
method type parameters as seen from the method's body by other skolems that are
(upper/lower)-bounded by that type-parameter skolem (depending on the variance
position of the skolem in the statically assumed type of the scrutinee, pt)
this type slack is introduced by adaptConstrPattern: before it calls
inferConstructorInstance, it creates a new context that holds the new existential
skolems
the context created by adaptConstrPattern must not be a CaseDef, since that
confuses instantiateTypeVar and the whole pushTypeBounds/restoreTypeBounds dance
(CaseDef contexts remember the bounds of the type params that we clobbered
during GADT typing)
typedCase deskolemizes the existential skolems back to the method skolems,
since they don't serve any further purpose (except confusing the old pattern
matcher)
typedCase is now better at finding that context (using nextEnclosing)
|
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | |
| | | | | | | |
fixed concurrent.impl.Promise by making FState invariant
(it would be unsound to make it covariant)
|
| |/ / / / /
|/| | | | |
| | | | | |
| | | | | | |
Closes SI-3275, SI-5455.
|
|\ \ \ \ \ \ |
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| |_|/ / / / /
|/| | | | | |
| | | | | | | |
'hubertp/issue/5553' into develop
|
| |/ / / / / |
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Since there is no useful information in such a message.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
An object in a pattern should have type "Foo.type" just as
objects not in patterns do. Closes SI-5406. Review by @moors.
|
|/ / / / /
| | | | |
| | | | |
| | | | |
| | | | | |
Hacked filename into message to alleviate meaningless
"_$1 defined twice" error condition. References SI-4893.
|
|\ \ \ \ \ |
|
| | | | | | |
|