From c1f8dbca52899f87128ece2f5d137fb91206ede7 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 5 Oct 2010 02:59:24 +0000 Subject: Somewhere along the way AnyVal stopped working ... Somewhere along the way AnyVal stopped working as sealed. (It was still sealed but had lost its children.) Closes #3163, review by rytz. --- test/files/neg/anyval-sealed.check | 12 ++++++++++++ test/files/neg/anyval-sealed.flags | 1 + test/files/neg/anyval-sealed.scala | 6 ++++++ 3 files changed, 19 insertions(+) create mode 100644 test/files/neg/anyval-sealed.check create mode 100644 test/files/neg/anyval-sealed.flags create mode 100644 test/files/neg/anyval-sealed.scala (limited to 'test/files') diff --git a/test/files/neg/anyval-sealed.check b/test/files/neg/anyval-sealed.check new file mode 100644 index 0000000000..48a457b496 --- /dev/null +++ b/test/files/neg/anyval-sealed.check @@ -0,0 +1,12 @@ +anyval-sealed.scala:2: error: match is not exhaustive! +missing combination Byte +missing combination Char +missing combination Double +missing combination Float +missing combination Long +missing combination Short +missing combination Unit + + def f(x: AnyVal) = x match { + ^ +one error found diff --git a/test/files/neg/anyval-sealed.flags b/test/files/neg/anyval-sealed.flags new file mode 100644 index 0000000000..85d8eb2ba2 --- /dev/null +++ b/test/files/neg/anyval-sealed.flags @@ -0,0 +1 @@ +-Xfatal-warnings diff --git a/test/files/neg/anyval-sealed.scala b/test/files/neg/anyval-sealed.scala new file mode 100644 index 0000000000..232a183479 --- /dev/null +++ b/test/files/neg/anyval-sealed.scala @@ -0,0 +1,6 @@ +class A { + def f(x: AnyVal) = x match { + case _: Boolean => 1 + case _: Int => 2 + } +} \ No newline at end of file -- cgit v1.2.3