diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-08-05 10:58:25 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2015-08-05 11:04:04 -0700 |
commit | ecf9128d8bf7a965492f0b714876650bba66b040 (patch) | |
tree | 406db7c5db708d03891b463613e3ecd8f210ce19 /test/files/run | |
parent | b8744bafd7a9b3836932cd8348cc6d7cc83cec17 (diff) | |
parent | 928e6892d4fc10a953e0121fbefcae54bff1ab0c (diff) | |
download | scala-ecf9128d8bf7a965492f0b714876650bba66b040.tar.gz scala-ecf9128d8bf7a965492f0b714876650bba66b040.tar.bz2 scala-ecf9128d8bf7a965492f0b714876650bba66b040.zip |
Merge branch '2.11.x' into 2.12.x
Transcript:
```
➜ scala git:(2.12.x) export MB=$(git merge-base 2.12.x 2.11.x)
➜ scala git:(2.12.x) echo $MB
0e9525aa618a2eca143a1c7379ff1e6efd23b86e
➜ scala git:(2.12.x) g log --oneline --graph $MB...2.11.x
```
Read this upside down :-). The last merge comes first,
with merge commands interspersed in the git log.
```
➜ scala git:(2.12.x) g merge 2.11.x
Auto-merging versions.properties
Auto-merging src/reflect/scala/reflect/internal/pickling/UnPickler.scala
Auto-merging src/reflect/scala/reflect/internal/Types.scala
Auto-merging src/reflect/scala/reflect/internal/TreeGen.scala
Auto-merging src/library/scala/collection/immutable/Stream.scala
Auto-merging src/library/scala/collection/convert/Wrappers.scala
Auto-merging build.xml
CONFLICT (content): Merge conflict in build.xml
Auto-merging README.md
Automatic merge failed; fix conflicts and then commit the result.
```
```
* 928e6892d4 (scala/2.11.x, 2.11.x) Merge pull request #4682 from adriaanm/jline-quick.bin
|\
| * b763dbf368 (adriaanm/jline-quick.bin, jline-quick.bin) Include jline on quick.bin tool path
* | ccded7d179 Merge pull request #4680 from janekdb/2.11.x-option
|\ \
| |/
|/|
| * 58ae3e51f7 Delegate null test to Option
|/
* a745f06e35 Merge pull request #4670 from retronym/ticket/9422
|\
| * ec95e534a2 SI-9422 Fix incorrect constant propagation
* 65fa73dff3 Merge pull request #4669 from janekdb/2.11.x-scaladoc-reflect
|\
| * e206a1837d ScalaDoc fixes for reflect
* | 8e7e3b4a5f Merge pull request #4667 from janekdb/2.11.x-scaladoc-library-library-aux
|\ \
| |/
|/|
| * 69c2c106fe ScalaDoc fixes for library and library-aux
* | 7de4cbc5e5 Merge pull request #4665 from lrytz/asm-504-3
|\ \
| * | cdc55c29d0 Upgrade scala-asm to 5.0.4-scala-3
|/ /
* | d8da39a197 Merge pull request #4661 from retronym/ticket/9365
|\ \
| * | 0c99742c51 SI-9365 Don't null out dependencies of transient lazy vals
| /
* | 2279d3f3d9 Merge pull request #4662 from janekdb/2.11.x-redundant-val-modifier
|\ \
| * | 173a6fad95 Remove redundant 'val' from case class params.
* | | e0d21432d6 Merge pull request #4664 from SethTisue/remove-dead-link-in-readme
|\ \ \
| |_|/
|/| |
| * | 600fc4e6e1 fix readme for death of typesafe.artifactoryonline.com
| |/
* | 7492bda816 Merge pull request #4636 from SethTisue/contributor-stuff-from-github-wiki
|\ \
| |/
|/|
| * ed5098dbc4 merge two reviewers lists in readme
| * e136e4ad47 tighten up CONTRIBUTING.md a little
| * f9ca6863d4 readme/contributor's guide tweaks
| * 80e98b03a1 tiny readme fix
| * 197845620c merge in text from pull request policy from old wiki
| * e93ca409ae drop in pull request policy from old wiki
| * 951939d1b3 contributor guide: add a morsel salvaged from GitHub wiki
* f682441f6f Merge pull request #4653 from lrytz/t9403
|\
| * 2678d349b2 SI-9403 fix ICodeReader for negative BIPUSH / SIPUSH values
```
```
➜ scala git:(2.12.x) g merge -s ours f2d7838d90
Merge made by the 'ours' strategy.
```
```
* f2d7838d90 Merge pull request #4657 from lrytz/backports
|\
| * 241bb9ac19 Rename the ENUM / DEFAULTMETHOD flags to include JAVA_
| * 7a7f9927c3 SI-9393 fix modifiers of ClassBTypes for Java annotations
| * 8946d60bd2 [backport] Fix bytecode stability when running the closure optimizer
| * 3b6b2bfe9f [backport] SI-9392 Clarify the workaround comment and introduce a devWarning
| * 091c1e6ed8 [backport] SI-9392 Avoid crash in GenBCode for incoherent trees
| * 6177cb4481 [backport] SI-9393 Temporarily disable two assertions in GenBCode
| * a1d471f7ba [backport] Refactor the ClosureOptimizer, run ProdCons only once per method
| * f5e72765f2 [backport] SI-9387 Fix VerifyError introduced by indylambda
| * 41b99e2531 [backport] Integrate the LMFInvokeDynamic extractor into LambdaMetaFactoryCall
| * fc1cda2118 [backport] Small refactoring to the closure optimizer
| * 8f272c0ad2 [backport] Accessibility checks for methods with an InvokeDynamic instruction
| * 1c1d8259b5 [backport] Fix bytecode stability
| * ef9d845676 [backport] Support methodHandle / invokeDynamic constant pool entries in scalap
| * 60747c7555 [backport] Skip mirror class when invoking deserializeLambda
| * 404e86239e [backport] Prevent infinite recursion in ProdConsAnalyzer
| * 1b0703e74d [backport] SI-9376 don't crash when inlining a closure body that throws.
| * e511375a90 [backport] Fix superclass for Java interface symbols created in JavaMirrors
| * 1b57723169 [backport] `deserializeLambda` should not use encoded class name
| * 8bafa8ed88 [backport] Java parser: default methods in interfaces are not `DEFERRED`
| * 44e2761a9b [backport] SI-6613 fixed in GenBCode
```
```
➜ scala git:(2.12.x) g merge 4c6dcfe934
Auto-merging src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala
Auto-merging doc/License.rtf
Auto-merging doc/LICENSE.md
Auto-merging build.xml
Auto-merging build.sbt
Merge made by the 'recursive' strategy.
Auto packing the repository in background for optimum performance.
See "git help gc" for manual housekeeping.
build.sbt | 2 +-
build.xml | 2 +-
doc/LICENSE.md | 4 ++--
doc/License.rtf | 4 ++--
src/scaladoc/scala/tools/nsc/doc/html/page/Template.scala | 2 +-
src/scalap/decoder.properties | 2 +-
6 files changed, 8 insertions(+), 8 deletions(-)
```
```
* | 4c6dcfe934 Merge pull request #4656 from lrytz/filtersOpenJDK
|\ \
| |/
|/|
| * 0b35bc29aa Ignore OpenJDK warnings in partest filters
* 6eb0812050 Merge pull request #4644 from SethTisue/copyright-2015
* e0aac7c9ef bump copyright year to 2015
```
Diffstat (limited to 'test/files/run')
-rw-r--r-- | test/files/run/t720.scala | 48 | ||||
-rw-r--r-- | test/files/run/t9365.check | 2 | ||||
-rw-r--r-- | test/files/run/t9365.scala | 18 | ||||
-rw-r--r-- | test/files/run/t9403.flags | 1 | ||||
-rw-r--r-- | test/files/run/t9403/C_1.scala | 5 | ||||
-rw-r--r-- | test/files/run/t9403/Test_2.scala | 29 | ||||
-rw-r--r-- | test/files/run/t9422.scala | 11 |
7 files changed, 114 insertions, 0 deletions
diff --git a/test/files/run/t720.scala b/test/files/run/t720.scala new file mode 100644 index 0000000000..a5cb2495cf --- /dev/null +++ b/test/files/run/t720.scala @@ -0,0 +1,48 @@ +class Lazy(f: => Int) { + lazy val get: Int = f +} + +class UsedLater(f: => Int) { + lazy val get: Int = f + def other = f +} + +class TransientLazy(f: => Int) { + @transient + lazy val get: Int = f +} + +object Test { + def main(args: Array[String]): Unit = { + testLazy() + testUsedLater() + } + + def testLazy() { + val o = new Lazy("".length) + val f = classOf[Lazy].getDeclaredField("f") + f.setAccessible(true) + assert(f.get(o) != null) + o.get + assert(f.get(o) == null) + } + + def testUsedLater() { + val o = new UsedLater("".length) + val f = classOf[UsedLater].getDeclaredField("f") + f.setAccessible(true) + assert(f.get(o) != null) + o.get + assert(f.get(o) != null) + } + + def testTransientLazy() { + val o = new TransientLazy("".length) + val f = classOf[TransientLazy].getDeclaredField("f") + f.setAccessible(true) + assert(f.get(o) != null) + o.get + assert(f.get(o) != null) // SI-9365 + } +} + diff --git a/test/files/run/t9365.check b/test/files/run/t9365.check new file mode 100644 index 0000000000..0d55bed3a3 --- /dev/null +++ b/test/files/run/t9365.check @@ -0,0 +1,2 @@ +foo +foo diff --git a/test/files/run/t9365.scala b/test/files/run/t9365.scala new file mode 100644 index 0000000000..0c4477dda9 --- /dev/null +++ b/test/files/run/t9365.scala @@ -0,0 +1,18 @@ +class Test(x: => Object) extends Serializable { + @transient lazy val foo = x +} + +object Test { + def main(args: Array[String]): Unit = { + import java.io._ + val t = new Test("foo") + println(t.foo) + val baos = new ByteArrayOutputStream + val dos = new ObjectOutputStream(baos) + dos.writeObject(t) + dos.close() + val dis = new ObjectInputStream(new ByteArrayInputStream(baos.toByteArray())) + val t1 = dis.readObject().asInstanceOf[Test] + println(t1.foo) // was NPE + } +} diff --git a/test/files/run/t9403.flags b/test/files/run/t9403.flags new file mode 100644 index 0000000000..307668060c --- /dev/null +++ b/test/files/run/t9403.flags @@ -0,0 +1 @@ +-Ybackend:GenASM -optimize diff --git a/test/files/run/t9403/C_1.scala b/test/files/run/t9403/C_1.scala new file mode 100644 index 0000000000..439af1a386 --- /dev/null +++ b/test/files/run/t9403/C_1.scala @@ -0,0 +1,5 @@ +package p +class C { + @inline final def f(x: Int): Long = 10L / (if (x < 0) -2 else 2) + @inline final def g(x: Int): Long = 3000L / (if (x < 0) -300 else 300) +} diff --git a/test/files/run/t9403/Test_2.scala b/test/files/run/t9403/Test_2.scala new file mode 100644 index 0000000000..fb2777b9a8 --- /dev/null +++ b/test/files/run/t9403/Test_2.scala @@ -0,0 +1,29 @@ +import p.C +import scala.tools.asm.Opcodes +import scala.tools.partest.BytecodeTest +import scala.tools.partest.ASMConverters._ + + +object Test extends BytecodeTest { + def foo(c: C, x: Int) = c.f(x) + def goo(c: C, x: Int) = c.g(x) + + def has(i: Instruction, c: String, m: String) = { + val cls = loadClassNode(c) + val mth = convertMethod(getMethod(cls, m)) + assert(mth.instructions.contains(i)) + } + + def show(): Unit = { + assert(foo(new C, -2) == -5L) + assert(goo(new C, -2) == -10L) + + val bipush2 = IntOp(Opcodes.BIPUSH, -2) + has(bipush2, "p.C", "f") + has(bipush2, "Test$", "foo") + + val sipush300 = IntOp(Opcodes.SIPUSH, -300) + has(sipush300, "p.C", "g") + has(sipush300, "Test$", "goo") + } +} diff --git a/test/files/run/t9422.scala b/test/files/run/t9422.scala new file mode 100644 index 0000000000..5ca2e8daaa --- /dev/null +++ b/test/files/run/t9422.scala @@ -0,0 +1,11 @@ +class Test(val x: Long) { + def sameDirection(y: Long): Boolean = + (y == 0 || x == 0 || ((y > 0) == (x > 0))) +} + +object Test { + def main(args: Array[String]) { + val b = new Test(1L) + assert(!b.sameDirection(-1L)) + } +} |