// declaration before recursing.
t := importtype(r.p.ipkg, pos, n.Sym)
+ // We also need to defer width calculations until
+ // after the underlying type has been assigned.
+ //
+ // TODO(mdempsky): Add nesting support directly to
+ // {defer,resume}checkwidth? Width calculations are
+ // already deferred during initial typechecking, but
+ // not when we're expanding inline function bodies, so
+ // we currently need to handle both cases here.
+ deferring := defercalc != 0
+ if !deferring {
+ defercheckwidth()
+ }
underlying := r.typ()
copytype(typenod(t), underlying)
+ if !deferring {
+ resumecheckwidth()
+ }
if underlying.IsInterface() {
break
t := types.New(TINTER)
t.SetPkg(r.currPkg)
t.SetInterface(append(embeddeds, methods...))
+
+ // Ensure we expand the interface in the frontend (#25055).
+ checkwidth(t)
+
return t
}
}
--- /dev/null
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package a
+
+var A chan *interface{}
--- /dev/null
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package b
+
+import "./a"
+
+var _ = <-a.A
--- /dev/null
+// compiledir -c=2
+
+// Copyright 2018 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package ignored