mirror of
https://github.com/golang/go
synced 2024-09-15 22:20:06 +00:00
spec: adjust representability rules for type parameters
Change-Id: I4423a059527066c4418c195911f8184dfd3f5a15 Reviewed-on: https://go-review.googlesource.com/c/go/+/365914 Trust: Robert Griesemer <gri@golang.org> Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
5d8c49a5a1
commit
003e7faf53
|
@ -1876,7 +1876,9 @@ by a value of type <code>T</code>.
|
|||
|
||||
<p>
|
||||
A <a href="#Constants">constant</a> <code>x</code> is <i>representable</i>
|
||||
by a value of type <code>T</code> if one of the following conditions applies:
|
||||
by a value of type <code>T</code>,
|
||||
where <code>T</code> is not a <a href="#Type_parameters">type parameter</a>,
|
||||
if one of the following conditions applies:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
|
@ -1899,6 +1901,12 @@ are representable by values of <code>T</code>'s component type (<code>float32</c
|
|||
</li>
|
||||
</ul>
|
||||
|
||||
<p>
|
||||
If <code>T</code> is a type parameter with <a href="#Structure_of_interfaces">specific types</a>,
|
||||
<code>x</code> is representable by a value of type <code>T</code> if <code>x</code> is representable
|
||||
by a value of each specific type of <code>T</code>.
|
||||
</p>
|
||||
|
||||
<pre>
|
||||
x T x is representable by a value of T because
|
||||
|
||||
|
|
Loading…
Reference in a new issue