diff options
author | Jason Zaugg <jzaugg@gmail.com> | 2013-09-27 13:25:48 -0700 |
---|---|---|
committer | Jason Zaugg <jzaugg@gmail.com> | 2013-09-27 13:25:48 -0700 |
commit | 5a8cd09819f58adcb866722f48b00066d23e7a82 (patch) | |
tree | e36fec3033a0d276369e6c4a5e7814a8c77d3626 /test | |
parent | 091f3ba3a8a427d69f7cc7d2fafeebb38126ec93 (diff) | |
parent | 96ff8c5d0b49a0c6c7353c57abe9bc10e6aed70f (diff) | |
download | scala-5a8cd09819f58adcb866722f48b00066d23e7a82.tar.gz scala-5a8cd09819f58adcb866722f48b00066d23e7a82.tar.bz2 scala-5a8cd09819f58adcb866722f48b00066d23e7a82.zip |
Merge pull request #2909 from soc/SI-7629-deprecate-view-bounds
SI-7629 Deprecate view bounds
Diffstat (limited to 'test')
-rw-r--r-- | test/files/neg/t7629-view-bounds-deprecation.check | 11 | ||||
-rw-r--r-- | test/files/neg/t7629-view-bounds-deprecation.flags | 1 | ||||
-rw-r--r-- | test/files/neg/t7629-view-bounds-deprecation.scala | 4 | ||||
-rw-r--r-- | test/pending/t7629-view-bounds-removal.check | 9 | ||||
-rw-r--r-- | test/pending/t7629-view-bounds-removal.flags | 1 | ||||
-rw-r--r-- | test/pending/t7629-view-bounds-removal.scala | 4 |
6 files changed, 30 insertions, 0 deletions
diff --git a/test/files/neg/t7629-view-bounds-deprecation.check b/test/files/neg/t7629-view-bounds-deprecation.check new file mode 100644 index 0000000000..ed77c15c54 --- /dev/null +++ b/test/files/neg/t7629-view-bounds-deprecation.check @@ -0,0 +1,11 @@ +t7629-view-bounds-deprecation.scala:2: warning: View bounds are deprecated. Use an implicit parameter instead. +Example: Instead of `def f[A <% Int](a: A)` use `def f[A](a: A)(implicit ev: A => Int)`. + def f[A <% Int](a: A) = null + ^ +t7629-view-bounds-deprecation.scala:3: warning: View bounds are deprecated. Use an implicit parameter instead. +Example: Instead of `def f[A <% Int](a: A)` use `def f[A](a: A)(implicit ev: A => Int)`. + def g[C, B <: C, A <% B : Numeric](a: A) = null + ^ +error: No warnings can be incurred under -Xfatal-warnings. +two warnings found +one error found diff --git a/test/files/neg/t7629-view-bounds-deprecation.flags b/test/files/neg/t7629-view-bounds-deprecation.flags new file mode 100644 index 0000000000..43a25d4ccc --- /dev/null +++ b/test/files/neg/t7629-view-bounds-deprecation.flags @@ -0,0 +1 @@ +-deprecation -Xfatal-warnings -Xfuture diff --git a/test/files/neg/t7629-view-bounds-deprecation.scala b/test/files/neg/t7629-view-bounds-deprecation.scala new file mode 100644 index 0000000000..a6ede1fcc3 --- /dev/null +++ b/test/files/neg/t7629-view-bounds-deprecation.scala @@ -0,0 +1,4 @@ +object Test { + def f[A <% Int](a: A) = null + def g[C, B <: C, A <% B : Numeric](a: A) = null +} diff --git a/test/pending/t7629-view-bounds-removal.check b/test/pending/t7629-view-bounds-removal.check new file mode 100644 index 0000000000..dc52105eaf --- /dev/null +++ b/test/pending/t7629-view-bounds-removal.check @@ -0,0 +1,9 @@ +t7629-view-bounds-removal.scala:2: error: View bounds have been removed. Use an implicit parameter instead. +Example: Instead of `def f[A <% Int](a: A)` use `def f[A](a: A)(implicit ev: A => Int)`. + def f[A <% Int](a: A) = null + ^ +t7629-view-bounds-removal.scala:3: error: View bounds have been removed. Use an implicit parameter instead. +Example: Instead of `def f[A <% Int](a: A)` use `def f[A](a: A)(implicit ev: A => Int)`. + def g[C, B <: C, A <% B : Numeric](a: A) = null + ^ +two errors found diff --git a/test/pending/t7629-view-bounds-removal.flags b/test/pending/t7629-view-bounds-removal.flags new file mode 100644 index 0000000000..29f4ede37a --- /dev/null +++ b/test/pending/t7629-view-bounds-removal.flags @@ -0,0 +1 @@ +-Xfuture diff --git a/test/pending/t7629-view-bounds-removal.scala b/test/pending/t7629-view-bounds-removal.scala new file mode 100644 index 0000000000..a6ede1fcc3 --- /dev/null +++ b/test/pending/t7629-view-bounds-removal.scala @@ -0,0 +1,4 @@ +object Test { + def f[A <% Int](a: A) = null + def g[C, B <: C, A <% B : Numeric](a: A) = null +} |