star = "*";
t = t->left;
}
- if(t->sym == S)
- return n;
+ if(t->sym == S || isblank(n))
+ return newname(n->sym);
snprint(buf, sizeof(buf), "%s%S·%S", star, t->sym, n->sym);
return newname(pkglookup(buf, t->sym->package));
}
importdot(import);
break;
}
+ if(my->name[0] == '_' && my->name[1] == '\0')
+ break;
// TODO(rsc): this line is needed for a package
// which does bytes := in a function, which creates
$$ = parserline();
pkgimportname = S;
pkgmyname = $1;
- if(pkgmyname->def)
- redeclare(pkgmyname, "as imported package name");
+ if($1->def && ($1->name[0] != '_' || $1->name[1] != '\0'))
+ redeclare($1, "as imported package name");
importfile(&$2);
}
| '.' LLITERAL
| xdcl_list xdcl
{
$$ = concat($1, $2);
+ testdclstack();
}
vardcl_list:
n = *np;
if(n == N)
return N;
-
+
// Skip typecheck if already done.
// But re-typecheck ONAME/OTYPE/OLITERAL/OPACK node in case context has changed.
if(n->typecheck == 1) {
}
yyerror("cannot slice %#N (type %T)", l, t);
goto error;
-
+
/*
* call and call like
*/
*/
if(nt == T)
return 0;
-
+
if(t->etype == TBLANK) {
*op = OCONVNOP;
return 0;
{
Type *t, *rcvr;
+//dump("nname", n->nname);
typecheck(&n->nname, Erv | Easgn);
if((t = n->nname->type) == T)
return;
n->type = t;
rcvr = getthisx(t)->type;
- if(rcvr != nil && n->shortname != N)
+ if(rcvr != nil && n->shortname != N && !isblank(n->shortname))
addmethod(n->shortname->sym, t, 1);
}
package main
+import _ "fmt"
+
var call string
type T struct {
_, _, _ int;
}
+func (T) _() {
+}
+
+func (T) _() {
+}
+
const (
c0 = iota;
_;
return 23;
}
-func main()
-{
+func main() {
_, _ = f();
a, _ := f();
if a != 1 {panic(a)}