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/t5923d/Macros_1.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/t5923d/Macros_1.scala')
-rw-r--r-- | test/files/run/t5923d/Macros_1.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/test/files/run/t5923d/Macros_1.scala b/test/files/run/t5923d/Macros_1.scala new file mode 100644 index 0000000000..f32d1af704 --- /dev/null +++ b/test/files/run/t5923d/Macros_1.scala @@ -0,0 +1,9 @@ +import scala.language.experimental.macros +import scala.reflect.macros.Context + +trait MappedRow +trait RowMapper[T <: MappedRow] +object RowMapper { + implicit def mapper[T <: MappedRow]: RowMapper[T] = macro impl[T] + def impl[T <: MappedRow : c.WeakTypeTag](c: Context) = c.universe.reify(new RowMapper[T]{}) +}
\ No newline at end of file |