summaryrefslogtreecommitdiff
path: root/test/files/neg/t4541b.scala
diff options
context:
space:
mode:
authorAleksandar Prokopec <axel22@gmail.com>2012-06-18 19:33:06 +0200
committerAleksandar Prokopec <axel22@gmail.com>2012-06-18 19:33:06 +0200
commita83586a4815acd35df0801ed0e9f067e113c8664 (patch)
treef0efc810997d6d4089dadd5c443a00c10a63d09d /test/files/neg/t4541b.scala
parent9a28ee1ffc085bc680c48b12ad632b9133adf020 (diff)
downloadscala-a83586a4815acd35df0801ed0e9f067e113c8664.tar.gz
scala-a83586a4815acd35df0801ed0e9f067e113c8664.tar.bz2
scala-a83586a4815acd35df0801ed0e9f067e113c8664.zip
Fix SI-4541.
Catch type errors when duplicating trees. In this case, to access a protected member from a specialized class is an error, so we would have to make the member public anyway. Better it is then to report an error and have the user make the field public explicitly. Review by @dragos.
Diffstat (limited to 'test/files/neg/t4541b.scala')
-rw-r--r--test/files/neg/t4541b.scala16
1 files changed, 16 insertions, 0 deletions
diff --git a/test/files/neg/t4541b.scala b/test/files/neg/t4541b.scala
new file mode 100644
index 0000000000..7a21ffc156
--- /dev/null
+++ b/test/files/neg/t4541b.scala
@@ -0,0 +1,16 @@
+
+
+
+
+
+@SerialVersionUID(1L)
+final class SparseArray[@specialized(Int) T](private var data: Array[T]) extends Serializable {
+ def use(inData: Array[T]) = {
+ data = inData;
+ }
+
+ def set(that: SparseArray[T]) = {
+ use(that.data.clone)
+ }
+}
+