1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
|
patmat-type-check.scala:11: warning: fruitless type test: a value of type Test.Bop4[T] cannot also be a Seq[A]
def s3[T](x: Bop4[T]) = x match { case Seq('b', 'o', 'b') => true }
^
patmat-type-check.scala:11: error: pattern type is incompatible with expected type;
found : Seq[A]
required: Test.Bop4[T]
def s3[T](x: Bop4[T]) = x match { case Seq('b', 'o', 'b') => true }
^
patmat-type-check.scala:15: warning: fruitless type test: a value of type Test.Bop5[_$1,T1,T2] cannot also be a Seq[A]
def s4[T1, T2](x: Bop5[_, T1, T2]) = x match { case Seq('b', 'o', 'b') => true }
^
patmat-type-check.scala:15: error: pattern type is incompatible with expected type;
found : Seq[A]
required: Test.Bop5[_$1,T1,T2] where type _$1
def s4[T1, T2](x: Bop5[_, T1, T2]) = x match { case Seq('b', 'o', 'b') => true }
^
patmat-type-check.scala:19: warning: fruitless type test: a value of type Test.Bop3[T] cannot also be a Seq[A]
def f4[T](x: Bop3[T]) = x match { case Seq('b', 'o', 'b') => true }
^
patmat-type-check.scala:19: error: pattern type is incompatible with expected type;
found : Seq[A]
required: Test.Bop3[T]
def f4[T](x: Bop3[T]) = x match { case Seq('b', 'o', 'b') => true }
^
patmat-type-check.scala:22: error: scrutinee is incompatible with pattern type;
found : Seq[A]
required: String
def f1 = "bob".reverse match { case Seq('b', 'o', 'b') => true } // fail
^
patmat-type-check.scala:23: error: scrutinee is incompatible with pattern type;
found : Seq[A]
required: Array[Char]
def f2 = "bob".toArray match { case Seq('b', 'o', 'b') => true } // fail
^
patmat-type-check.scala:27: error: scrutinee is incompatible with pattern type;
found : Seq[A]
required: Test.Bop2
def f3(x: Bop2) = x match { case Seq('b', 'o', 'b') => true } // fail
^
patmat-type-check.scala:30: error: scrutinee is incompatible with pattern type;
found : Seq[A]
required: Test.Bop3[Char]
def f4[T](x: Bop3[Char]) = x match { case Seq('b', 'o', 'b') => true } // fail
^
three warnings found
7 errors found
|