aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-01 16:00:10 +0200
committerDmitry Petrashko <dmitry.petrashko@gmail.com>2015-05-05 20:08:31 +0200
commitcb8fa8278ce690a800e6454d3fcd2058100e0d71 (patch)
tree93da5de061eaf0eaf98b0162401f3f416b200e40 /src
parent6bbf35496c2cb4f4b4fa55ef80b4eaa85e0de63f (diff)
downloaddotty-cb8fa8278ce690a800e6454d3fcd2058100e0d71.tar.gz
dotty-cb8fa8278ce690a800e6454d3fcd2058100e0d71.tar.bz2
dotty-cb8fa8278ce690a800e6454d3fcd2058100e0d71.zip
It seems one cannot define clone member in scala trait. Do it in Java.
[error] /Users/dark/workspace/dotty/src/dotty/runtime/vc/VCPrototype.scala:10: overriding method clone in class VCArrayPrototype of type ()Object; [error] method clone in class Object of type ()Object has weaker access privileges; it should be public; [error] (Note that method clone in class VCArrayPrototype of type ()Object is abstract, [error] and is therefore overridden by concrete method clone in class Object of type ()Object) [error] abstract class VCArrayPrototype[T <: VCPrototype] extends Object with Cloneable {
Diffstat (limited to 'src')
-rw-r--r--src/dotty/runtime/vc/VCArrayClone.java9
-rw-r--r--src/dotty/runtime/vc/VCPrototype.scala3
2 files changed, 11 insertions, 1 deletions
diff --git a/src/dotty/runtime/vc/VCArrayClone.java b/src/dotty/runtime/vc/VCArrayClone.java
new file mode 100644
index 000000000..0b0fa40ce
--- /dev/null
+++ b/src/dotty/runtime/vc/VCArrayClone.java
@@ -0,0 +1,9 @@
+package dotty.runtime.vc;
+
+/**
+ * Exists for the sole reason of Scala not accepting such trait
+ */
+
+interface VCArrayClone {
+ Object clone();
+}
diff --git a/src/dotty/runtime/vc/VCPrototype.scala b/src/dotty/runtime/vc/VCPrototype.scala
index b9c931bbc..a91654864 100644
--- a/src/dotty/runtime/vc/VCPrototype.scala
+++ b/src/dotty/runtime/vc/VCPrototype.scala
@@ -3,7 +3,8 @@ package dotty.runtime.vc
abstract class VCPrototype {
}
-abstract class VCArrayPrototype[T <: VCPrototype] extends Cloneable {
+
+abstract class VCArrayPrototype[T <: VCPrototype] extends Object with Cloneable with VCArrayClone {
def apply(idx: Int): Object
def update(idx: Int, el: T): Unit
def length: Int