From 4d7916df7537797af0ac42e1cd41c34589aff4f8 Mon Sep 17 00:00:00 2001 From: buraq Date: Fri, 18 Feb 2005 18:33:06 +0000 Subject: neg file for sequence convention in pattern mat... neg file for sequence convention in pattern matching --- test/files/neg/negSeq.check | 4 ++++ test/files/neg/negSeq.scala | 8 ++++++++ 2 files changed, 12 insertions(+) create mode 100644 test/files/neg/negSeq.check create mode 100644 test/files/neg/negSeq.scala (limited to 'test/files') diff --git a/test/files/neg/negSeq.check b/test/files/neg/negSeq.check new file mode 100644 index 0000000000..aefb0a5fdb --- /dev/null +++ b/test/files/neg/negSeq.check @@ -0,0 +1,4 @@ +negSeq.scala:6: expected pattern type scala.Seq[scala.Int] does not conform to sequence trait List + case List(1,2,3) => true // type error: type Seq will not work + ^ +one error found diff --git a/test/files/neg/negSeq.scala b/test/files/neg/negSeq.scala new file mode 100644 index 0000000000..5eff5f33ea --- /dev/null +++ b/test/files/neg/negSeq.scala @@ -0,0 +1,8 @@ +object seqapply_convention { // 2005-02-17 see comment in PatternMatcher::isSeqApply + + val x:Seq[Int] = List(1,2,3); + + x.match { + case List(1,2,3) => true // type error: type Seq will not work + } +} -- cgit v1.2.3