Inject ambient context into Go calls
This commit is contained in:
parent
acb42a5702
commit
5085ae51aa
8 changed files with 112 additions and 9 deletions
|
|
@ -46,8 +46,11 @@ type HIRReference struct{ Target *Symbol }
|
|||
func (HIRReference) hirNode() {}
|
||||
|
||||
type HIRGoCall struct {
|
||||
Callee *HIRExpr
|
||||
Result Type
|
||||
Callee *HIRExpr
|
||||
Result Type
|
||||
Params []Type
|
||||
Variadic bool
|
||||
InjectContext bool
|
||||
}
|
||||
|
||||
func (HIRGoCall) hirNode() {}
|
||||
|
|
@ -498,7 +501,8 @@ func (resolver *semanticResolver) hirNode(expr Expr, semantic *HIRExpr) HIRNode
|
|||
return HIRReference{Target: semantic.Symbol}
|
||||
case GoCallExpr:
|
||||
if call, ok := expr.(CallExpr); ok {
|
||||
return HIRGoCall{Callee: exprMeta(call.Callee), Result: semantic.Type}
|
||||
signature, _ := resolver.program.goCallSignature(call)
|
||||
return HIRGoCall{Callee: exprMeta(call.Callee), Result: semantic.Type, Params: signature.Params, Variadic: signature.Variadic, InjectContext: shouldInjectCoroutineContext(call, signature)}
|
||||
}
|
||||
case GotlinCallExpr, MethodCallExpr:
|
||||
return HIRGotlinCall{Target: semantic.Symbol, Result: semantic.Type}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue