From 96ff8c5d0b49a0c6c7353c57abe9bc10e6aed70f Mon Sep 17 00:00:00 2001 From: Simon Ochsenreither Date: Tue, 20 Aug 2013 18:19:33 +0200 Subject: SI-7629 Deprecate view bounds This introduces a warning(/error with -Xfuture) with a general migration advice. The IDE can use the warning to offer a quick fix with the specific refactoring necessary. --- test/files/neg/t7629-view-bounds-deprecation.check | 11 +++++++++++ test/files/neg/t7629-view-bounds-deprecation.flags | 1 + test/files/neg/t7629-view-bounds-deprecation.scala | 4 ++++ 3 files changed, 16 insertions(+) create mode 100644 test/files/neg/t7629-view-bounds-deprecation.check create mode 100644 test/files/neg/t7629-view-bounds-deprecation.flags create mode 100644 test/files/neg/t7629-view-bounds-deprecation.scala (limited to 'test/files/neg') 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 +} -- cgit v1.2.3