diff options
author | Stefan Zeiger <szeiger@novocode.com> | 2016-08-29 20:31:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-29 20:31:25 +0200 |
commit | 4d3fd6d7ad08f9786f98ddb7c5fc7075dc7002e5 (patch) | |
tree | 18ee2ba940f35cb205541ae0b6edc01ea91b2b74 /test | |
parent | cf23cbcdd01383a929af3714329b48a7b8e1de39 (diff) | |
parent | 0fbb427a2d0c20dd20d046249f37164b46eb602d (diff) | |
download | scala-4d3fd6d7ad08f9786f98ddb7c5fc7075dc7002e5.tar.gz scala-4d3fd6d7ad08f9786f98ddb7c5fc7075dc7002e5.tar.bz2 scala-4d3fd6d7ad08f9786f98ddb7c5fc7075dc7002e5.zip |
Merge pull request #5367 from adriaanm/fields-widen-trait-var
Ensure trait var accessor type is widened
Diffstat (limited to 'test')
-rw-r--r-- | test/files/pos/fields_widen_trait_var.scala | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/files/pos/fields_widen_trait_var.scala b/test/files/pos/fields_widen_trait_var.scala new file mode 100644 index 0000000000..0ea9d9629a --- /dev/null +++ b/test/files/pos/fields_widen_trait_var.scala @@ -0,0 +1,4 @@ +// check that the `var x` below is assigned the type `Int`, and not `Constant(0)`, +// and that we can assign to it (if it gets a constant type, the `x` in `x = 42` +// is constant-folded to `0` and we can't find a setter.. +trait C { protected final var x = 0; x = 42 } |