summaryrefslogtreecommitdiff
path: root/test/pending
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2012-03-21 09:17:14 -0700
committerPaul Phillips <paulp@improving.org>2012-03-21 09:19:54 -0700
commit5f82067bbf5a66f732cee25cdd5e5012438062a0 (patch)
tree83bd45f5e2e846fb4eb06ecc24b9d8d1ccdf89ab /test/pending
parente2951867f51bf464b07f759662bfc50dfaf48e5b (diff)
downloadscala-5f82067bbf5a66f732cee25cdd5e5012438062a0.tar.gz
scala-5f82067bbf5a66f732cee25cdd5e5012438062a0.tar.bz2
scala-5f82067bbf5a66f732cee25cdd5e5012438062a0.zip
Clarifying MethodSynthesis.
Tried to paint a picture of how one might synthesize an implicit method to accompany an implicit class.
Diffstat (limited to 'test/pending')
-rw-r--r--test/pending/run/implicit-classes.scala17
1 files changed, 17 insertions, 0 deletions
diff --git a/test/pending/run/implicit-classes.scala b/test/pending/run/implicit-classes.scala
new file mode 100644
index 0000000000..02b74de2b0
--- /dev/null
+++ b/test/pending/run/implicit-classes.scala
@@ -0,0 +1,17 @@
+object O {
+ implicit class C(s: String) {
+ def twice = s + s
+ }
+}
+
+/**
+//
+// We'd like to augment object O in Namers so that it also has an implicit method
+object O {
+ implicit class C(s: String) {
+ def twice = s + s
+ }
+ implicit def C(s: String): C = new C(s)
+}
+
+**/