changeset 57008:bcd0f33734b3 patterns-deconstruction

Automatic merge with patterns
author mcimadamore
date Tue, 20 Aug 2019 09:06:10 +0000
parents ded304317aee d67b52fc90b2
children d2da9cce7a04
files src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MatchBindingsComputer.java src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties test/langtools/tools/javac/patterns/BindingsTest1.java
diffstat 5 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MatchBindingsComputer.java	Mon Aug 05 12:15:25 2019 +0200
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/MatchBindingsComputer.java	Tue Aug 20 09:06:10 2019 +0000
@@ -188,6 +188,7 @@
                     if (types.isSameType(v1.type, v2.type)) {
                         list = list.append(new IntersectionBindingSymbol(List.of(v1, v2)));
                     } else {
+                        list = list.append(v2);
                         log.error(tree.pos(), Errors.MatchBindingExistsWithDifferentType);
                     }
                 }
--- a/test/langtools/tools/javac/patterns/BindingsTest2.out	Mon Aug 05 12:15:25 2019 +0200
+++ b/test/langtools/tools/javac/patterns/BindingsTest2.out	Tue Aug 20 09:06:10 2019 +0000
@@ -1,25 +1,25 @@
 BindingsTest2.java:15:21: compiler.err.match.binding.exists.with.different.type
-BindingsTest2.java:16:13: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
+BindingsTest2.java:16:14: compiler.err.cant.resolve.location.args: kindname.method, intValue, , , (compiler.misc.location.1: kindname.variable, x, java.lang.String)
 BindingsTest2.java:19:13: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:23:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:25:36: compiler.err.match.binding.exists.with.different.type
-BindingsTest2.java:26:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
+BindingsTest2.java:26:14: compiler.err.cant.resolve.location.args: kindname.method, length, , , (compiler.misc.location.1: kindname.variable, s, java.lang.Integer)
 BindingsTest2.java:29:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:34:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:36:39: compiler.err.match.binding.exists.with.different.type
-BindingsTest2.java:37:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
+BindingsTest2.java:37:14: compiler.err.cant.resolve.location.args: kindname.method, length, , , (compiler.misc.location.1: kindname.variable, s, java.lang.Integer)
 BindingsTest2.java:40:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:41:13: compiler.err.cant.resolve.location: kindname.variable, i, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:44:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:45:13: compiler.err.cant.resolve.location: kindname.variable, s2, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:50:21: compiler.err.match.binding.exists.with.different.type
-BindingsTest2.java:52:13: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
+BindingsTest2.java:52:14: compiler.err.cant.resolve.location.args: kindname.method, intValue, , , (compiler.misc.location.1: kindname.variable, x, java.lang.String)
 BindingsTest2.java:56:13: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:60:13: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:61:13: compiler.err.cant.resolve.location: kindname.variable, x1, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:65:13: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:69:36: compiler.err.match.binding.exists.with.different.type
-BindingsTest2.java:71:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
+BindingsTest2.java:71:14: compiler.err.cant.resolve.location.args: kindname.method, length, , , (compiler.misc.location.1: kindname.variable, s, java.lang.Integer)
 BindingsTest2.java:75:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:76:13: compiler.err.cant.resolve.location: kindname.variable, i, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:80:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
@@ -27,7 +27,7 @@
 BindingsTest2.java:86:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:87:13: compiler.err.cant.resolve.location: kindname.variable, s1, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:89:39: compiler.err.match.binding.exists.with.different.type
-BindingsTest2.java:91:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
+BindingsTest2.java:91:14: compiler.err.cant.resolve.location.args: kindname.method, length, , , (compiler.misc.location.1: kindname.variable, s, java.lang.Integer)
 BindingsTest2.java:95:13: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:96:13: compiler.err.cant.resolve.location: kindname.variable, i, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
 BindingsTest2.java:100:46: compiler.err.cant.resolve.location: kindname.variable, s, , , (compiler.misc.location: kindname.class, BindingsTest2, null)
@@ -43,4 +43,4 @@
 BindingsTest2.java:134:17: compiler.err.unreachable.stmt
 BindingsTest2.java:159:17: compiler.err.unreachable.stmt
 BindingsTest2.java:184:17: compiler.err.unreachable.stmt
-45 errors
+45 errors
\ No newline at end of file
--- a/test/langtools/tools/javac/patterns/DuplicateBindingTest.java	Mon Aug 05 12:15:25 2019 +0200
+++ b/test/langtools/tools/javac/patterns/DuplicateBindingTest.java	Tue Aug 20 09:06:10 2019 +0000
@@ -1,7 +1,7 @@
 /*
  * @test /nodynamiccopyright/
  * @summary Basic pattern bindings scope test
- * @compile/fail/ref=DuplicateBindingTest.out -XDrawDiagnostics DuplicateBindingTest.java
+ * @compile/fail/ref=DuplicateBindingTest.out -XDrawDiagnostics -XDdev DuplicateBindingTest.java
  */
 
 public class DuplicateBindingTest {
--- a/test/langtools/tools/javac/patterns/MatchBindingScopeTest.out	Mon Aug 05 12:15:25 2019 +0200
+++ b/test/langtools/tools/javac/patterns/MatchBindingScopeTest.out	Tue Aug 20 09:06:10 2019 +0000
@@ -5,7 +5,6 @@
 MatchBindingScopeTest.java:33:39: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
 MatchBindingScopeTest.java:34:32: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
 MatchBindingScopeTest.java:37:36: compiler.err.match.binding.exists.with.different.type
-MatchBindingScopeTest.java:38:32: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
 MatchBindingScopeTest.java:40:32: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
 MatchBindingScopeTest.java:48:32: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
 MatchBindingScopeTest.java:55:48: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
@@ -13,4 +12,4 @@
 MatchBindingScopeTest.java:64:21: compiler.err.cant.resolve.location: kindname.variable, x, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
 MatchBindingScopeTest.java:70:23: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
 MatchBindingScopeTest.java:73:23: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, MatchBindingScopeTest, null)
-15 errors
\ No newline at end of file
+14 errors
--- a/test/langtools/tools/javac/patterns/SwitchFallThrough2.out	Mon Aug 05 12:15:25 2019 +0200
+++ b/test/langtools/tools/javac/patterns/SwitchFallThrough2.out	Tue Aug 20 09:06:10 2019 +0000
@@ -2,7 +2,6 @@
 SwitchFallThrough2.java:40:41: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, SwitchFallThrough2, null)
 SwitchFallThrough2.java:41:48: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, SwitchFallThrough2, null)
 SwitchFallThrough2.java:46:18: compiler.err.match.binding.exists.with.different.type
-SwitchFallThrough2.java:46:47: compiler.err.cant.resolve.location: kindname.variable, j, , , (compiler.misc.location: kindname.class, SwitchFallThrough2, null)
 SwitchFallThrough2.java:36:13: compiler.err.pattern.dominated
 SwitchFallThrough2.java:51:13: compiler.err.pattern.dominated
-7 errors
+6 errors
\ No newline at end of file