From 1ecef3bcd368527fe355bb7943c9e5983fdb9c1a Mon Sep 17 00:00:00 2001 From: Philipp Haller Date: Mon, 29 Jun 2009 16:38:49 +0000 Subject: Added test for #2031. --- test/files/neg/t2031.check | 6 ++++++ test/files/neg/t2031.scala | 9 +++++++++ 2 files changed, 15 insertions(+) create mode 100644 test/files/neg/t2031.check create mode 100644 test/files/neg/t2031.scala (limited to 'test/files') diff --git a/test/files/neg/t2031.check b/test/files/neg/t2031.check new file mode 100644 index 0000000000..6fd70143eb --- /dev/null +++ b/test/files/neg/t2031.check @@ -0,0 +1,6 @@ +t2031.scala:8: error: polymorphic expression cannot be instantiated to expected type; + found : [A]scala.collection.generic.Builder[A,scala.collection.immutable.TreeSet[A]] + required: scala.collection.generic.BuilderFactory[Int,?,scala.collection.immutable.TreeSet[Int]] + res0.map(x => x)(TreeSet.newBuilder) + ^ +one error found diff --git a/test/files/neg/t2031.scala b/test/files/neg/t2031.scala new file mode 100644 index 0000000000..e4708c45ac --- /dev/null +++ b/test/files/neg/t2031.scala @@ -0,0 +1,9 @@ +import scala.collection.immutable._ + +object Test extends Application { + val res0 = TreeSet(1, 2, 3) + + //res0.map(x => x)(TreeSet.newBuilder[Int]) + + res0.map(x => x)(TreeSet.newBuilder) +} -- cgit v1.2.3