| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
SI-7488 REPL javap finds new style delayedEndpoint
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The REPL :java -app command is a convenience to locate
the body of DelayedInit code. Now it will look for
new style delayedEndpoints on the class before it
falls back to showing the apply method of the
delayedInit$body closure.
```
apm@mara:~/tmp$ skala
Welcome to Scala version 2.11.0-20130711-153246-eb1c3137f5 (OpenJDK 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :javap -pv -app delayed.C
public final void delayedEndpoint$delayed$C$1();
flags: ACC_PUBLIC, ACC_FINAL
Code:
stack=2, locals=1, args_size=1
0: getstatic #29 // Field scala/Predef$.MODULE$:Lscala/Predef$;
3: ldc #31 // String this is the initialization code of C
5: invokevirtual #35 // Method scala/Predef$.println:(Ljava/lang/Object;)V
8: return
LocalVariableTable:
Start Length Slot Name Signature
0 9 0 this Ldelayed/C;
LineNumberTable:
line 11: 0
scala> :q
apm@mara:~/tmp$ rm delayed/*.class
apm@mara:~/tmp$ scalac delayed.scala
apm@mara:~/tmp$ skala
Welcome to Scala version 2.11.0-20130711-153246-eb1c3137f5 (OpenJDK 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :javap -pv -app delayed.C
public final java.lang.Object apply();
flags: ACC_PUBLIC, ACC_FINAL
Code:
stack=2, locals=1, args_size=1
0: getstatic #13 // Field scala/Predef$.MODULE$:Lscala/Predef$;
3: ldc #15 // String this is the initialization code of C
5: invokevirtual #19 // Method scala/Predef$.println:(Ljava/lang/Object;)V
8: getstatic #25 // Field scala/runtime/BoxedUnit.UNIT:Lscala/runtime/BoxedUnit;
11: areturn
LocalVariableTable:
Start Length Slot Name Signature
0 12 0 this Ldelayed/C$delayedInit$body;
LineNumberTable:
line 11: 0
line 10: 8
```
|
|/
|
|
|
|
|
|
|
|
|
|
| |
Rather than relying on the cloner to copy the
provided gitignore.SAMPLE files.
This finishes the job started in c48509598, mostly
by reverting that commit and moving the two existing
SAMPLE files to the final destinations.
Use `.git/info/exclude` to augment the list of patterns
with entries specific to your workflow.
|
|\
| |
| | |
SI-4684 Repl supports whole-file paste (rebased)
|
| |
| |
| |
| |
| |
| |
| |
| | |
By special request, :paste -raw simply compiles the pasted
code to the repl output dir.
The -raw flag means no wrapping; the pasted code must be
ordinary top level Scala code, not script.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add a file argument to the :paste command which loads the
file's contents as though entered in :paste mode.
The :paste command is replayable.
Samples, including companions defined together:
```
scala> :paste junk.scala
File contains no code: junk.scala
scala> :paste no-file.scala
That file does not exist
scala> :paste obj-repl.scala
Pasting file obj-repl.scala...
<console>:2: error: expected start of definition
private foo = 7
^
scala> :paste hw-repl.scala
Pasting file hw-repl.scala...
The pasted code is incomplete!
<pastie>:5: error: illegal start of simple expression
}
^
scala> :replay
Replaying: :paste junk.scala
File contains no code: junk.scala
Replaying: :paste obj-repl.scala
Pasting file obj-repl.scala...
defined trait Foo
defined object Foo
Replaying: Foo(new Foo{})
res0: Int = 7
```
|
|/
|
|
|
|
|
|
| |
Make the test a SessionTest, where the file name appears just
once, in the transcript, and is trivially compared against itself.
The contents of the saved file are still output and compared with
the check file.
|
|
|
|
| |
This reverts commit 71fb0b83a, which itself reverted the fix for SI-6812.
|
|\
| |
| | |
SI-6419 Repl save session command
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A simple save command to write out the current replay stack.
```
scala> val i = 7
i: Int = 7
scala> val j= 8
j: Int = 8
scala> i * j
res0: Int = 56
scala> :save multy.script
scala> :q
apm@mara:~/tmp$ cat multy.script
val i = 7
val j= 8
i * j
apm@mara:~/tmp$ skala
Welcome to Scala version 2.11.0-20130626-204845-a83ca5bdf7 (OpenJDK 64-Bit Server VM, Java 1.7.0_21).
Type in expressions to have them evaluated.
Type :help for more information.
scala> :load multy.script
Loading multy.script...
i: Int = 7
j: Int = 8
res0: Int = 56
scala> :load multy.script
Loading multy.script...
i: Int = 7
j: Int = 8
res1: Int = 56
```
|
|\ \
| | |
| | | |
SI-4594 Repl settings command
|
| |/
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A settings command for the rest of us.
The usual command line options are used, except that boolean flags
are enabled with +flag and disabled with -flag.
```
scala> :settings +deprecation
scala> new BigInt(java.math.BigInteger.TEN) { }
<console>:8: warning: inheritance from class BigInt in package math is deprecated: This class will me made final.
new BigInt(java.math.BigInteger.TEN) { }
^
res0: BigInt = 10
scala> :settings -deprecation
scala> new BigInt(java.math.BigInteger.TEN) { }
res1: BigInt = 10
```
Multivalue "colon" options can be reset by supplying no values
after the colon. This behavior is different from the command line.
```
scala> 1 toString
warning: there were 1 feature warning(s); re-run with -feature for details
res0: String = 1
scala> :settings -language:postfixOps
scala> 1 toString
res1: String = 1
scala> :settings
-d = .
-encoding = UTF-8
-explaintypes = false
-language = List(postfixOps)
-nowarn = false
scala> :settings -language:
scala> :settings
-d = .
-encoding = UTF-8
-explaintypes = false
-language = List()
-nowarn = false
```
|
|\ \
| | |
| | | |
Quasiquotes
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
10229316db allowed macro impls to take and return values of type c.Tree
in addition to the usual c.Expr. However it didn't take into account that
it is often useful to return subtypes of trees (e.g. with quasiquotes
that expand into expressions typed as precisely as possible). This patch
fixes that oversight.
|
| | |
| | |
| | |
| | |
| | |
| | | |
Introduces an extensive ScalaCheck-based test suite for recently
implemented quasiquotes. Provides tools for syntactic tree comparison
and verifying compilation error messages.
|
|\ \ \
| | | |
| | | | |
SI-6574 Support @tailrec for extension methods.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently, when the body of an extension method is transplanted
to the companion object, recursive calls point back to the original
instance method. That changes during erasure, but this is too late
for tail call analysis/elimination.
This commit eagerly updates the recursive calls to point to the
extension method in the companion. It also removes the @tailrec
annotation from the original method.
|
|\ \ \ \
| | | | |
| | | | | |
SI-7638 Superaccessor lookup after specialization
|
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The crash was caused by a symbol lookup to rewire the super calls,
done after pickler, but specialization added new traits and new
members, thus making the super rewiring impossible. To avoid such
problems, this patch moves symbol lookup after specialization,
so the changes done by specialization (and miniboxing) become
visible to mixin.
Review by @adriaanm or @retronym.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Separate jars for XML, Parser Combinators. Use released JLine.
|
| | | | | | |
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Summary:
- Remove the last vestiges of xml from Predef and Contexts.
- Change build to compile scala.xml to scala-xml.jar.
- Deploy scala-xml module to maven.
- Update partest accordingly.
Note:
An older compiler cannot use the new standard library to
compile projects that use XML. Thus, skipping locker will
break the build until we use 2.11.0-M4 for STARR.
In the future build process, where we drop locker,
we would have to release a milestone that supports the old
and the new approach to xml. As soon as we'd be using that
new milestone for starr, we could drop support for the old approach.
|
|\ \ \ \ \ \
| |_|_|_|/ /
|/| | | | | |
SI-6221 inference with Function1 subtypes.
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
There appears to be no upper bound on the number of places
we have to remove calls to typeSymbol and introduce calls to
baseType. This one was type inference for function parameter
types: worked when expected type was A => B, but not if there
was an implicit conversion from A => B to the expected type.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
SI-7614 Minimize the times of evaluation f in TraversableOnce.maxBy/minBy
|
| | |_|/ / /
| |/| | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
In the previous implementation, maxBy/minBy will evaluate most of its elements
with f twice to get the ordering. That results (2n - 2) evaluations of f.
I save both the element and result of evaluation to a tuple so that it doesn't
need to re-evaluate f on next comparison. Thus only n evaluations of f, that is
the optimal.
Note that the original implementation always returns the first matched if more
than one element evaluated to same largest/smallest value of f. I document
this behavior explicitly in this commit as well.
|
|\ \ \ \ \ \
| |_|_|/ / /
|/| | | | | |
SI-7582 Only inline accessible calls to package-private Java code
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Two problems here.
The inliner was using `isPrivate` / `isProtected` to determine access.
The fallthrough considered things to be (bytecode) public. This is okay
in practice for Scala code, which never emits package private code.
Secondly, we must check accessibility of the called symbol *and* its
owner. This case is tested in `run/t7582b`.
This commit tightens the check for Java defined symbols: a) check the owner,
and b) don't assume that `! isPrivate` is accessible.
|
| | |/ / /
| |/| | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | |
| | | | | |
The `privateWithin` attribute of Java companion module classes was
correctly set under joint compilation (ie, when using JavaParser),
but not under separate compilation.
This commit remedies this. The test covers variety of Java symbols.
|
|\ \ \ \ \
| | | | | |
| | | | | | |
Use forward slash in #2637's test on windows
|
| | | | | |
| | | | | |
| | | | | |
| | | | | |
| | | | | | |
Don't use toString to output file names in tests,
its output is platform dependent -- use `testIdent` instead.
|
|\ \ \ \ \ \
| | | | | | |
| | | | | | | |
Lint-like fixes found by Semmle
|
| | | | | | | |
|
|\ \ \ \ \ \ \
| | | | | | | |
| | | | | | | | |
Merge 2.10.x into master
|
| |\ \ \ \ \ \ \
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | |
| | | | | | | | | |
Conflicts:
src/compiler/scala/tools/nsc/typechecker/Duplicators.scala
src/library/scala/concurrent/Future.scala
test/files/jvm/scala-concurrent-tck.scala
|
| | |\ \ \ \ \ \ \
| | | | | | | | | |
| | | | | | | | | | |
SI-7571 Allow nesting of anonymous classes in value classes
|
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | |
| | | | | | | | | | |
5d9cde105e added deep prohibition of nested classes within
a value class. This has the undesirable side effect of
prohibiting partial functions literals in method bodies
of a value class.
The intention of that prohibition was to avoid problems
in code using Type Tests, such as:
class C(val inner: A) extends AnyVal {
class D
}
def foo(a: Any, other: C) = a match { case _ : other.D }
Here, the pattern usually checks that `a.$outer == other`.
But that is incongruent with the way that `other` is erased
to `A`.
However, not all nested classes could lead us into this trap.
This commit slightly relaxes the restriction to allow anonymous
classes, which can't appear in a type test.
The test shows that the translation generates working code.
|
| | |\ \ \ \ \ \ \ \
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
viktorklang/wip-cleaner-Future-method-implementations-2.10-√
General SIP-14 Future method implementation cleanup
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
- there were numerous logical issues with the former implementation
- failed assertions may not fail the build
- there was a lot of ceremony and noise
|
| | |\ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
SI-7343 Fixed phase ordering in specialization
|
| | | | |/ / / / / / /
| | | |/| | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
Specialization rewires class parents during info transformation, and
the new info then guides the tree changes. But if a symbol is created
during duplication, which runs after specialization, its info is not
visited and thus the corresponding tree is not specialized.
One manifestation is the following:
```
object Test {
class Parent[@specialized(Int) T]
def spec_method[@specialized(Int) T](t: T, expectedXSuper: String) = {
class X extends Parent[T]()
// even in the specialized variant, the local X class
// doesn't extend Parent$mcI$sp, since its symbol has
// been created after specialization and was not seen
// by specialzation's info transformer.
...
}
}
```
We can fix this by forcing duplication to take place before specialization.
Review by @dragos, @paulp or @axel22.
|
| | |\ \ \ \ \ \ \ \ \
| | | | | | | | | | | |
| | | | | | | | | | | | |
[backport] relax time constraint in duration-tck.scala (for Windows VMs)
|
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | |
| | | | | | | | | | | | |
(cherry picked from commit 3e0fbc0193f0b6f58dc16dae3824677e9902dc7b)
|
|\ \ \ \ \ \ \ \ \ \ \ \
| |_|_|_|_|_|_|/ / / / /
|/| | | | | | | | | | | |
SI-7591 Migrate command-line parsing to s.t.cmd
|
| | | | | | | | | | | | |
|
| | |_|_|_|_|_|_|_|_|/
| |/| | | | | | | | | |
|
|\ \ \ \ \ \ \ \ \ \ \
| |/ / / / / / / / / /
|/| | | | | | | | | | |
new bytecode emitter, GenBCode (11th attempt)
|
| | | | | | | | | | | |
|
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | |
| | | | | | | | | | | |
The GenASM-based fix for SI-5031 is 0527b2549bcada2fda2201daa630369b377d0877
|
| | | | | | | | | | | |
|