2012-02-17 04:49:59 +00:00
|
|
|
// errorcheck
|
2011-07-29 00:41:18 +00:00
|
|
|
|
2016-04-10 21:32:26 +00:00
|
|
|
// Copyright 2011 The Go Authors. All rights reserved.
|
2011-07-29 00:41:18 +00: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-28 02:41:39 +00:00
|
|
|
err foo.Bar // ERROR "undefined|expected package"
|
2011-07-29 00:41:18 +00:00
|
|
|
Num int
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
s := S{}
|
2011-10-28 02:41:39 +00:00
|
|
|
_ = s.Num // no error here please
|
2011-07-29 00:41:18 +00:00
|
|
|
}
|