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