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