2012-02-17 04:51:04 +00:00
|
|
|
// errorcheck
|
2010-05-21 05:57:08 +00:00
|
|
|
|
2016-04-10 21:32:26 +00:00
|
|
|
// Copyright 2010 The Go Authors. All rights reserved.
|
2010-05-21 05:57:08 +00:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
2012-02-24 00:48:19 +00:00
|
|
|
// Verify that a couple of illegal variable declarations are caught by the compiler.
|
|
|
|
// Does not compile.
|
|
|
|
|
2010-05-21 05:57:08 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
func main() {
|
2010-09-10 19:45:46 +00:00
|
|
|
_ = asdf // ERROR "undefined.*asdf"
|
2010-05-21 05:57:08 +00:00
|
|
|
|
2010-09-10 19:45:46 +00:00
|
|
|
new = 1 // ERROR "use of builtin new not in function call|invalid left hand side"
|
2010-05-21 05:57:08 +00:00
|
|
|
}
|
|
|
|
|