From a83586a4815acd35df0801ed0e9f067e113c8664 Mon Sep 17 00:00:00 2001 From: Aleksandar Prokopec Date: Mon, 18 Jun 2012 19:33:06 +0200 Subject: 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. --- test/files/neg/t4541.scala | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 test/files/neg/t4541.scala (limited to 'test/files/neg/t4541.scala') diff --git a/test/files/neg/t4541.scala b/test/files/neg/t4541.scala new file mode 100644 index 0000000000..744af1c288 --- /dev/null +++ b/test/files/neg/t4541.scala @@ -0,0 +1,16 @@ + + + + + + +@SerialVersionUID(1L) +final class Sparse[@specialized(Int) T](d: Array[T]) extends Serializable { + protected var data: Array[T] = d + def set(that: Sparse[T]) = { + that.data + } +} + + + -- cgit v1.2.3