]> Cypherpunks repositories - gostls13.git/commitdiff
spec: fix examples for predeclared function complex
authorRobert Griesemer <gri@golang.org>
Fri, 14 Oct 2016 18:27:11 +0000 (11:27 -0700)
committerRobert Griesemer <gri@golang.org>
Fri, 14 Oct 2016 19:58:27 +0000 (19:58 +0000)
Fixes #17398.

Change-Id: Iac7899031c1bfbadc4f84e5b374eaf1f01dff8c8
Reviewed-on: https://go-review.googlesource.com/31190
Reviewed-by: Rob Pike <r@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
doc/go_spec.html

index 5f0a16c0ff0993136d26b511c9b1f18dea6a8d74..b1a7331ca2b8fb3b901e6887b167a8e4f1e232ac 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of October 6, 2016",
+       "Subtitle": "Version of October 14, 2016",
        "Path": "/ref/spec"
 }-->
 
@@ -5755,12 +5755,12 @@ var a = complex(2, -2)             // complex128
 const b = complex(1.0, -1.4)       // untyped complex constant 1 - 1.4i
 x := float32(math.Cos(math.Pi/2))  // float32
 var c64 = complex(5, -x)           // complex64
-const s uint = complex(1, 0)       // untyped complex constant 1 + 0i can be converted to uint
-_ = complex(1, 2&lt;&lt;s)               // illegal: 2 has floating-point type, cannot shift
+var s uint = complex(1, 0)         // untyped complex constant 1 + 0i can be converted to uint
+_ = complex(1, 2&lt;&lt;s)               // illegal: 2 assumes floating-point type, cannot shift
 var rl = real(c64)                 // float32
 var im = imag(a)                   // float64
 const c = imag(b)                  // untyped constant -1.4
-_ = imag(3 &lt;&lt; s)                   // illegal: 3 has complex type, cannot shift
+_ = imag(3 &lt;&lt; s)                   // illegal: 3 assumes complex type, cannot shift
 </pre>
 
 <h3 id="Handling_panics">Handling panics</h3>