This was exactly the motivation for the proposal and a similar example was 
given on the first email of the thread.

Try this:

func test() { print("A") }
func t​est() { print("B") }
func te​st() { print("C") }

let abc = 1
let a​bc = 2
let ab​c = 3

test()
t​est()
te​st()

print(abc)
print(a​bc)
print(ab​c)

Sincerely,
João Pinheiro


> On 23 Jun 2016, at 22:59, Josh Wisenbaker via swift-evolution 
> <[email protected]> wrote:
> 
> 
>> On Jun 23, 2016, at 4:45 PM, Xiaodi Wu via swift-evolution 
>> <[email protected] <mailto:[email protected]>> wrote:
>> 
>> Let me correct myself: what I think Josh's example is should be corrected 
>> whether we prohibit or ignore. However, since no one can see the invisible 
>> characters he used, I can't say for sure.
>> 
>> If he found a clever way to reorder or change spacing between letters (e.g. 
>> superimpose two characters so that "var11" looks like "var1"), then the 
>> problem can only be fixed by prohibition.
> 
> I asked my colleague who played the prank on me and got the details:
> 
> "Lines 4 and 5 declare variables with embedded Unicode Zero Width Spaces 
> (U+200B) in their names. Line 4 is actually  “var\U+200B1”, not “var1”. Isn’t 
> it nice of Swift to be this flexible 😊”
> 
> Josh
> 
> 
> Josh Wisenbaker
> [email protected] <mailto:[email protected]>
> 
> 
> 
> _______________________________________________
> swift-evolution mailing list
> [email protected]
> https://lists.swift.org/mailman/listinfo/swift-evolution

_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to