changeset 56939:c0338134a40b amber-demo-II

Automatic merge with records-and-sealed
author mcimadamore
date Mon, 15 Jul 2019 19:40:40 +0000
parents de5b82868cdd 400d527fd8a5
children b904101cc8c4
files
diffstat 4 files changed, 26 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/test/langtools/tools/javac/diags/examples.not-yet.txt	Mon Jul 15 13:34:21 2019 -0400
+++ b/test/langtools/tools/javac/diags/examples.not-yet.txt	Mon Jul 15 19:40:40 2019 +0000
@@ -164,18 +164,28 @@
 compiler.misc.cant.resolve.modules
 compiler.misc.file.does.not.contain.module
 
-# datum related messages
-compiler.err.accessors.not.supported.in.source
-compiler.err.cant.extend.datum
-compiler.err.datum.can.only.declare.methods.as.members
-compiler.err.datum.cant.declare.duplicate.fields
-compiler.err.datum.must.declare.at.least.one.field
+# records related messages
 compiler.err.duplicate.argument.to.super
 compiler.err.expected3
-compiler.err.unexpected.accessor.kind
-compiler.misc.bad.datum.super
 compiler.misc.bad.super.fields
 compiler.misc.super.field.mismatch
+compiler.err.accessor.return.type.doesnt.match
+compiler.err.canonical.with.name.mismatch
+compiler.err.cant.extend.record
+compiler.err.constructor.with.same.erasure.as.canonical
+compiler.err.local.record
+compiler.err.method.must.be.public
+compiler.err.nested.records.must.be.static
+compiler.err.non.sealed.with.no.sealed.supertype
+compiler.err.permits.in.no.sealed.class
+compiler.err.record.can.only.declare.methods.as.members
+compiler.err.record.cant.be.abstract
+compiler.err.record.cant.declare.duplicate.fields
+compiler.err.record.cant.declare.field.modifiers
+compiler.err.record.fields.must.be.in.header
+compiler.err.record.not.allowed
+compiler.misc.bad.record.super
+compiler.misc.feature.sealed.types
 
 # these keys were in javac.properties and examples are hard to be produced for them
 # basically because in most cases the compilation ends with an exception
--- a/test/langtools/tools/javac/diags/examples/CantInheritFromSealed.java	Mon Jul 15 13:34:21 2019 -0400
+++ b/test/langtools/tools/javac/diags/examples/CantInheritFromSealed.java	Mon Jul 15 19:40:40 2019 +0000
@@ -25,10 +25,14 @@
 
 // key: compiler.err.cant.inherit.from.sealed
 
-sealed interface SealedInterface {
+sealed interface SealedInterface permits Sub1 {
     void m();
 }
 
+class Sub1 implements SealedInterface {
+    public void m() { }
+}
+
 class CantInheritFromSealed implements SealedInterface {
     public void m() { }
 }
--- a/test/langtools/tools/javac/launcher/SourceLauncherTest.java	Mon Jul 15 13:34:21 2019 -0400
+++ b/test/langtools/tools/javac/launcher/SourceLauncherTest.java	Mon Jul 15 19:40:40 2019 +0000
@@ -292,7 +292,7 @@
             file + ":1: error: illegal character: '#'\n" +
             "#!/usr/bin/java --source " + thisVersion + "\n" +
             "^\n" +
-            file + ":1: error: class, interface, or enum expected\n" +
+            file + ":1: error: class, interface, enum, or record expected\n" +
             "#!/usr/bin/java --source " + thisVersion + "\n" +
             "  ^\n" +
             "2 errors\n",
@@ -498,7 +498,7 @@
             file + ":1: error: illegal character: '#'\n" +
             "#/usr/bin/java --source " + thisVersion + "\n" +
             "^\n" +
-            file + ":1: error: class, interface, or enum expected\n" +
+            file + ":1: error: class, interface, enum, or record expected\n" +
             "#/usr/bin/java --source " + thisVersion + "\n" +
             "  ^\n" +
             "2 errors\n",
--- a/test/langtools/tools/javac/parser/extend/TrialParser.java	Mon Jul 15 13:34:21 2019 -0400
+++ b/test/langtools/tools/javac/parser/extend/TrialParser.java	Mon Jul 15 19:40:40 2019 +0000
@@ -220,7 +220,7 @@
                             //mods.flags |= Flags.STATIC;
                             return List.of(methodDeclaratorRest(
                                     pos, mods, t, name, typarams,
-                                    false, isVoid, dc));
+                                    false, isVoid, false, dc));
                         } else if (!isVoid && typarams.isEmpty()) {
                         // variable declaration
                             //mods.flags |= Flags.STATIC;