forked from gkossakowski/build-play20
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathscala_stm.diff
82 lines (79 loc) · 2.91 KB
/
scala_stm.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
diff --git a/build.sbt b/build.sbt
index 7b48866..dfe73ce 100644
--- a/build.sbt
+++ b/build.sbt
@@ -5,48 +5,4 @@ organization := "org.scala-tools"
version := "0.5"
-scalaVersion := "2.9.1"
-
-crossScalaVersions := Seq("2.9.1", "2.9.0-1", "2.9.0", "2.8.2", "2.8.1")
-
-// 2.8.* -> 1.5.1, 2.9.* -> 1.6.1
-libraryDependencies += ("org.scalatest" %% "scalatest" % "[1.5,)" % "test")
-
-libraryDependencies += ("junit" % "junit" % "4.5" % "test")
-
-// skip exhaustive tests
-testOptions += Tests.Argument("-l", "slow")
-
-// test of TxnExecutor.transformDefault must be run by itself
-parallelExecution in Test := false
-
-////////////////////
-// publishing
-
-publishMavenStyle := true
-
-publishTo <<= (version) { v: String =>
- val nexus = "http://nexus.scala-tools.org/content/repositories/"
- if (v.trim.endsWith("SNAPSHOT"))
- Some("snapshots" at nexus + "snapshots/")
- else
- Some("releases" at nexus + "releases/")
- }
-
-// exclude scalatest from the Maven POM
-pomPostProcess := { xi: scala.xml.Node =>
- import scala.xml._
- val badDep = (xi \\ "dependency") find {
- x => (x \ "groupId").text == "org.scalatest"
- }
- def filt(root: Node): Node = root match {
- case x: Elem => {
- val ch = x.child filter { Some(_) != badDep } map { filt(_) }
- Elem(x.prefix, x.label, x.attributes, x.scope, ch: _*)
- }
- case x => x
- }
- filt(xi)
- }
-
-credentials += Credentials(Path.userHome / ".ivy2" / ".credentials")
+scalaVersion := "2.10.0-virtualized-SNAPSHOT"
\ No newline at end of file
diff --git a/project/build.properties b/project/build.properties
new file mode 100644
index 0000000..390c1af
--- /dev/null
+++ b/project/build.properties
@@ -0,0 +1 @@
+sbt.version=0.11.3
\ No newline at end of file
diff --git a/src/main/scala/scala/concurrent/stm/Ref.scala b/src/main/scala/scala/concurrent/stm/Ref.scala
index 1e6aa6c..ba6fdd8 100644
--- a/src/main/scala/scala/concurrent/stm/Ref.scala
+++ b/src/main/scala/scala/concurrent/stm/Ref.scala
@@ -203,12 +203,12 @@ trait RefCompanion {
* }}}
*/
def apply[A](initialValue: A)(implicit om: OptManifest[A]): Ref[A] = om match {
- case m: AnyValManifest[_] => newPrimitiveRef(initialValue, m.asInstanceOf[AnyValManifest[A]])
+ case m: AnyValManifest[_] => newPrimitiveRef[AnyVal](initialValue.asInstanceOf[AnyVal], m.asInstanceOf[AnyValManifest[AnyVal]]).asInstanceOf[Ref[A]]
case m: ClassManifest[_] => factory.newRef(initialValue)(m.asInstanceOf[ClassManifest[A]])
case _ => factory.newRef[Any](initialValue).asInstanceOf[Ref[A]]
}
- private def newPrimitiveRef[A](initialValue: A, m: AnyValManifest[A]): Ref[A] = {
+ private def newPrimitiveRef[A <: AnyVal](initialValue: A, m: AnyValManifest[A]): Ref[A] = {
(m.newArray(0).asInstanceOf[AnyRef] match {
case _: Array[Int] => apply(initialValue.asInstanceOf[Int])
case _: Array[Boolean] => apply(initialValue.asInstanceOf[Boolean])