aboutsummaryrefslogtreecommitdiff
path: root/tests/pos/capturedVars.scala
diff options
context:
space:
mode:
Diffstat (limited to 'tests/pos/capturedVars.scala')
-rw-r--r--tests/pos/capturedVars.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests/pos/capturedVars.scala b/tests/pos/capturedVars.scala
new file mode 100644
index 000000000..2cbcf111a
--- /dev/null
+++ b/tests/pos/capturedVars.scala
@@ -0,0 +1,25 @@
+class Test {
+
+ var field: Int = _
+
+ def foo() = {
+
+ var x: Int = 1
+ var y: String = "abc"
+ @volatile var vx: Double = 2
+ @volatile var vo: Exception = null
+ var xs: Array[Int] = Array(1, 2, 3)
+ val xs1: Object = xs
+
+ def inner() = {
+ field = x
+ x = x + 1 + field
+ y += "d"
+ vx = x * 2
+ vo = vo
+ xs(0) = xs(1)
+ xs = xs.clone
+ }
+ }
+}
+