Preserve Gotlin semantics across packages
This commit is contained in:
parent
5b30e49486
commit
acb42a5702
10 changed files with 525 additions and 34 deletions
|
|
@ -590,6 +590,11 @@ func (resolver *semanticResolver) meaning(expr Expr, scope *Scope) (ExprMeaning,
|
|||
return MappingExpression, nil
|
||||
}
|
||||
if receiver, ok := selector.Receiver.(IdentExpr); ok {
|
||||
if pack := resolver.program.Packages[receiver.Name]; pack != nil {
|
||||
if function := pack.Function(selector.Name); function != nil {
|
||||
return GotlinCallExpr, function
|
||||
}
|
||||
}
|
||||
if receiver.Name == "Result" {
|
||||
return EnumConstructionExpr, nil
|
||||
}
|
||||
|
|
@ -601,7 +606,7 @@ func (resolver *semanticResolver) meaning(expr Expr, scope *Scope) (ExprMeaning,
|
|||
return GoCallExpr, nil
|
||||
}
|
||||
if class, _ := classInstance(ResolvedType(selector.Receiver)); class != nil {
|
||||
if method, ok := class.Methods[selector.Name]; ok {
|
||||
if method := class.Method(selector.Name); method != nil {
|
||||
return MethodCallExpr, method
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue