Commit 3e98a407 authored by Russ Cox's avatar Russ Cox

bug188 - sort(x)

R=ken
OCL=33123
CL=33123
parent 7dbb6870
...@@ -86,7 +86,7 @@ reswitch: ...@@ -86,7 +86,7 @@ reswitch:
case OLITERAL: case OLITERAL:
ok |= Erv; ok |= Erv;
if(n->iota && !(top & Eiota)) if(n->iota && !(top & Eiota))
yyerror("use of iota outside of constant initializer"); yyerror("use of iota not in constant initializer");
goto ret; goto ret;
case ONONAME: case ONONAME:
...@@ -101,6 +101,10 @@ reswitch: ...@@ -101,6 +101,10 @@ reswitch:
ok |= Erv; ok |= Erv;
goto ret; goto ret;
case OPACK:
yyerror("use of package %S not in selector", n->sym);
goto error;
/* /*
* types (OIND is with exprs) * types (OIND is with exprs)
*/ */
......
...@@ -230,6 +230,10 @@ walkdef(Node *n) ...@@ -230,6 +230,10 @@ walkdef(Node *n)
yyerror("embedded type cannot be a pointer"); yyerror("embedded type cannot be a pointer");
} }
break; break;
case OPACK:
// nothing to see here
break;
} }
ret: ret:
......
...@@ -12,7 +12,7 @@ func f(x int) { } ...@@ -12,7 +12,7 @@ func f(x int) { }
func main() { func main() {
f(X); f(X);
f(iota); // ERROR "iota.*outside.*initializer" f(iota); // ERROR "iota.*initializer"
f(X); f(X);
f(iota); // ERROR "iota.*outside.*initializer" f(iota); // ERROR "iota.*initializer"
} }
// 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"
}
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