From 327eea839e97e1d7cac92aa9cd61e3338d12cb12 Mon Sep 17 00:00:00 2001 From: Jason Zaugg Date: Mon, 27 Jan 2014 10:29:28 +0100 Subject: Prohibit views targeting AnyVal Library changes in Scala 2.10 mean that we are left with the unfortunate situation of admitting: scala> "": AnyVal res0: AnyVal = We already have explicit checks in place to prevent views targeting `AnyRef`. This commit balances this out by prohibiting `AnyVal`, as well. The enclosed test shows that this case is now prevented. If multiple implicits views are applicable, the ambiguity error is still raised; these check comes right at the end. Maybe that ought to be changed, but I don't think it matters too much. I've also disabled this prohibition under -Xsource:2.10. --- test/files/pos/implicit-anyval-2.10.flags | 1 + 1 file changed, 1 insertion(+) create mode 100644 test/files/pos/implicit-anyval-2.10.flags (limited to 'test/files/pos/implicit-anyval-2.10.flags') diff --git a/test/files/pos/implicit-anyval-2.10.flags b/test/files/pos/implicit-anyval-2.10.flags new file mode 100644 index 0000000000..94c8056747 --- /dev/null +++ b/test/files/pos/implicit-anyval-2.10.flags @@ -0,0 +1 @@ +-Xsource:2.10 -- cgit v1.2.3