Files
yaegi/_test/redeclaration-global5.go
mplandGitHub 1799472d96 interp: enable declaration errors detection at parsing time
The Go parser is able to detect some (but not all) (re-)decleration errors,
if the DeclarationErrors flag is enabled, which was not done so far.

This PR therefore enables that flag, which allows the removal of some of
the now unneeded code that was recently added to support redeclarations.

Fixes #811
2020-08-28 14:36:00 +02:00

17 lines
257 B
Go

package main
var time int
func time() string {
return "hello"
}
func main() {
t := time()
println(t)
}
// Error:
// ../_test/redeclaration-global5.go:5:6: time redeclared in this block
// previous declaration at ../_test/redeclaration-global5.go:3:5