aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/typecheck/iimport.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/compile/internal/typecheck/iimport.go')
-rw-r--r--src/cmd/compile/internal/typecheck/iimport.go9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/typecheck/iimport.go b/src/cmd/compile/internal/typecheck/iimport.go
index 7b61260e79..a45bbfd1f8 100644
--- a/src/cmd/compile/internal/typecheck/iimport.go
+++ b/src/cmd/compile/internal/typecheck/iimport.go
@@ -1289,13 +1289,8 @@ func (r *importReader) node() ir.Node {
cvars := make([]*ir.Name, r.int64())
for i := range cvars {
cvars[i] = ir.CaptureName(r.pos(), fn, r.localName().Canonical())
- if go117ExportTypes {
- if cvars[i].Type() != nil || cvars[i].Defn == nil {
- base.Fatalf("bad import of closure variable")
- }
- // Closure variable should have Defn set, which is its captured
- // variable, and it gets the same type as the captured variable.
- cvars[i].SetType(cvars[i].Defn.Type())
+ if go117ExportTypes && cvars[i].Defn == nil {
+ base.Fatalf("bad import of closure variable")
}
}
fn.ClosureVars = cvars