diff options
author | Den Shabalin <den.shabalin@gmail.com> | 2013-09-05 13:27:54 +0200 |
---|---|---|
committer | Den Shabalin <den.shabalin@gmail.com> | 2013-09-05 14:39:12 +0200 |
commit | 800f5acd0d7117bf953829da7c6d955e61e63bdc (patch) | |
tree | f7a28dbe2888cb6a2ba39a751c6dd24a296979d5 /test/files | |
parent | 1585b52b6cbf2e2985ef3a02009466e56baf6e74 (diff) | |
download | scala-800f5acd0d7117bf953829da7c6d955e61e63bdc.tar.gz scala-800f5acd0d7117bf953829da7c6d955e61e63bdc.tar.bz2 scala-800f5acd0d7117bf953829da7c6d955e61e63bdc.zip |
add support for function type splicing and extraction
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/scalacheck/quasiquotes/TypeConstructionProps.scala | 6 | ||||
-rw-r--r-- | test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala b/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala index 459d733733..cac83ff8ac 100644 --- a/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/TypeConstructionProps.scala @@ -27,4 +27,10 @@ object TypeConstructionProps extends QuasiquoteProperties("type construction") val stats = q"def foo" :: q"val x: Int" :: q"type Y = String" :: Nil assert(tq"T { ..$stats }" ≈ tq"T { def foo; val x: Int; type Y = String }") } + + property("function type") = test { + val argtpes = tq"A" :: tq"B" :: Nil + val restpe = tq"C" + assert(tq"..$argtpes => $restpe" ≈ tq"(A, B) => C") + } }
\ No newline at end of file diff --git a/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala b/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala index 5c919e55cb..02787c551b 100644 --- a/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala +++ b/test/files/scalacheck/quasiquotes/TypeDeconstructionProps.scala @@ -31,4 +31,10 @@ object TypeDeconstructionProps extends QuasiquoteProperties("type deconstruction val tq"T { ..$stats }" = tq"T { def foo; val x: Int; type Y = String }" assert(stats ≈ (q"def foo" :: q"val x: Int" :: q"type Y = String" :: Nil)) } + + property("function type") = test { + val tq"..$argtpes => $restpe" = tq"(A, B) => C" + assert(argtpes ≈ (tq"A" :: tq"B" :: Nil)) + assert(restpe ≈ tq"C") + } }
\ No newline at end of file |