diff options
author | Martin Odersky <odersky@gmail.com> | 2014-04-13 12:40:19 +0200 |
---|---|---|
committer | Martin Odersky <odersky@gmail.com> | 2014-04-14 15:17:35 +0200 |
commit | e5ae4a707b2bb78f0777660b0661a3162bf646df (patch) | |
tree | f4a5886bf8295834d2e9de6548aaee7450877e19 /tests/pos/implicits2.scala | |
parent | 732a690ad2ef78450f6b8852b0f1f0ba892b392d (diff) | |
download | dotty-e5ae4a707b2bb78f0777660b0661a3162bf646df.tar.gz dotty-e5ae4a707b2bb78f0777660b0661a3162bf646df.tar.bz2 dotty-e5ae4a707b2bb78f0777660b0661a3162bf646df.zip |
Fixing prefix of implicit members
Implicit members are TermRefs that should have a prefix corresponding to the object of which they are a member. They used to have the ThisType of their owner before.
`implicits2` provides a way to verify that the change works. It would be good to turn this
into a more robust test at some point. But it's not high preiority, so I prefer no test to a fragile test.
Diffstat (limited to 'tests/pos/implicits2.scala')
-rw-r--r-- | tests/pos/implicits2.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/tests/pos/implicits2.scala b/tests/pos/implicits2.scala new file mode 100644 index 000000000..8e566c19f --- /dev/null +++ b/tests/pos/implicits2.scala @@ -0,0 +1,19 @@ +/* Compile with + + dotc implicits2.scala -Xprint:front -Xprint-types -verbose + + and verify that the inserted wrapString comes from Predef. You should see + + val x: <root>.scala.collection.immutable.WrappedString = + < + <scala.Predef.wrapString: + ((s: java.lang.String)scala.collection.immutable.WrappedString) + > + (<"abc":java.lang.String("abc")>):scala.collection.immutable.WrappedString + > +*/ +object implicits2 { + + val x: scala.collection.immutable.WrappedString = "abc" + +} |