Commit 13dac655 authored by Russ Cox's avatar Russ Cox

disallow interface {x, y()}

R=gri
DELTA=8  (3 added, 0 deleted, 5 changed)
OCL=35045
CL=35047
parent fc61b777
...@@ -923,15 +923,16 @@ that is any superset of the interface. Such a type is said to ...@@ -923,15 +923,16 @@ that is any superset of the interface. Such a type is said to
<pre class="ebnf"> <pre class="ebnf">
InterfaceType = "interface" "{" [ MethodSpecList ] "}" . InterfaceType = "interface" "{" [ MethodSpecList ] "}" .
MethodSpecList = MethodSpec { ";" MethodSpec } [ ";" ] . MethodSpecList = MethodSpec { ";" MethodSpec } [ ";" ] .
MethodSpec = IdentifierList Signature | InterfaceTypeName . MethodSpec = identifier Signature | InterfaceTypeName .
InterfaceTypeName = TypeName . InterfaceTypeName = TypeName .
</pre> </pre>
<pre> <pre>
// A simple File interface // A simple File interface
interface { interface {
Read, Write (b Buffer) bool; Read(b Buffer) bool;
Close (); Write(b Buffer) bool;
Close();
} }
</pre> </pre>
...@@ -972,7 +973,8 @@ to define an interface called <code>Lock</code>: ...@@ -972,7 +973,8 @@ to define an interface called <code>Lock</code>:
<pre> <pre>
type Lock interface { type Lock interface {
Lock, Unlock (); Lock();
Unlock();
} }
</pre> </pre>
...@@ -999,7 +1001,8 @@ in the interface. ...@@ -999,7 +1001,8 @@ in the interface.
<pre> <pre>
type ReadWrite interface { type ReadWrite interface {
Read, Write (b Buffer) bool; Read(b Buffer) bool;
Write(b Buffer) bool;
} }
type File interface { type File interface {
......
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