1
0
mirror of https://github.com/golang/go synced 2024-11-24 19:50:18 -07:00

disallow interface {x, y()}

R=gri
DELTA=8  (3 added, 0 deleted, 5 changed)
OCL=35045
CL=35047
This commit is contained in:
Russ Cox 2009-09-28 14:16:33 -07:00
parent fc61b77754
commit 13dac655cb

View File

@ -923,15 +923,16 @@ that is any superset of the interface. Such a type is said to
<pre class="ebnf">
InterfaceType = "interface" "{" [ MethodSpecList ] "}" .
MethodSpecList = MethodSpec { ";" MethodSpec } [ ";" ] .
MethodSpec = IdentifierList Signature | InterfaceTypeName .
MethodSpec = identifier Signature | InterfaceTypeName .
InterfaceTypeName = TypeName .
</pre>
<pre>
// A simple File interface
interface {
Read, Write (b Buffer) bool;
Close ();
Read(b Buffer) bool;
Write(b Buffer) bool;
Close();
}
</pre>
@ -972,7 +973,8 @@ to define an interface called <code>Lock</code>:
<pre>
type Lock interface {
Lock, Unlock ();
Lock();
Unlock();
}
</pre>
@ -999,7 +1001,8 @@ in the interface.
<pre>
type ReadWrite interface {
Read, Write (b Buffer) bool;
Read(b Buffer) bool;
Write(b Buffer) bool;
}
type File interface {