| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
| |
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.
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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.
|
| |
| |
| |
| |
| | |
reverts 3db29dde051614d976bca92a1cdeb109c9c0ab01 and 5af2bf54d21ac63236cd6e68586b2c38fa0f28c3
restores 19a48510c2e18430a35319c04dfe3bad7119f23f
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
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.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
typedMatchAnonFun is called from typedFunction when the function's body is a match
this is work-in-progres: the compiler currently won't bootstrap under -Yvirtpatmat
see also the pending test
make sure to use the right context in typeFunction when the body is a Match
when typer is set up for type checking a Function, the current owner is the symbol for the function,
but we'll type check a Block(List(ClassDef(cd)), New(cd)) when the function is a match,
and the function symbol is nowhere to be found, so go to outer context
in patmatvirt:
- simplified default case gen (no need for a Casegen instance)
- using CASE | SYNTHETIC to detect generated matches (for switches) and avoid typing them endlessly
more uniform, and necessary for new-style anon Function class instance gen for matches
|
| |
| |
| |
| |
| |
| |
| |
| | |
when an unapply returns Option[T] where T is some ProductN, does that mean the unapply
returns 1 result, i.e., that T, or did it mean to return N results?
to disambiguate, falling back to stricter spec-adherence, which requires T be exactly TupleN for N results
for now, allow extractor result to be any product, not just tuple
|
|/
|
|
| |
Looks like I got that irrefutability bug too.
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Having now experienced the unbelievable difference it makes to
have one's voluminous debugging output effectively color-coded,
I had to librarize the ansi codes in order to use them. This
could all go in the standard library, or as soon as I can easily
make use of compiler dependencies, a separate library altogether.
For now it hides away in scala.tools.util.color.
|
|/
|
|
|
|
|
|
| |
* +: does head/tail decomposition on any Seq
* :+ does init/last decomposition on any Seq
* Both preserve specific Seq types.
Review by @odersky
|
|
|
|
|
|
|
| |
It's more of a "dump what it says to a file so we'll know if
any of this ever changes" than a "test" per se. It could use
some wheat/chaff/nonsense/sense sorting. Still, it would
be great to have more stuff like this.
|
|\ \ \
| | | |
| | | |
| | | | |
'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.
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
test/files/run/Meter.scala
|
| | | |
|
| | | |
|
| | | |
|
| | |
| | |
| | |
| | | |
enforced. Super calls and specialized still missing.
|
| | | |
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
src/compiler/scala/tools/nsc/Global.scala
test/files/run/programmatic-main.check
|
| |\ \ \
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
Conflicts:
src/compiler/scala/reflect/internal/Definitions.scala
src/compiler/scala/tools/nsc/typechecker/Namers.scala
src/library/scala/AnyVal.scala
test/files/run/primitive-sigs-2.check
test/files/run/t4172.check
test/files/scalap/abstractClass/result.test
test/files/scalap/abstractMethod/result.test
test/files/scalap/caseClass/result.test
test/files/scalap/cbnParam/result.test
test/files/scalap/classPrivate/result.test
test/files/scalap/classWithExistential/result.test
test/files/scalap/classWithSelfAnnotation/result.test
test/files/scalap/covariantParam/result.test
test/files/scalap/implicitParam/result.test
test/files/scalap/paramClauses/result.test
test/files/scalap/paramNames/result.test
test/files/scalap/sequenceParam/result.test
test/files/scalap/simpleClass/result.test
test/files/scalap/traitObject/result.test
test/files/scalap/typeAnnotations/result.test
test/files/scalap/valAndVar/result.test
test/files/scalap/wildcardType/result.test
|
| | | | |
| | | | |
| | | | |
| | | | | |
ScalaObject. Undoing wrong fix in ExtensionMethods.
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
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.
|