summaryrefslogtreecommitdiff
path: root/test/files/run/implicits.scala
diff options
context:
space:
mode:
Diffstat (limited to 'test/files/run/implicits.scala')
-rwxr-xr-xtest/files/run/implicits.scala25
1 files changed, 25 insertions, 0 deletions
diff --git a/test/files/run/implicits.scala b/test/files/run/implicits.scala
new file mode 100755
index 0000000000..c45badc49f
--- /dev/null
+++ b/test/files/run/implicits.scala
@@ -0,0 +1,25 @@
+object A {
+ object B {
+ implicit def int2string(x: int) = "["+x.toString+"]"
+ }
+}
+
+class C(x: String) {
+
+ class Inner {
+ }
+
+ object Inner {
+ val s: String = x
+ implicit def Inner2String(x: Inner): String = s
+ }
+}
+
+object Test extends Application {
+ import A.B._
+ val c = new C("OK")
+ val i = new c.Inner
+ val s: String = i
+ Console.println(s)
+ Console.println(2: String)
+}