aboutsummaryrefslogtreecommitdiff
path: root/src/go/types/decl.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/go/types/decl.go')
-rw-r--r--src/go/types/decl.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/go/types/decl.go b/src/go/types/decl.go
index 7f157f528a..0fdcfa8023 100644
--- a/src/go/types/decl.go
+++ b/src/go/types/decl.go
@@ -65,6 +65,12 @@ func (check *Checker) objDecl(obj Object, def *Named) {
}()
}
+ // Funcs with m.instRecv set have not yet be completed. Complete them now
+ // so that they have a type when objDecl exits.
+ if m, _ := obj.(*Func); m != nil && m.instRecv != nil {
+ check.completeMethod(check.conf.Environment, m)
+ }
+
// Checking the declaration of obj means inferring its type
// (and possibly its value, for constants).
// An object's type (and thus the object) may be in one of