summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/files/neg/bug1431.check4
-rw-r--r--test/files/neg/bug1431.scala10
2 files changed, 14 insertions, 0 deletions
diff --git a/test/files/neg/bug1431.check b/test/files/neg/bug1431.check
new file mode 100644
index 0000000000..0ae28eea9d
--- /dev/null
+++ b/test/files/neg/bug1431.check
@@ -0,0 +1,4 @@
+bug1431.scala:8: error: class type required but X#Factory found
+ def fun[X<:MyTrait with Singleton]() = new X#Factory().value
+ ^
+one error found
diff --git a/test/files/neg/bug1431.scala b/test/files/neg/bug1431.scala
new file mode 100644
index 0000000000..aff1dbc014
--- /dev/null
+++ b/test/files/neg/bug1431.scala
@@ -0,0 +1,10 @@
+object Bug_New {
+ trait MyTrait {
+ type Alpha
+ def the_value : Alpha
+ class Factory() {def value : Alpha = the_value}
+ }
+
+ def fun[X<:MyTrait with Singleton]() = new X#Factory().value
+}
+