Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
go
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
go
Commits
7743ffea
Commit
7743ffea
authored
Sep 28, 2009
by
Russ Cox
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disallow interface { x, y() }
R=ken OCL=35042 CL=35044
parent
2e5a136e
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
21 additions
and
18 deletions
+21
-18
src/cmd/gc/go.y
src/cmd/gc/go.y
+9
-10
test/fixedbugs/bug121.go
test/fixedbugs/bug121.go
+4
-1
test/ken/embed.go
test/ken/embed.go
+6
-6
test/ken/interfun.go
test/ken/interfun.go
+2
-1
No files found.
src/cmd/gc/go.y
View file @
7743ffea
...
...
@@ -54,7 +54,7 @@
%type <node> expr_or_type
%type <node> fndcl fnliteral
%type <node> for_body for_header for_stmt if_header if_stmt
%type <node> keyval labelname name
%type <node>
interfacedcl
keyval labelname name
%type <node> name_or_type non_expr_type
%type <node> new_name dcl_name oexpr typedclname
%type <node> onew_name
...
...
@@ -67,7 +67,7 @@
%type <list> xdcl fnbody fnres switch_body loop_body dcl_name_list
%type <list> new_name_list expr_list keyval_list braced_keyval_list expr_or_type_list xdcl_list
%type <list> oexpr_list oexpr_or_type_list caseblock_list stmt_list oarg_type_list arg_type_list
%type <list> interfacedcl_list
interfacedcl
vardcl vardcl_list structdcl structdcl_list
%type <list> interfacedcl_list vardcl vardcl_list structdcl structdcl_list
%type <list> common_dcl constdcl constdcl1 constdcl_list typedcl_list
%type <node> convtype dotdotdot
...
...
@@ -1226,9 +1226,12 @@ structdcl_list:
interfacedcl_list:
interfacedcl
{
$$ = list1($1);
}
| interfacedcl_list '
;
' interfacedcl
{
$$ =
conca
t($1, $3);
$$ =
lis
t($1, $3);
}
structdcl:
...
...
@@ -1284,17 +1287,13 @@ embed:
}
interfacedcl:
new_name
_list
indcl
new_name indcl
{
NodeList *l;
for(l=$1; l; l=l->next)
l->n = nod(ODCLFIELD, l->n, $2);
$$ = $1;
$$ = nod(ODCLFIELD, $1, $2);
}
| packname
{
$$ =
list1(nod(ODCLFIELD, N, oldname($1)
));
$$ =
nod(ODCLFIELD, N, oldname($1
));
}
indcl:
...
...
test/fixedbugs/bug121.go
View file @
7743ffea
...
...
@@ -9,7 +9,10 @@ package main
type
T
func
()
type
I
interface
{
f
,
g
();
f
,
g
();
// ERROR "syntax|signature"
}
type
J
interface
{
h
T
;
// ERROR "syntax|signature"
}
test/ken/embed.go
View file @
7743ffea
...
...
@@ -10,12 +10,12 @@ package main
type
I
interface
{
test1
,
test2
,
test3
,
test4
,
test5
,
test6
,
test1
()
int
;
test2
()
int
;
test3
()
int
;
test4
()
int
;
test5
()
int
;
test6
()
int
;
test7
()
int
;
};
...
...
test/ken/interfun.go
View file @
7743ffea
...
...
@@ -18,7 +18,8 @@ type I1 interface
type
I2
interface
{
g
,
f
()
int
;
g
()
int
;
f
()
int
;
}
func
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment