changeset 48844:d1f74803eb40 lworld

Test that defaultvalue cannot be used with abstract classes or interfaces.
author sadayapalam
date Mon, 12 Feb 2018 12:05:03 +0530
parents 5df93aa2bdc4
children 0ab18a21d5db
files test/langtools/tools/javac/valhalla/lworld-values/CheckMakeDefault.java test/langtools/tools/javac/valhalla/lworld-values/CheckMakeDefault.out
diffstat 2 files changed, 11 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/test/langtools/tools/javac/valhalla/lworld-values/CheckMakeDefault.java	Mon Feb 12 11:38:46 2018 +0530
+++ b/test/langtools/tools/javac/valhalla/lworld-values/CheckMakeDefault.java	Mon Feb 12 12:05:03 2018 +0530
@@ -6,6 +6,8 @@
  */
 __ByValue final class Point {
 
+    __ByValue interface I {}
+    __ByValue abstract class A {}
     static final class Sinner {
         __ValueFactory static Sinner make() {
             return __MakeDefault Sinner(); // NO: Sinner is not a value class.
--- a/test/langtools/tools/javac/valhalla/lworld-values/CheckMakeDefault.out	Mon Feb 12 11:38:46 2018 +0530
+++ b/test/langtools/tools/javac/valhalla/lworld-values/CheckMakeDefault.out	Mon Feb 12 12:05:03 2018 +0530
@@ -1,7 +1,9 @@
-CheckMakeDefault.java:10:38: compiler.err.value.factory.must.be.member.of.value.type
-CheckMakeDefault.java:11:20: compiler.err.make.default.with.nonvalue
-CheckMakeDefault.java:28:16: compiler.err.make.default.in.nonfactory
-CheckMakeDefault.java:32:18: compiler.err.invalid.arguments.to.make.default
-CheckMakeDefault.java:33:19: compiler.err.make.default.with.nonvalue
-CheckMakeDefault.java:34:8: compiler.err.make.default.with.wrong.value.type: Point.SinnerValue
-6 errors
+CheckMakeDefault.java:9:15: compiler.err.illegal.combination.of.modifiers: interface, value
+CheckMakeDefault.java:10:24: compiler.err.illegal.combination.of.modifiers: abstract, value
+CheckMakeDefault.java:12:38: compiler.err.value.factory.must.be.member.of.value.type
+CheckMakeDefault.java:13:20: compiler.err.make.default.with.nonvalue
+CheckMakeDefault.java:30:16: compiler.err.make.default.in.nonfactory
+CheckMakeDefault.java:34:18: compiler.err.invalid.arguments.to.make.default
+CheckMakeDefault.java:35:19: compiler.err.make.default.with.nonvalue
+CheckMakeDefault.java:36:8: compiler.err.make.default.with.wrong.value.type: Point.SinnerValue
+8 errors