Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-24 Thread Vicente Romero
On Mon, 24 Apr 2023 13:08:44 GMT, Jan Lahoda wrote: >> src/java.base/share/classes/java/lang/runtime/SwitchBootstraps.java line 315: >> >>> 313: Object[] labels = resolvedLabels.resolvedLabels; >>> 314: >>> 315: // Dumbest possible strategy >> >> I guess that given that we can'

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-24 Thread Jan Lahoda
On Fri, 21 Apr 2023 16:49:54 GMT, Vicente Romero wrote: >> Jan Lahoda has updated the pull request incrementally with two additional >> commits since the last revision: >> >> - Adding test. >> - Removing redundant continue, as noted on the review. > > src/java.base/share/classes/java/lang/run

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-24 Thread Maurizio Cimadamore
On Mon, 24 Apr 2023 12:53:59 GMT, Jan Lahoda wrote: > In this case, as long as the union type could only be present at the top > level (as opposed to e.g. a type of a record component), we could simply > require all components to be covered for union types for exhaustiveness in > `checkCovered

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-24 Thread Jan Lahoda
On Mon, 24 Apr 2023 12:05:35 GMT, Maurizio Cimadamore wrote: > > > I believe the exhaustiveness algorithm needs rules for union types, both > > > in javac and in the JLS: > > > ... > > > I would expect the above switch to be exhaustive, since it covers all > > > possible components of the unio

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-24 Thread Maurizio Cimadamore
On Mon, 24 Apr 2023 09:05:56 GMT, Rémi Forax wrote: > > I believe the exhaustiveness algorithm needs rules for union types, both in > > javac and in the JLS: > > ... > > I would expect the above switch to be exhaustive, since it covers all > > possible components of the union type. In other wor

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-24 Thread Rémi Forax
On Fri, 21 Apr 2023 16:25:04 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-24 Thread Maurizio Cimadamore
On Fri, 21 Apr 2023 16:25:04 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-21 Thread Vicente Romero
On Fri, 21 Apr 2023 16:25:04 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-21 Thread Vicente Romero
On Fri, 21 Apr 2023 16:25:04 GMT, Jan Lahoda wrote: >> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: >> >> - the pattern matching for switch and record patterns features are made >> final, together with updates to tests. >> - parenthesized patterns are removed.

Re: RFR: 8300543 Compiler Implementation for Pattern Matching for switch [v5]

2023-04-21 Thread Jan Lahoda
> This is the first draft of a patch for JEP 440 and JEP 441. Changes included: > > - the pattern matching for switch and record patterns features are made > final, together with updates to tests. > - parenthesized patterns are removed. > - qualified enum constants are supported for case label