Re: It should be possible to type a switch expression with void

2021-09-27 Thread forax
> From: "Brian Goetz" > To: "Remi Forax" , "amber-spec-experts" > > Sent: Lundi 27 Septembre 2021 17:07:06 > Subject: Re: It should be possible to type a switch expression with void > This is part of a larger problem, and I don't think point fixes are really the > answer here. For this reason

Re: It should be possible to type a switch expression with void

2021-09-27 Thread forax
- Original Message - > From: "Tagir Valeev" > To: "Remi Forax" > Cc: "amber-spec-experts" > Sent: Lundi 27 Septembre 2021 06:38:14 > Subject: Re: It should be possible to type a switch expression with void > If you expect this to be changed, the same would be expected e.g. from ?: >

Re: It should be possible to type a switch expression with void

2021-09-27 Thread Brian Goetz
This is part of a larger problem, and I don't think point fixes are really the answer here.  For this reason (and others), any sort of "type more things as void" is on hold for now.  Here's a sketch of the motivation, which comes from Valhalla. A big part of Valhalla is unifying primitives

Re: It should be possible to type a switch expression with void

2021-09-26 Thread Tagir Valeev
If you expect this to be changed, the same would be expected e.g. from ?: expression. This also would create some kind of confusion: the switch expression cannot be inside the expression statement, but the expression statement is mostly associated with void-type expression. Btw, there's another

It should be possible to type a switch expression with void

2021-09-26 Thread Remi Forax
There is a bad interaction between a lambda and a switch expression, a lambda allows its expression to be typed void but a switch expression can not be typed void, so the following code does not compile sealed interface I permits A, B {} record A() {} record B() {} public Optional