]> Cypherpunks repositories - gostls13.git/commitdiff
spec: fix incorrect type in a shift example
authorRobert Griesemer <gri@golang.org>
Thu, 16 Sep 2021 22:00:47 +0000 (15:00 -0700)
committerRobert Griesemer <gri@golang.org>
Thu, 16 Sep 2021 23:13:48 +0000 (23:13 +0000)
Thanks to @bodar (Github) for finding this.

Fixes #48422.

Change-Id: I031c3d82a02db1d204e2b86b494d89784d37f073
Reviewed-on: https://go-review.googlesource.com/c/go/+/350409
Trust: Robert Griesemer <gri@golang.org>
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
doc/go_spec.html

index 6cc0b796b9a915020f33de3c3dc4b07d895223c7..c8051f58af4fb4bad294b50c043f0477b5814c97 100644 (file)
@@ -1,6 +1,6 @@
 <!--{
        "Title": "The Go Programming Language Specification",
-       "Subtitle": "Version of Sep 14, 2021",
+       "Subtitle": "Version of Sep 16, 2021",
        "Path": "/ref/spec"
 }-->
 
@@ -3614,7 +3614,7 @@ var i = 1&lt;&lt;s                   // 1 has type int
 var j int32 = 1&lt;&lt;s             // 1 has type int32; j == 0
 var k = uint64(1&lt;&lt;s)           // 1 has type uint64; k == 1&lt;&lt;33
 var m int = 1.0&lt;&lt;s             // 1.0 has type int; m == 1&lt;&lt;33
-var n = 1.0&lt;&lt;s == j            // 1.0 has type int; n == true
+var n = 1.0&lt;&lt;s == j            // 1.0 has type int32; n == true
 var o = 1&lt;&lt;s == 2&lt;&lt;s           // 1 and 2 have type int; o == false
 var p = 1&lt;&lt;s == 1&lt;&lt;33          // 1 has type int; p == true
 var u = 1.0&lt;&lt;s                 // illegal: 1.0 has type float64, cannot shift