diff options
author | Eugene Burmako <xeno.by@gmail.com> | 2013-04-30 21:14:06 +0200 |
---|---|---|
committer | Eugene Burmako <xeno.by@gmail.com> | 2013-08-13 05:36:33 +0200 |
commit | 21a8c6c7558a67b642b6827f716b1aba2244c97f (patch) | |
tree | b54f9da9a1a1e263ce0e614a1282dc96b15b77ac /test/files/run/t5923c/Test_2.scala | |
parent | 4c62f7db6f3913eedd92d85daf8f631149cc97b2 (diff) | |
download | scala-21a8c6c7558a67b642b6827f716b1aba2244c97f.tar.gz scala-21a8c6c7558a67b642b6827f716b1aba2244c97f.tar.bz2 scala-21a8c6c7558a67b642b6827f716b1aba2244c97f.zip |
SI-7470 implements fundep materialization
This fix provides implicit macros with an ability to affect type inference
in a more or less sane manner. That's crucial for materialization of
multi-parametric type class instances (e.g. Iso's from shapeless).
Details of the technique can be found in comments.
Diffstat (limited to 'test/files/run/t5923c/Test_2.scala')
-rw-r--r-- | test/files/run/t5923c/Test_2.scala | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/test/files/run/t5923c/Test_2.scala b/test/files/run/t5923c/Test_2.scala new file mode 100644 index 0000000000..a00f4ed7db --- /dev/null +++ b/test/files/run/t5923c/Test_2.scala @@ -0,0 +1,12 @@ +// see the comments for macroExpandApply.onDelayed for an explanation of what's tested here +object Test extends App { + case class Foo(i: Int, s: String, b: Boolean) + def foo[C, L](c: C)(implicit iso: Iso[C, L]): L = iso.to(c) + + { + val equiv = foo(Foo(23, "foo", true)) + def typed[T](t: => T) {} + typed[(Int, String, Boolean)](equiv) + println(equiv) + } +}
\ No newline at end of file |