diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-18 08:41:38 -0700 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2012-07-18 08:41:38 -0700 |
commit | c3b6d69939aa40412a1166647f95fcb9553e11e4 (patch) | |
tree | adb3dfd65d0e87e3bc18f0d7cf944b42ec6b454a /test/files | |
parent | 019f0c6d81b6979754563ecbf62a846c99823110 (diff) | |
parent | 776105a43ef7a7a7c32be8111b496a6762a8ac68 (diff) | |
download | scala-c3b6d69939aa40412a1166647f95fcb9553e11e4.tar.gz scala-c3b6d69939aa40412a1166647f95fcb9553e11e4.tar.bz2 scala-c3b6d69939aa40412a1166647f95fcb9553e11e4.zip |
Merge pull request #909 from lrytz/t5892
SI-5892 allow implicit views in annotation args
Diffstat (limited to 'test/files')
-rw-r--r-- | test/files/neg/t5892.check | 17 | ||||
-rw-r--r-- | test/files/neg/t5892.scala | 25 | ||||
-rw-r--r-- | test/files/pos/t5892.scala | 5 |
3 files changed, 47 insertions, 0 deletions
diff --git a/test/files/neg/t5892.check b/test/files/neg/t5892.check new file mode 100644 index 0000000000..839bf9de23 --- /dev/null +++ b/test/files/neg/t5892.check @@ -0,0 +1,17 @@ +t5892.scala:5: error: type mismatch; + found : Boolean(false) + required: String +class C[@annot(false) X] { + ^ +t5892.scala:9: error: not found: value b2s +class D[@annot(b2s(false)) X] { + ^ +t5892.scala:13: error: type mismatch; + found : Boolean(false) + required: String +@annot(false) class E { + ^ +t5892.scala:17: error: not found: value b2s +@annot(b2s(false)) class F { + ^ +four errors found diff --git a/test/files/neg/t5892.scala b/test/files/neg/t5892.scala new file mode 100644 index 0000000000..5e3b2f313e --- /dev/null +++ b/test/files/neg/t5892.scala @@ -0,0 +1,25 @@ +import language.implicitConversions + +class annot(a: String) extends annotation.StaticAnnotation + +class C[@annot(false) X] { + implicit def b2s(b: Boolean): String = "" +} + +class D[@annot(b2s(false)) X] { + implicit def b2s(b: Boolean): String = "" +} + +@annot(false) class E { + implicit def b2s(b: Boolean): String = "" +} + +@annot(b2s(false)) class F { + implicit def b2s(b: Boolean): String = "" +} + +object T { + implicit def b2s(b: Boolean): String = "" + @annot(false) val x = 0 + @annot(b2s(false)) val y = 0 +} diff --git a/test/files/pos/t5892.scala b/test/files/pos/t5892.scala new file mode 100644 index 0000000000..241e59860a --- /dev/null +++ b/test/files/pos/t5892.scala @@ -0,0 +1,5 @@ +class foo(a: String) extends annotation.StaticAnnotation +object o { + implicit def i2s(i: Int) = "" + @foo(1: String) def blerg { } +} |