diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-23 23:35:21 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-23 23:35:21 -0700 |
commit | f0ca5aec4c575fe297adcd3e2b16018fff4a0639 (patch) | |
tree | 2fe768432cdbea44d4a1cd98756771d2e9065c8a /test/files/pos | |
parent | 43dcfd07610f0b17906159c79c1cb1611be14f82 (diff) | |
parent | 733b3220c9c099fcb68e09c37251bea8023198f2 (diff) | |
download | scala-f0ca5aec4c575fe297adcd3e2b16018fff4a0639.tar.gz scala-f0ca5aec4c575fe297adcd3e2b16018fff4a0639.tar.bz2 scala-f0ca5aec4c575fe297adcd3e2b16018fff4a0639.zip |
Merge pull request #2919 from retronym/ticket/7815
SI-7815 Dealias before deeming method type as dependent
Diffstat (limited to 'test/files/pos')
-rw-r--r-- | test/files/pos/t7815.scala | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/files/pos/t7815.scala b/test/files/pos/t7815.scala new file mode 100644 index 0000000000..12a434c5b0 --- /dev/null +++ b/test/files/pos/t7815.scala @@ -0,0 +1,30 @@ +import language.higherKinds + +trait Foo[A <: AnyRef] { + type Repr + def f(a: A): Repr + def g(a: A): Option[Repr] + + type M[X] + def m(a: A): M[a.type] + + type Id[X] = X + def n(a: A): Id[(Repr, M[a.type])] + +} + +object Foo { + type Aux[A <: AnyRef, B] = Foo[A] { type Repr = B; type M[X] = Int } + +} + +object Main extends App { + def mapWithFoo[A <: AnyRef, B](as: List[A])(implicit foo: Foo.Aux[A, B]) = { + // Should be Eta expandable because the result type of `f` is not + // dependant on the value, it is just `B`. + as map foo.f + as map foo.g + as map foo.m + as map foo.n + } +} |