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