Re: Exploring inference for sealed types

2019-10-04 Thread Peter Levart
Of course! My bad. Compilation unit which usually maps to .java file when compiling files... That's perfectly sensible as a scope to define inference within. Regards, Peter On 10/2/19 11:08 PM, Alex Buckley wrote: You speak of "compilation unit" as if it means the scope of work performed by

Re: Exploring inference for sealed types

2019-10-02 Thread Alex Buckley
You speak of "compilation unit" as if it means the scope of work performed by javac and Maven. ("compiles each module separately as its own compilation unit") That's not the meaning. The meaning is as given in https://docs.oracle.com/javase/specs/jls/se13/html/jls-7.html#jls-7.3 On 10/2/2019

Re: Exploring inference for sealed types

2019-10-02 Thread Peter Levart
Hi, On 9/24/19 8:34 PM, Brian Goetz wrote: So one sensible increment atop the baseline is: (A) if a top-level type is explicitly declared sealed, and has no permits clause, we can infer the permits clause from the subtypes in the compilation unit (or more narrowly, the _nested_ subtypes).  Thi

Re: Exploring inference for sealed types

2019-10-01 Thread John Rose
On Sep 23, 2019, at 9:04 AM, Gavin Bierman wrote: > > ... > But there are wrinkles with this design. > > 1. Obviously we will rule out the explicit declaration of an empty `permits` > clause, but what if we _infer_ one? To be concrete where we have the > compilation unit: > > ``` > sealed cla

Re: Exploring inference for sealed types

2019-10-01 Thread John Rose
À: "Remi Forax" >> Cc: "Gavin Bierman" , "amber-spec-experts" >> >> Envoyé: Mardi 1 Octobre 2019 23:02:50 >> Objet: Re: Exploring inference for sealed types > >> Baseline says that "you have to be explicit", so omitting one of th

Re: Exploring inference for sealed types

2019-10-01 Thread forax
- Mail original - > De: "Brian Goetz" > À: "Remi Forax" > Cc: "Gavin Bierman" , "amber-spec-experts" > > Envoyé: Mardi 1 Octobre 2019 23:02:50 > Objet: Re: Exploring inference for sealed types > Baseline says that "

Re: Exploring inference for sealed types

2019-10-01 Thread Brian Goetz
-experts" Envoyé: Mardi 1 Octobre 2019 22:20:17 Objet: Re: Exploring inference for sealed types Having received no further feedback, I'm inclined to proceed on Baseline+A+B. On 9/24/2019 2:34 PM, Brian Goetz wrote: So my suggestion is to start with Baseline + (A | A&B), limiting

Re: Exploring inference for sealed types

2019-10-01 Thread Remi Forax
ierman" , "amber-spec-experts" > > Envoyé: Mardi 1 Octobre 2019 22:20:17 > Objet: Re: Exploring inference for sealed types > Having received no further feedback, I'm inclined to proceed on > Baseline+A+B. > > On 9/24/2019 2:34 PM, Brian Goetz wrot

Re: Exploring inference for sealed types

2019-10-01 Thread Brian Goetz
Having received no further feedback, I'm inclined to proceed on Baseline+A+B. On 9/24/2019 2:34 PM, Brian Goetz wrote: So my suggestion is to start with Baseline + (A | A&B), limiting inference to permits clauses, and see if that is enough.

Re: Exploring inference for sealed types

2019-09-24 Thread Brian Goetz
Thanks Gavin.  We had an internal discussion on this today, which I will summarize here to help illuminate the issue. As Brian mentioned in an earlier email, sealed types address two related, but distinct, issues: (1) declaring a sum type, whereby the compiler can exploit exhaustiveness in vari

Exploring inference for sealed types

2019-09-23 Thread Gavin Bierman
Dear experts: We have been discussing some tweaks to the sealed types design. I thought it would be useful to elucidate the ideas, and also to explain some of the wrinkles. As always, we're interested to hear any thoughts you may have. As Brian mentioned in an earlier email, sealed types address