diff options
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/trait_fields_var_override.check | 5 | ||||
-rw-r--r-- | test/files/neg/trait_fields_var_override.scala | 2 | ||||
-rw-r--r-- | test/files/pos/trait_fields_var_override_deferred.scala | 2 |
3 files changed, 9 insertions, 0 deletions
diff --git a/test/files/neg/trait_fields_var_override.check b/test/files/neg/trait_fields_var_override.check new file mode 100644 index 0000000000..7245c78b09 --- /dev/null +++ b/test/files/neg/trait_fields_var_override.check @@ -0,0 +1,5 @@ +trait_fields_var_override.scala:2: error: overriding variable end in trait SizeChangeEvent of type Int; + variable end cannot override a mutable variable +class BackedUpListIterator[E](override protected var end: Int) extends SizeChangeEvent + ^ +one error found diff --git a/test/files/neg/trait_fields_var_override.scala b/test/files/neg/trait_fields_var_override.scala new file mode 100644 index 0000000000..f61ba09eec --- /dev/null +++ b/test/files/neg/trait_fields_var_override.scala @@ -0,0 +1,2 @@ +trait SizeChangeEvent { protected var end: Int = 1 } +class BackedUpListIterator[E](override protected var end: Int) extends SizeChangeEvent diff --git a/test/files/pos/trait_fields_var_override_deferred.scala b/test/files/pos/trait_fields_var_override_deferred.scala new file mode 100644 index 0000000000..0205326506 --- /dev/null +++ b/test/files/pos/trait_fields_var_override_deferred.scala @@ -0,0 +1,2 @@ +trait SizeChangeEvent { protected var end: Int } +class BackedUpListIterator[E](override protected var end: Int) extends SizeChangeEvent |