[swift-evolution] Proposal: x == 2 should not be a valid statement
radexpl at gmail.com
Thu Feb 11 17:48:27 CST 2016
I agree an expression like `x==2`, not being passed on or assigned to anything, should generate a warning and a helpful fixit. No reason to make it an error.
Implicit return doesn’t change this AFAICT.
> On 12 Feb 2016, at 00:41, Jonathan Tang via swift-evolution <swift-evolution at swift.org> wrote:
> On Thu, Feb 11, 2016 at 3:32 PM, Amir Michail via swift-evolution <swift-evolution at swift.org <mailto:swift-evolution at swift.org>> wrote:
> It’s too easy to accidentally write “x==2” instead of “x=2”.
> I don’t think something like “x==2” should be a valid statement.
> I'd love to see this become a compiler warning. Unsure about making it an error; how would it affect implicit return from lambdas?
> swift-evolution mailing list
> swift-evolution at swift.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the swift-evolution