case OLITERAL:
ok |= Erv;
if(n->iota && !(top & Eiota))
- yyerror("use of iota outside of constant initializer");
+ yyerror("use of iota not in constant initializer");
goto ret;
case ONONAME:
ok |= Erv;
goto ret;
+ case OPACK:
+ yyerror("use of package %S not in selector", n->sym);
+ goto error;
+
/*
* types (OIND is with exprs)
*/
yyerror("embedded type cannot be a pointer");
}
break;
+
+ case OPACK:
+ // nothing to see here
+ break;
}
ret:
func main() {
f(X);
- f(iota); // ERROR "iota.*outside.*initializer"
+ f(iota); // ERROR "iota.*initializer"
f(X);
- f(iota); // ERROR "iota.*outside.*initializer"
+ f(iota); // ERROR "iota.*initializer"
}
--- /dev/null
+// errchk $G $D/$F.go
+
+// Copyright 2009 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "sort"
+
+func main() {
+ var x int;
+ sort(x); // ERROR "package.*selector"
+}