diff options
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/fields_widen_trait_var.scala | 4 | ||||
-rw-r--r-- | test/files/pos/t8079b.scala | 7 |
2 files changed, 11 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 } diff --git a/test/files/pos/t8079b.scala b/test/files/pos/t8079b.scala new file mode 100644 index 0000000000..f3b7b78077 --- /dev/null +++ b/test/files/pos/t8079b.scala @@ -0,0 +1,7 @@ +trait F1[/* - */T, /* + */ R] + +object Test { + import scala.annotation.unchecked._ + type VariantF1[-T, +R] = F1[T @uncheckedVariance, R @uncheckedVariance] + trait C[+T] { def foo: VariantF1[Any, T] } +} |