From 5567b878915f7c2f1e7ee3898125c2cd2b7fe287 Mon Sep 17 00:00:00 2001 From: Robert Griesemer Date: Fri, 14 Oct 2016 11:27:11 -0700 Subject: [PATCH] spec: fix examples for predeclared function complex Fixes #17398. Change-Id: Iac7899031c1bfbadc4f84e5b374eaf1f01dff8c8 Reviewed-on: https://go-review.googlesource.com/31190 Reviewed-by: Rob Pike Reviewed-by: Matthew Dempsky --- doc/go_spec.html | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/doc/go_spec.html b/doc/go_spec.html index 5f0a16c0ff..b1a7331ca2 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -1,6 +1,6 @@ @@ -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<<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<<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 << s) // illegal: 3 has complex type, cannot shift +_ = imag(3 << s) // illegal: 3 assumes complex type, cannot shift

Handling panics

-- 2.48.1