diff options
author | Adriaan Moors <adriaan.moors@epfl.ch> | 2009-10-22 17:04:20 +0000 |
---|---|---|
committer | Adriaan Moors <adriaan.moors@epfl.ch> | 2009-10-22 17:04:20 +0000 |
commit | bf584e53207b837a3103a59614177ba39f06015e (patch) | |
tree | e68eeb41c745ccc848c5fbcd505249880daf021f /test/files/neg | |
parent | a2eab2215a7671e8abd8189ccc59388dffc1f3de (diff) | |
download | scala-bf584e53207b837a3103a59614177ba39f06015e.tar.gz scala-bf584e53207b837a3103a59614177ba39f06015e.tar.bz2 scala-bf584e53207b837a3103a59614177ba39f06015e.zip |
the essence of tcpoly inference + test cases
fixes to check files and removed nonapplicable test case Tuple2 impl,
but commented out so that we can bootstrap whitespace...
Diffstat (limited to 'test/files/neg')
-rw-r--r-- | test/files/neg/names-defaults-neg.check | 7 | ||||
-rw-r--r-- | test/files/neg/t0226.check | 3 | ||||
-rw-r--r-- | test/files/neg/tcpoly_infer_ticket1162.check | 4 | ||||
-rw-r--r-- | test/files/neg/tcpoly_infer_ticket1162.scala | 8 |
4 files changed, 19 insertions, 3 deletions
diff --git a/test/files/neg/names-defaults-neg.check b/test/files/neg/names-defaults-neg.check index 057a0519d7..e47cf8c420 100644 --- a/test/files/neg/names-defaults-neg.check +++ b/test/files/neg/names-defaults-neg.check @@ -88,8 +88,11 @@ match argument types (a: Int,b: java.lang.String) and expected result type Any names-defaults-neg.scala:70: error: wrong number of arguments for <none>: (x: Int,y: String)A1 A1() match { case A1(_) => () } ^ -names-defaults-neg.scala:77: error: inferred kinds of the type arguments (List[Int]) do not conform to the expected kinds of the type parameters (type T). -List[Int]'s type parameters do not match type T's expected parameters: class List has one type parameter, but type T has one +names-defaults-neg.scala:77: error: no type parameters for method test4: (x: T[T[List[T[X forSome { type X }]]]])T[T[List[T[X forSome { type X }]]]] exist so that it can be applied to arguments (List[Int]) + --- because --- +argument expression's type is not compatible with formal parameter type; + found : List[Int] + required: ?T[ ?T[ scala.List[?T[ X forSome { type X } ]] ] ] Error occured in an application involving default arguments. test4() ^ diff --git a/test/files/neg/t0226.check b/test/files/neg/t0226.check index af81e41a6a..e27ffbc1e1 100644 --- a/test/files/neg/t0226.check +++ b/test/files/neg/t0226.check @@ -4,7 +4,8 @@ t0226.scala:5: error: not found: type A1 t0226.scala:5: error: not found: type A1 (implicit _1: Foo[List[A1]], _2: Foo[A2]): Foo[Tuple2[List[A1], A2]] = ^ -t0226.scala:8: error: could not find implicit value for parameter rep: Test.this.Foo[((List[Char], Int), (object Nil, Int))] +t0226.scala:8: error: diverging implicit expansion for type Test.this.Foo[((List[Char], Int), (object Nil, Int))] +starting with method list2Foo in class Test foo(((List('b'), 3), (Nil, 4))) ^ three errors found diff --git a/test/files/neg/tcpoly_infer_ticket1162.check b/test/files/neg/tcpoly_infer_ticket1162.check new file mode 100644 index 0000000000..03334222c1 --- /dev/null +++ b/test/files/neg/tcpoly_infer_ticket1162.check @@ -0,0 +1,4 @@ +tcpoly_infer_ticket1162.scala:6: error: wrong number of type parameters for method apply: [A,B,F[_]]()Test.Lift[A,B,F] in object Lift + def simplify[A,B]: Expression[A,B] = Lift[A,B]() + ^ +one error found diff --git a/test/files/neg/tcpoly_infer_ticket1162.scala b/test/files/neg/tcpoly_infer_ticket1162.scala new file mode 100644 index 0000000000..0552b42a22 --- /dev/null +++ b/test/files/neg/tcpoly_infer_ticket1162.scala @@ -0,0 +1,8 @@ +object Test { + trait Expression[A,B] + + case class Lift[A,B,F[_]]() extends Expression[F[A],F[B]] + + def simplify[A,B]: Expression[A,B] = Lift[A,B]() +} + |