diff --git a/doc/go_spec.html b/doc/go_spec.html index 246a3656ad..5f84a29645 100644 --- a/doc/go_spec.html +++ b/doc/go_spec.html @@ -3448,16 +3448,20 @@ Conversion = Type "(" Expression [ "," ] ")" .

If the type starts with the operator * or <-, -or the keyword func, it must be parenthesized: +or if the type starts with the keyword func +and has no result list, it must be parenthesized when +necessary to avoid ambiguity:

 *Point(p)        // same as *(Point(p))
-(*Point)(p)      // p is converted to (*Point)
+(*Point)(p)      // p is converted to *Point
 <-chan int(c)    // same as <-(chan int(c))
-(<-chan int)(c)  // c is converted to (<-chan int)
+(<-chan int)(c)  // c is converted to <-chan int
 func()(x)        // function signature func() x
-(func())(x)      // x is converted to (func())
+(func())(x)      // x is converted to func()
+(func() int)(x)  // x is converted to func() int
+func() int(x)    // x is converted to func() int (unambiguous)
 

@@ -3553,12 +3557,6 @@ implements this functionality under restricted circumstances.

-

-Implementation restriction: For backward-compatibility with the Go 1 language -specification, a compiler may accept non-parenthesized literal function types -in conversions where the syntax is unambiguous. -

-

Conversions between numeric types