From 5f82067bbf5a66f732cee25cdd5e5012438062a0 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Wed, 21 Mar 2012 09:17:14 -0700 Subject: Clarifying MethodSynthesis. Tried to paint a picture of how one might synthesize an implicit method to accompany an implicit class. --- test/pending/run/implicit-classes.scala | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 test/pending/run/implicit-classes.scala (limited to 'test/pending') 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) +} + +**/ -- cgit v1.2.3