Skip to content
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bir/bir_gen.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ func GenBir(ctx *context.CompilerContext, ast *ast.BLangPackage) *BIRPackage {
birPkg.MainFunction = birFunc
}
}
birPkg.TypeCtx = semtypes.ContextFrom(ctx.GetTypeEnv())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this is a good idea. Type context is suppose to be for each thread not package. Each thread needs to create that threads type context using the type environment (which should be shared by all in the interpreter)

return birPkg
}

Expand Down
1 change: 1 addition & 0 deletions bir/model.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ type (
Functions []BIRFunction
Constants []BIRConstant
MainFunction *BIRFunction
TypeCtx semtypes.Context
}

BIRImportModule struct {
Expand Down
116 changes: 115 additions & 1 deletion corpus/ast/subset4/04-typetest/1-v.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 40 additions & 0 deletions corpus/bal/subset4/04-typetest/1-v.bal

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

122 changes: 122 additions & 0 deletions corpus/bir/subset4/04-typetest/1-v.txt

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading