mirror of
https://github.com/golang/go
synced 2024-11-26 18:06:55 -07:00
2 minor bugs
R=r OCL=20906 CL=20906
This commit is contained in:
parent
57bd0da375
commit
7dd62cb3bc
@ -701,13 +701,12 @@ testdclstack(void)
|
|||||||
static void
|
static void
|
||||||
redeclare(char *str, Sym *s)
|
redeclare(char *str, Sym *s)
|
||||||
{
|
{
|
||||||
if(s->block != block) {
|
if(s->block == block) {
|
||||||
|
yyerror("%s %S redeclared in this block", str, s);
|
||||||
|
print(" previous declaration at %L\n", s->lastlineno);
|
||||||
|
}
|
||||||
s->block = block;
|
s->block = block;
|
||||||
s->lastlineno = lineno;
|
s->lastlineno = lineno;
|
||||||
return;
|
|
||||||
}
|
|
||||||
yyerror("%s %S redeclared in this block %d", str, s, block);
|
|
||||||
print(" previous declaration at %L\n", s->lastlineno);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
@ -1087,6 +1087,7 @@ nametype:
|
|||||||
LATYPE
|
LATYPE
|
||||||
{
|
{
|
||||||
if($1->otype != T && $1->otype->etype == TANY)
|
if($1->otype != T && $1->otype->etype == TANY)
|
||||||
|
if(strcmp(package, "PACKAGE") != 0)
|
||||||
yyerror("the any type is restricted");
|
yyerror("the any type is restricted");
|
||||||
$$ = oldtype($1);
|
$$ = oldtype($1);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user