2012-02-16 23:49:59 -05:00
|
|
|
// errorcheck
|
2011-07-28 20:41:18 -04:00
|
|
|
|
2016-04-10 14:32:26 -07:00
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
2011-07-28 20:41:18 -04:00
|
|
|
// Use of this source code is governed by a BSD-style
|
|
|
|
// license that can be found in the LICENSE file.
|
|
|
|
|
|
|
|
// check that compiler doesn't stop reading struct def
|
|
|
|
// after first unknown type.
|
|
|
|
|
|
|
|
// Fixes issue 2110.
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
type S struct {
|
2011-10-27 19:41:39 -07:00
|
|
|
err foo.Bar // ERROR "undefined|expected package"
|
2011-07-28 20:41:18 -04:00
|
|
|
Num int
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
s := S{}
|
2011-10-27 19:41:39 -07:00
|
|
|
_ = s.Num // no error here please
|
2011-07-28 20:41:18 -04:00
|
|
|
}
|