> On May 31, 2016, at 1:47 PM, Xiaodi Wu <[email protected]> wrote: > > > > On Tue, May 31, 2016 at 2:45 PM, Christopher Kornher via swift-evolution > <[email protected] <mailto:[email protected]>> wrote: >> >> Not allowed: >> … >> let a = a >> let b = b where b > 10 && a > 5 >> >> Why would this not be allowed by your rule? You're making use of `b` in your >> where clause. As I demonstrated above, essentially any assertion can be >> rewritten to work around your rule. In general: > > It is not allowed because ‘a’ is defined in the line above. It must be > defined in the ‘if let’ associated with the where in which it is mentioned. > > That's a much more restrictive where clause than you proposed earlier. You'd > not be able to write: > > ``` > let b = b where b > anyOtherVariable > ```
The definition is not a formal one, but that was the intent. ``` let b = b where b > anyOtherVariable ``` is legal as long as `anyOtherVariable` is not defined within the entire condition clause
_______________________________________________ swift-evolution mailing list [email protected] https://lists.swift.org/mailman/listinfo/swift-evolution
