[swift-dev] console error

Jo Albright me at jo2.co
Sat Jan 9 00:54:13 CST 2016


Hi Zhaoliang,

Try adding a space between the “=“ & “3” 

var i = 3

instead of

var i =3

That should fix the issue.

The second way makes it think you are trying to use it as a prefix operator instead of an assignment.

 Nerd . Designer . Developer
Jo Albright


> On Jan 9, 2016, at 12:07 AM, zhaoliang via swift-dev <swift-dev at swift.org> wrote:
> 
> hello ,
>     I find a bug like this:
> 
>     zhaoliangdeMacBook-Pro:~ zhaoliang$ swift
> Welcome to Apple Swift version 2.1.1 (swiftlang-700.1.101.15 clang-700.1.81). Type :help for assistance.
>   1> var i =3
> repl.swift:1:7: error: prefix '=' is reserved
> var i =3
>       ^
> 
>   1> var i=3
> i: Int = 3
>   2>  
> 
>  
> 
> _______________________________________________
> swift-dev mailing list
> swift-dev at swift.org
> https://lists.swift.org/mailman/listinfo/swift-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.swift.org/pipermail/swift-dev/attachments/20160109/8dea17a5/attachment.html>


More information about the swift-dev mailing list