diff options
author | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-03-12 22:44:33 +0100 |
---|---|---|
committer | Samuel Gruetter <samuel.gruetter@epfl.ch> | 2014-03-12 22:44:33 +0100 |
commit | 9ef5f6817688f814a3450126aa7383b0928e80a0 (patch) | |
tree | 5727a2f7f7fd665cefdb312af2785c692f04377c /tests/untried/neg/patmat-type-check.check | |
parent | 194be919664447631ba55446eb4874979c908d27 (diff) | |
download | dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.gz dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.tar.bz2 dotty-9ef5f6817688f814a3450126aa7383b0928e80a0.zip |
add tests from scala/test/files/{pos,neg}
with explicit Unit return type
Diffstat (limited to 'tests/untried/neg/patmat-type-check.check')
-rw-r--r-- | tests/untried/neg/patmat-type-check.check | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/tests/untried/neg/patmat-type-check.check b/tests/untried/neg/patmat-type-check.check new file mode 100644 index 000000000..fedac3b74 --- /dev/null +++ b/tests/untried/neg/patmat-type-check.check @@ -0,0 +1,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 |