Commit b89a54e5 authored by Russ Cox's avatar Russ Cox

new, stricter interface rule:

in x.(T) x cannot be a nil (uninitialized) interface variable.

remove TODO per discussion.

DELTA=3  (1 added, 1 deleted, 1 changed)
OCL=29123
CL=29134
parent 787dd4d3
......@@ -2210,7 +2210,8 @@ x.(T)
</pre>
<p>
asserts that the value stored in <code>x</code> is of type <code>T</code>.
asserts that <code>x</code> is not the zero interface value
and that the value stored in <code>x</code> is of type <code>T</code>.
The notation <code>x.(T)</code> is called a <i>type assertion</i>.
The type of <code>x</code> must be an interface type.
</p>
......@@ -2220,7 +2221,6 @@ that the dynamic type of <code>x</code> is identical to the type <code>T</code>
(§Type identity and compatibility).
If <code>T</code> is an interface type, <code>x.(T)</code> asserts that the dynamic type
of <code>T</code> implements the interface <code>T</code> (§Interface types).
<font color=red>TODO: gri wants an error if x is already of type T.</font>
</p>
<p>
If the type assertion holds, the value of the expression is the value
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment