diff options
author | Martin Odersky <odersky@gmail.com> | 2017-03-02 18:14:24 +0100 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2017-03-02 18:14:30 +0100 |
commit | 10d868ce335d1ecbb0a6acb8d4bd804d76edcac9 (patch) | |
tree | 92523271c9bbeddee77f2ff7a0f19287e6962f60 /tests/pos/t5070.scala | |
parent | 4c6a69ec075de6948f2c82778f6ccf7a30b6bc70 (diff) | |
download | dotty-10d868ce335d1ecbb0a6acb8d4bd804d76edcac9.tar.gz dotty-10d868ce335d1ecbb0a6acb8d4bd804d76edcac9.tar.bz2 dotty-10d868ce335d1ecbb0a6acb8d4bd804d76edcac9.zip |
More tests
and a typo fixed
Diffstat (limited to 'tests/pos/t5070.scala')
-rw-r--r-- | tests/pos/t5070.scala | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/pos/t5070.scala b/tests/pos/t5070.scala index 410afba14..0e5c0ffc0 100644 --- a/tests/pos/t5070.scala +++ b/tests/pos/t5070.scala @@ -13,3 +13,26 @@ class Test { implicitly[a.T](b(a)) // works } + + +class ImplicitVsTypeAliasTezt { + + class Monad[m[_]] { + type For[a] = _For[m, a] + implicit def toFor[a](m: m[a]): For[a] = throw new Error("todo") // lookup fails +// implicit def toFor[a](m: m[a]): _For[m, a] = throw new Error("todo") // fine. + } + + trait _For[m[_], a] { + def map[b](p: a => b): m[b] + } + + def useMonad[m[_], a](m: m[a])(implicit i: Monad[m]) = { + import i._ + + // value map is not a member of type parameter m[a] + for { + x <- m + } yield x.toString + } +} |