Skip to content

Commit

Permalink
Merge pull request #1669 from xushiwei/class
Browse files Browse the repository at this point in the history
preloadGopFile bugfix: pkg.SetCurFile
  • Loading branch information
xushiwei committed Jan 25, 2024
2 parents 383ee1c + 1f3b620 commit 946a877
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cl/compile.go
Original file line number Diff line number Diff line change
Expand Up @@ -762,11 +762,15 @@ func preloadGopFile(p *gox.Package, ctx *blockCtx, file string, f *ast.File, con
}
old, _ := p.SetCurFile(goFile, true)
defer p.RestoreCurFile(old)

decl := p.NewTypeDefs().NewType(classType)
ld.typInit = func() { // decycle
if debugLoad {
log.Println("==> Load > InitType", classType)
}
old, _ := p.SetCurFile(goFile, true)
defer p.RestoreCurFile(old)

pkg := p.Types
var flds []*types.Var
var tags []string
Expand Down

0 comments on commit 946a877

Please sign in to comment.