Re: Draft JLS spec for JEP 305: Pattern matching for instanceof

2019-09-20 Thread Gavin Bierman
Thanks Tagir. Will address this in the next draft. Gavin > On 20 Sep 2019, at 03:31, Tagir Valeev wrote: > > Hello, Gavin! > > In general, the spec draft looks good. I have a question about > annotations. Currently section 9.6.4.1. @Target says: > > 9. Local variable declarations (including l

Re: Draft JLS spec for JEP 305: Pattern matching for instanceof

2019-09-20 Thread Remi Forax
I don't remember if we have discuss this or not but if i read the spec correctly, there is no support for the operator ?: so a code like this is ok if (o instanceof String s) { return s.length(); } else { return 0; } while a code like this is not return (o instanceof String s)? s.length

Re: Draft JLS spec for JEP 305: Pattern matching for instanceof

2019-09-20 Thread Brian Goetz
The rules for scoping outlined here http://cr.openjdk.java.net/~briangoetz/amber/pattern-semantics.html certainly covered the propagation of binding variables through ternaries. And those rules appear to be covered by 6.

Re: Draft JLS spec for JEP 305: Pattern matching for instanceof

2019-09-20 Thread Remi Forax
De: "Gavin Bierman" À: "amber-spec-experts" Envoyé: Jeudi 19 Septembre 2019 11:28:42 Objet: Draft JLS spec for JEP 305: Pattern matching for instanceof BQ_BEGIN A draft language spec for JEP 305 (Pattern Matching for instanceof) is available at: [ http://cr.openjdk.java.net/~gbie

Re: Draft JLS spec for JEP 305: Pattern matching for instanceof

2019-09-20 Thread forax
> De: "Brian Goetz" > À: "Remi Forax" > Cc: "Gavin Bierman" , "amber-spec-experts" > > Envoyé: Vendredi 20 Septembre 2019 16:01:14 > Objet: Re: Draft JLS spec for JEP 305: Pattern matching for instanceof > The rules for scoping outlined here > [ http://cr.openjdk.java.net/~briangoetz/amber/pat

Re: Draft JLS spec for JEP 305: Pattern matching for instanceof

2019-09-20 Thread Brian Goetz
> 1. The instanceof operator restricts the type to be a reifiable reference > type. The spec currently keeps that restriction for type test patterns too. > But should we go further, i.e. will people expect to be able to say the > following (given that this *declares* a pattern variable l)? > >

Re: Draft JLS spec for JEP 305: Pattern matching for instanceof

2019-09-20 Thread forax
> De: "Brian Goetz" > À: "Remi Forax" > Cc: "Gavin Bierman" , "amber-spec-experts" > > Envoyé: Vendredi 20 Septembre 2019 16:12:48 > Objet: Re: Draft JLS spec for JEP 305: Pattern matching for instanceof >>> 1. The instanceof operator restricts the type to be a reifiable reference >>> type. >>