1
0
mirror of https://github.com/golang/go synced 2024-11-12 00:20:22 -07:00
go/test/switch2.go
Robert Griesemer 7218b79f23 cmd/compile: match markdcl and popdcl even in case of errors
Change-Id: I22a8a233bc157fa09cd0283fcd4bc14d90faed70
Reviewed-on: https://go-review.googlesource.com/17066
Reviewed-by: Chris Manghane <cmang@golang.org>
2015-11-20 19:56:11 +00:00

25 lines
453 B
Go

// errorcheck
// Copyright 2015 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// Check various syntax errors with switches.
package main
func _() {
switch {
case 0; // ERROR "expecting := or = or : or comma"
}
switch {
case 0; // ERROR "expecting := or = or : or comma"
default:
}
switch {
if x: // ERROR "expecting case or default or }"
}
}