mirror of
https://github.com/hanzoai/yaegi.git
synced 2026-10-01 00:49:47 +00:00
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
17 lines
257 B
Go
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
|