mirror of
https://github.com/golang/go
synced 2024-11-24 18:10:02 -07:00
gc: iota outside const
Fixes #1662. R=ken2 CC=golang-dev https://golang.org/cl/4828045
This commit is contained in:
parent
49b70d01c0
commit
dec8009fe8
@ -218,6 +218,7 @@ main(int argc, char *argv[])
|
|||||||
curio.nlsemi = 0;
|
curio.nlsemi = 0;
|
||||||
|
|
||||||
block = 1;
|
block = 1;
|
||||||
|
iota = -1000000;
|
||||||
|
|
||||||
yyparse();
|
yyparse();
|
||||||
if(nsyntaxerrors != 0)
|
if(nsyntaxerrors != 0)
|
||||||
|
16
test/fixedbugs/bug362.go
Normal file
16
test/fixedbugs/bug362.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
// errchk $G $D/$F.go
|
||||||
|
|
||||||
|
// Copyright 2011 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.
|
||||||
|
|
||||||
|
// issue 1662
|
||||||
|
// iota inside var
|
||||||
|
|
||||||
|
package main
|
||||||
|
|
||||||
|
var (
|
||||||
|
a = iota // ERROR "undefined: iota"
|
||||||
|
b = iota // ERROR "undefined: iota"
|
||||||
|
c = iota // ERROR "undefined: iota"
|
||||||
|
)
|
Loading…
Reference in New Issue
Block a user