diff options
author | Adriaan Moors <adriaan@lightbend.com> | 2016-08-29 11:55:33 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-29 11:55:33 +0200 |
commit | 66430e076dbe79553c930878aa47f183767c68af (patch) | |
tree | 747e29678c67330b02bc422bd330c978c3d16ced /test/pending | |
parent | 3304bc33987f5821912bb0c7371b5e9a115c893d (diff) | |
parent | 8ef3e6e47098786f9522ebcaffaa261d8f240308 (diff) | |
download | scala-66430e076dbe79553c930878aa47f183767c68af.tar.gz scala-66430e076dbe79553c930878aa47f183767c68af.tar.bz2 scala-66430e076dbe79553c930878aa47f183767c68af.zip |
Merge pull request #5280 from retronym/ticket/8079
SI-8079 Only expand local aliases during variance checks
Diffstat (limited to 'test/pending')
-rw-r--r-- | test/pending/neg/t8079d.check | 4 | ||||
-rw-r--r-- | test/pending/neg/t8079d.scala | 4 | ||||
-rw-r--r-- | test/pending/pos/t8079c.scala | 7 |
3 files changed, 15 insertions, 0 deletions
diff --git a/test/pending/neg/t8079d.check b/test/pending/neg/t8079d.check new file mode 100644 index 0000000000..f63f4902f8 --- /dev/null +++ b/test/pending/neg/t8079d.check @@ -0,0 +1,4 @@ +t8079d.scala:3: error: contravariant type I occurs in covariant position in type C.this.X of value b + def f2(b: X): Unit + ^ +one error found diff --git a/test/pending/neg/t8079d.scala b/test/pending/neg/t8079d.scala new file mode 100644 index 0000000000..ad420b99e3 --- /dev/null +++ b/test/pending/neg/t8079d.scala @@ -0,0 +1,4 @@ +trait C[-I] { + protected[this] type X = C[I] + def f2(b: X): Unit +} diff --git a/test/pending/pos/t8079c.scala b/test/pending/pos/t8079c.scala new file mode 100644 index 0000000000..ae7f37e2bf --- /dev/null +++ b/test/pending/pos/t8079c.scala @@ -0,0 +1,7 @@ +trait F1[/* - */T, /* + */ R] + +object Test { + import scala.annotation.unchecked._ + private[this] type VariantF1[-T, +R] = F1[T @uncheckedVariance, R @uncheckedVariance] + trait C[+T] { def foo: VariantF1[Any, T] } +} |