diff options
Diffstat (limited to 'tests/untried/neg/primitive-sigs-1')
-rw-r--r-- | tests/untried/neg/primitive-sigs-1/A.scala | 9 | ||||
-rw-r--r-- | tests/untried/neg/primitive-sigs-1/B.scala | 5 | ||||
-rw-r--r-- | tests/untried/neg/primitive-sigs-1/J.java | 8 |
3 files changed, 22 insertions, 0 deletions
diff --git a/tests/untried/neg/primitive-sigs-1/A.scala b/tests/untried/neg/primitive-sigs-1/A.scala new file mode 100644 index 000000000..007a64c8f --- /dev/null +++ b/tests/untried/neg/primitive-sigs-1/A.scala @@ -0,0 +1,9 @@ +// scala: the signature in the abstract class will use the +// upper bound as return type, which for us will be Integer +// since primitives can't appear in bounds. +abstract class AC[T <: Int] { + def f(): T +} +class Bippy extends AC[Int] { + def f(): Int = 5 +} diff --git a/tests/untried/neg/primitive-sigs-1/B.scala b/tests/untried/neg/primitive-sigs-1/B.scala new file mode 100644 index 000000000..0958bcda5 --- /dev/null +++ b/tests/untried/neg/primitive-sigs-1/B.scala @@ -0,0 +1,5 @@ +object Test { + def main(args: Array[String]): Unit = { + J.f(new Bippy()) + } +} diff --git a/tests/untried/neg/primitive-sigs-1/J.java b/tests/untried/neg/primitive-sigs-1/J.java new file mode 100644 index 000000000..2e43b8330 --- /dev/null +++ b/tests/untried/neg/primitive-sigs-1/J.java @@ -0,0 +1,8 @@ +// java: often the java or scala compiler will save us from +// the untruth in the signature, but not always. +public class J { + public static Integer f(AC<Integer> x) { return x.f(); } + public static void main(String[] args) { + f(new Bippy()); + } +} |