| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | |/ /
| | | |
| | | |
| | | | |
recoverWith, zip, fallbackTo
|
|/ / /
| | |
| | |
| | |
| | |
| | |
| | | |
Finally my dream of orderliness is within sight.
It's all pretty self-explanatory. More polymorphism, more immutable
identity, more invariants.
|
| | |
| | |
| | |
| | | |
Don't type pattern trees with annotations still attached.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Avoid explicit type arguments which don't conform to bounds
where they could be successfully inferred.
I had to disable one "neg" test which is no longer neg.
Can anyone clue me in as to whether it is important?
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The source of many bugs over the years is that the first is
represented as a TypeRef and the second a SingleType. Over a
great period of time I figured out how to shield us from the
more obvious bug manifestations, but a recent comment by adriaan
jarred me into realizing that we can fix it at the source.
This commit changes <:< and =:= to recognize when those two
representations are being compared and to treat them as equivalent
regardless of which is on the left. The reason I don't quash one
representation entirely is that a fair bit of code depends on
singleton types having an underlying type which is not the same,
and regardless of that it would entail more changes and more risk.
The change allows removing the type inference conditions which
worried about this, and also fixes SI-4910.
scala> val t1 = typeRef(ScalaPackageClass.thisType, NoneModule.moduleClass, Nil)
t1: $r.intp.global.Type = None.type
scala> val t2 = t1.narrow
t2: $r.intp.global.Type = None.type
scala> (t1.getClass, t2.getClass)
res20: (Class[?0], Class[?0]) forSome { type ?0 <: $r.intp.global.Type; type ?0 <: $r.intp.global.Type } =
(class scala.reflect.internal.Types$ModuleTypeRef,class scala.reflect.internal.Types$UniqueSingleType)
scala> ((t1 =:= t2, t2 =:= t1, t1 <:< t2, t2 <:< t1))
res21: (Boolean, Boolean, Boolean, Boolean) = (true,true,true,true)
|
|\ \ |
|
| | | |
|
| | | |
|
|\ \ \ |
|
| | \ \ | |
| | \ \ | |
| | \ \ | |
| | \ \ | |
| | \ \ | |
| | \ \ | |
| |\ \ \ \ \ \
| | | | | | | |
| | | | | | | |
| | | | | | | | |
'dlwh/issues/5632', 'jsuereth/feature/import-jars-from-maven', 'nadezhin/master' and 'axel22/feature/collection-concurrent' into develop
|
| | | | | |\| |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | |
| | | | | | | | |
Conflicts:
src/library/scala/collection/JavaConversions.scala
src/library/scala/collection/JavaConverters.scala
Add one test for concurrent map conversion.
|
| | | | | |/ /
| | | | |/| |
| | | | | | |
| | | | | | | |
equality in mathematical sense
|
| |_|_|/ / /
|/| | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
"References to the type parameters in object-private or
object-protected values, variables, or methods (§5.2) of
the class are not checked for their variance position."
Review by @odersky.
|
| |_|/ / /
|/| | | |
| | | | |
| | | | |
| | | | | |
Yet more funnelling of immutable creation-time known information
into the identities of symbols and types.
|
|\ \ \ \ \
| |_|/ / /
|/| | | | |
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
runtime.AbstractPartialFunction provides a default implementation
for the new-style partial function. In principle this class is only
subclassed by compiler-generated partial functions arising from matches.
Either
- the apply method (old-style partialfun) or
- the applyOrElse method (current scheme)
must be overridden, and the isDefinedAt method implemented.
The applyOrElse method implementation is provided to ease the
transition from the old scheme, since starr still generates
old-style PartialFunctions, but locker's library has the
new AbstractPartialFunction.
Thus, this implementation is intended as a drop-in replacement for the
old partial function, and does not require changes to the compiler.
(compiler patches, both for old and new-style pattern matching, follow)
- runtime.AbstractPartialFunction is based on PartialFunction.WithDefault
Original version of FunctionWithDefault by Odersky
(http://article.gmane.org/gmane.comp.lang.scala.internals/4032)
- better performance for OrElse#applyOrElse, OrElse#lift, PF.cond
- new combinator methods: PF#run, PF#runWith, PF.apply
authored by @pavelpavlov, refactored by @adriaanm, review by @paulp
|
| | | | |
| | | | |
| | | | |
| | | | | |
A classic "off by two" error. Closes SI-4545, SI-5633.
|
| | | | | | |
| \ \ \ \ | |
|\ \ \ \ \ \
| |_|/ / / /
|/| | / / /
| | |/ / / |
'axel22/feature/future-compat' into develop
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Removed some methods from execution contexts.
Changed Awaitable interface.
|
|/ / / / |
|
| | | |
| | | |
| | | |
| | | | |
The lisp test enjoys the suffering of others.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Closes SI-3569, SI-3770.
Also threw in experimental -Yoverride-vars. It's not robust.
|
|/ / /
| | |
| | |
| | |
| | |
| | | |
All hail the lisp test!
Closes SI-4579.
|
|\| | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Introduced the collection.concurrent package and introduced the
concurrent.Map trait there. Deprecated the mutable.ConcurrentMap trait.
Pending work - introduce the appropriate changes to JavaConversions
and JavaConverters.
|
| |/
|/|
| |
| |
| |
| | |
Not actually a fix, but when we see a package where a module is
expected, it's not a great stretch to try the package object.
References SI-5604.
|
| |
| |
| |
| |
| | |
And adds basic support for scaladoc model tests (class
partest.ScaladocModelTest)
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
this came to light with the virtual pattern matcher, which
emits jumps like `matchEnd3(_test(Test.this, false))`, where _test is a tailcall
the nested jumping caused double-closing (the second time in ignore mode)
thus. when closing a closed block in ignore mode, simply do nothing
from genLoad for label-jumps:
note: when one of the args to genLoadLabelArguments is a jump to a label,
it will call back into genLoad and arrive at this case, which will then set ctx1.bb.ignore to true,
this is okay, since we're jumping unconditionally, so the loads and jumps emitted by the outer
call to genLoad (by calling genLoadLabelArguments and emitOnly) can safely be ignored,
however, as emitOnly will close the block, which reverses its instructions (when it's still open),
we better not reverse when the block has already been closed but is in ignore mode
(if it's not in ignore mode, double-closing is an error)
@dragos figured it out, all I did was write the comment and the `if`
test case to repro basic blocks crasher
the tailcall in the forward jump `matchEnd3(_test(Test.this, false))`
in the following program crashes the back-end (error below)
@scala.annotation.tailrec final def test(meh: Boolean): Boolean = {
<synthetic> val _$this: Test.type = Test.this;
_test(_$this,meh){
case <synthetic> val x1: Some[String] = new Some[String]("a");
case3(){
matchEnd2({
case <synthetic> val x1: Some[String] = x1;
case4(){
if (x1.ne(null))
matchEnd3(if (meh)
_test(Test.this, false)
else
false)
else
case5()
};
case5(){
matchEnd3(_test(Test.this, false))
};
matchEnd3(x){
x
}
})
};
matchEnd2(x){
x
}
}
};
The last instruction (of basic block 11) is not a control flow instruction: CONSTANT(false)
// methods
def test(meh: Boolean (BOOL)): Boolean {
locals: value meh, value _$this, value x1, value x, value x, value x1
startBlock: 1
blocks: [1,2,3,4,5,6,7,8,9,10,11,12,13]
1:
4 JUMP 2
2:
5 NEW REF(class Some)
5 DUP(REF(class Some))
5 CONSTANT("a")
5 CALL_METHOD scala.Some.<init> (static-instance)
5 STORE_LOCAL(value x1)
5 SCOPE_ENTER value x1
5 JUMP 3
3:
5 LOAD_LOCAL(value x1)
7 STORE_LOCAL(value x1)
7 SCOPE_ENTER value x1
7 JUMP 4
4:
7 LOAD_LOCAL(value x1)
7 CZJUMP (REF(class Object))NE ? 5 : 6
5:
8 LOAD_LOCAL(value meh)
8 CZJUMP (BOOL)NE ? 8 : 9
6:
? JUMP 11
7:
7 DROP BOOL
7 JUMP 11
8:
8 CONSTANT(false)
8 STORE_LOCAL(value meh)
8 JUMP 2
9:
8 CONSTANT(false)
8 JUMP 10
10:
8 STORE_LOCAL(value x)
8 JUMP 12
11:
9 JUMP 2
9 STORE_LOCAL(value meh)
9 CONSTANT(false)
12:
7 LOAD_LOCAL(value x)
7 SCOPE_EXIT value x1
7 STORE_LOCAL(value x)
7 JUMP 13
13:
5 LOAD_LOCAL(value x)
5 SCOPE_EXIT value x1
5 RETURN(BOOL)
|
| | |
| | |
| | |
| | |
| | | |
the following commit deals with the fall-out in basicblocks
(double closing of blocks in ignore mode)
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
All replacement methods use dolar signs to identify groups in the
matched string, and backslashes to escape characters. Document this
behavior, and provide a method that can be used to properly quote
replacement strings when this behavior is not desired.
Closes SI-4750.
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This adds findAllMatchIn to Regex to mirror other similar methods.
It also overloads StringLike's "r", adding a version that accepts
group names.
It includes test cases for both methods.
Closes SI-2460.
|
| |
| |
| |
| |
| | |
reverts 3db29dde051614d976bca92a1cdeb109c9c0ab01 and 5af2bf54d21ac63236cd6e68586b2c38fa0f28c3
restores 19a48510c2e18430a35319c04dfe3bad7119f23f
|
| | |
|
| | | |
| \ | |
| \ | |
| \ | |
| \ | |
| \ | |
|\ \ \ \ \
| |_|_|_|/
|/| | | |
| | | | | |
'VladUreche/issue/5593', 'dragos/master', 'VladUreche/issue/5599', 'adriaanm/ticket/treeannot' and 'heathermiller/issue/5291' into develop
|
| | | |/ |
|
| | |/
| | |
| | |
| | | |
shutdown test more resilient on slow machines.
|
| | | |
|
| | |\ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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.
|
| | |/
| |/|
| | |
| | |
| | | |
Tried to paint a picture of how one might synthesize an implicit
method to accompany an implicit class.
|
| | | |
|
| | | |
|
| |/ |
|
| |
| |
| |
| | |
This reverts commit d8ba5d091e5641553b438ef9930a6023a2709dcd.
|
| |
| |
| |
| |
| |
| |
| | |
Pattern matcher! Totally unrelated to irrefutability, the pattern matcher
at some point stopped sorting its lookup switch cases, and the butterfly's
wings flapped enough to swap two cases. Now they're sorted in ascending
order like they're supposed to be.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|