2012-02-16 21:49:59 -07:00
|
|
|
// errorcheck
|
2011-05-11 21:41:59 -06:00
|
|
|
|
2016-04-10 15:32:26 -06:00
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
2011-05-11 21:41:59 -06: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 02:58:53 -07:00
|
|
|
switch t := x.(type) {
|
|
|
|
case 0: // ERROR "type"
|
2020-11-16 09:44:40 -07:00
|
|
|
t.x = 1
|
|
|
|
x.x = 1 // ERROR "type interface \{\}|reference to undefined field or method"
|
2011-05-11 21:41:59 -06:00
|
|
|
}
|
|
|
|
}
|