Re: RFR: 8262889: Compiler implementation for Record Patterns [v7]

2022-05-25 Thread Rémi Forax
On Wed, 25 May 2022 04:20:35 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/

Re: RFR: 8262889: Compiler implementation for Record Patterns [v7]

2022-05-24 Thread Jan Lahoda
> 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427+405-20220426/specs/patterns-switch-record-patterns-j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v6]

2022-05-16 Thread Jan Lahoda
> 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427+405-20220426/specs/patterns-switch-record-patterns-j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v5]

2022-05-16 Thread openjdk-notifier[bot]
On Tue, 10 May 2022 09:57:48 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/

Re: RFR: 8262889: Compiler implementation for Record Patterns [v5]

2022-05-10 Thread Vicente Romero
On Tue, 10 May 2022 09:57:48 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/

Re: RFR: 8262889: Compiler implementation for Record Patterns [v5]

2022-05-10 Thread Jan Lahoda
> 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427+405-20220426/specs/patterns-switch-record-patterns-j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v4]

2022-05-10 Thread Jan Lahoda
On Mon, 9 May 2022 20:52:15 GMT, Vicente Romero wrote: > I've noticed that this code: > > ``` > class Test { > String e(E e) { > return switch (e) { > case A -> "42"; > }; > } > > enum E { > A, B; > } > } > ``` > > fails with: > > ``` > Test

Re: RFR: 8262889: Compiler implementation for Record Patterns [v4]

2022-05-09 Thread Vicente Romero
On Mon, 9 May 2022 14:37:35 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v4]

2022-05-09 Thread Vicente Romero
On Mon, 9 May 2022 14:37:35 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v4]

2022-05-09 Thread Vicente Romero
On Fri, 6 May 2022 17:40:25 GMT, Jan Lahoda wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4217: >> >>> 4215: } >>> 4216: ListBuffer outBindings = new ListBuffer<>(); >>> 4217: List recordTypes = expectedRecordTypes; >> >> nit: probably

Re: RFR: 8262889: Compiler implementation for Record Patterns [v4]

2022-05-09 Thread Jan Lahoda
> 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427+405-20220426/specs/patterns-switch-record-patterns-j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v3]

2022-05-09 Thread Maurizio Cimadamore
On Sat, 7 May 2022 12:03:04 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v3]

2022-05-07 Thread Jan Lahoda
> 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427+405-20220426/specs/patterns-switch-record-patterns-j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v2]

2022-05-06 Thread Jan Lahoda
On Fri, 6 May 2022 14:30:10 GMT, Maurizio Cimadamore wrote: >> Jan Lahoda has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Reflecting review feedback. > > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Flow.java line 752: > >>

Re: RFR: 8262889: Compiler implementation for Record Patterns [v2]

2022-05-06 Thread Jan Lahoda
On Thu, 5 May 2022 18:11:54 GMT, Vicente Romero wrote: >> Jan Lahoda has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Reflecting review feedback. > > src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4217: > >> 4215:

Re: RFR: 8262889: Compiler implementation for Record Patterns [v2]

2022-05-06 Thread Jan Lahoda
On Fri, 6 May 2022 15:44:22 GMT, Gavin Bierman wrote: > > From the JLS specdiff > > > If the type R names a generic record class then it is a compile-time > > > error if R is not a parameterized type. > > > > > > The following snippet raises a `MatchException`. Shouldn't it be a > > compile-t

Re: RFR: 8262889: Compiler implementation for Record Patterns [v2]

2022-05-06 Thread Vicente Romero
On Fri, 6 May 2022 14:09:24 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v2]

2022-05-06 Thread Gavin Bierman
On Fri, 6 May 2022 14:09:24 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v2]

2022-05-06 Thread Maurizio Cimadamore
On Fri, 6 May 2022 14:09:24 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v2]

2022-05-06 Thread Aggelos Biboudis
On Fri, 6 May 2022 14:09:24 GMT, Jan Lahoda wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep427+405/j

Re: RFR: 8262889: Compiler implementation for Record Patterns [v2]

2022-05-06 Thread Jan Lahoda
> 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427+405-20220426/specs/patterns-switch-record-patterns-j

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-06 Thread Jan Lahoda
On Wed, 4 May 2022 10:03:13 GMT, Maurizio Cimadamore wrote: >> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4180: >> >>> 4178: type = attribTree(tree.var.vartype, env, varInfo); >>> 4179: } else { >>> 4180: type = resultInfo.pt; >> >> L

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-06 Thread Maurizio Cimadamore
On Fri, 6 May 2022 10:51:33 GMT, Jan Lahoda wrote: >> I now believe that the check is needed to properly classify patterns based >> on the type of the i-th component. That said, not sure this should be a >> subtyping check, or a type equality > > A good question. Consider code like: > > pr

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-06 Thread Jan Lahoda
On Thu, 5 May 2022 15:17:11 GMT, Maurizio Cimadamore wrote: >> You are right. It is the ii) which iteratively checks the component pattern >> list L. > > I now believe that the check is needed to properly classify patterns based on > the type of the i-th component. That said, not sure this sho

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-06 Thread Aggelos Biboudis
On Thu, 5 May 2022 11:57:34 GMT, Aggelos Biboudis wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/jep42

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-05 Thread Vicente Romero
On Thu, 5 May 2022 15:21:49 GMT, Maurizio Cimadamore wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/je

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-05 Thread Maurizio Cimadamore
On Tue, 3 May 2022 12:07:50 GMT, Jan Lahoda wrote: > 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-05 Thread Maurizio Cimadamore
On Thu, 5 May 2022 12:28:42 GMT, Aggelos Biboudis wrote: >>> I think this is i) from the domination relation: >>> >>> > A record pattern with type R and record component pattern list L >>> > dominates another record pattern with type S and record component pattern >>> > list M if (i) the eras

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-05 Thread Aggelos Biboudis
On Thu, 5 May 2022 12:16:23 GMT, Maurizio Cimadamore wrote: >> I think this is i) from the domination relation: >> >>> A record pattern with type R and record component pattern list L dominates >>> another record pattern with type S and record component pattern list M if >>> (i) the erasure o

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-05 Thread Maurizio Cimadamore
On Thu, 5 May 2022 12:06:38 GMT, Aggelos Biboudis wrote: > I think this is i) from the domination relation: > > > A record pattern with type R and record component pattern list L dominates > > another record pattern with type S and record component pattern list M if > > (i) the erasure of S i

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-05 Thread Aggelos Biboudis
On Tue, 3 May 2022 12:07:50 GMT, Jan Lahoda wrote: > 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-05 Thread Aggelos Biboudis
On Wed, 4 May 2022 10:51:38 GMT, Maurizio Cimadamore wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/je

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-04 Thread Maurizio Cimadamore
On Tue, 3 May 2022 12:07:50 GMT, Jan Lahoda wrote: > 8262889: Compiler implementation for Record Patterns > > A first version of a patch that introduces record patterns into javac as a > preview feature. For the specification, please see: > http://cr.openjdk.java.net/~gbierman/jep427+405/jep427

Re: RFR: 8262889: Compiler implementation for Record Patterns

2022-05-04 Thread Maurizio Cimadamore
On Wed, 4 May 2022 09:59:33 GMT, Maurizio Cimadamore wrote: >> 8262889: Compiler implementation for Record Patterns >> >> A first version of a patch that introduces record patterns into javac as a >> preview feature. For the specification, please see: >> http://cr.openjdk.java.net/~gbierman/je