2012-02-17 04:49:59 +00:00
|
|
|
// errorcheck
|
2011-05-12 03:41:59 +00:00
|
|
|
|
2016-04-10 21:32:26 +00:00
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
2011-05-12 03:41:59 +00:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// Issue 1606.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
var x interface{}
|
2011-11-09 09:58:53 +00:00
|
|
|
switch t := x.(type) {
|
|
|
|
case 0: // ERROR "type"
|
2020-11-16 16:44:40 +00:00
|
|
|
t.x = 1
|
2020-12-10 04:14:07 +00:00
|
|
|
x.x = 1 // ERROR "type interface \{\}|reference to undefined field or method|interface with no methods|undefined"
|
2011-05-12 03:41:59 +00:00
|
|
|
}
|
|
|
|
}
|