diff options
author | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-25 13:52:36 -0800 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@typesafe.com> | 2012-11-25 13:52:36 -0800 |
commit | 9afc00c0408e49a111f381334cbdb7fcdaa4f340 (patch) | |
tree | 9807c35aa0bc818bf487a2c93bd577e37e1adce0 /test/files/neg/t6663.scala | |
parent | 889ceade520ae5d2d1485edf2826696fa91a0e91 (diff) | |
parent | f0e9237834d00ea9e27937e44dc8b8382be32db6 (diff) | |
download | scala-9afc00c0408e49a111f381334cbdb7fcdaa4f340.tar.gz scala-9afc00c0408e49a111f381334cbdb7fcdaa4f340.tar.bz2 scala-9afc00c0408e49a111f381334cbdb7fcdaa4f340.zip |
Merge pull request #1664 from paulp/merge-2.10.x-master
Merge 2.10.x into master.
Diffstat (limited to 'test/files/neg/t6663.scala')
-rw-r--r-- | test/files/neg/t6663.scala | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/files/neg/t6663.scala b/test/files/neg/t6663.scala new file mode 100644 index 0000000000..4a358dfbc5 --- /dev/null +++ b/test/files/neg/t6663.scala @@ -0,0 +1,19 @@ +import language.dynamics + +class C(v: Any) extends Dynamic { + def selectDynamic[T](n: String): Option[T] = Option(v.asInstanceOf[T]) + def applyDynamic[T](n: String)(): Option[T] = Option(v.asInstanceOf[T]) +} + +object Test extends App { + // this should be converted to + // C(42).selectDynamic[String]("foo").get + // causing a compile error. + + // but, before fixing SI-6663, became + // C(42).selectDynamic("foo").get, ignoring + // the [String] type parameter + var v = new C(42).foo[String].get :Int + println(v) +} + |