Skip to content

Commit 5402b43

Browse files
committed
spec: fix incorrect type in a shift example
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 <[email protected]> Run-TryBot: Robert Griesemer <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
1 parent d09e09b commit 5402b43

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

doc/go_spec.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<!--{
22
"Title": "The Go Programming Language Specification",
3-
"Subtitle": "Version of Sep 14, 2021",
3+
"Subtitle": "Version of Sep 16, 2021",
44
"Path": "/ref/spec"
55
}-->
66

@@ -3614,7 +3614,7 @@ <h3 id="Operators">Operators</h3>
36143614
var j int32 = 1&lt;&lt;s // 1 has type int32; j == 0
36153615
var k = uint64(1&lt;&lt;s) // 1 has type uint64; k == 1&lt;&lt;33
36163616
var m int = 1.0&lt;&lt;s // 1.0 has type int; m == 1&lt;&lt;33
3617-
var n = 1.0&lt;&lt;s == j // 1.0 has type int; n == true
3617+
var n = 1.0&lt;&lt;s == j // 1.0 has type int32; n == true
36183618
var o = 1&lt;&lt;s == 2&lt;&lt;s // 1 and 2 have type int; o == false
36193619
var p = 1&lt;&lt;s == 1&lt;&lt;33 // 1 has type int; p == true
36203620
var u = 1.0&lt;&lt;s // illegal: 1.0 has type float64, cannot shift

0 commit comments

Comments
 (0)