This commit is contained in:
Бондарев Иван 2017-12-29 17:08:21 +01:00
parent aaab5d8893
commit c5d0462c87
2 changed files with 25 additions and 0 deletions

View file

@ -253,11 +253,20 @@ namespace CodeCompletion
RetValue tmp = cnst_val;
string name = PascalABCCompiler.TreeConverter.name_reflector.get_name(_bin_expr.operation_type);
List<SymScope> lst = tleft.FindOverloadNamesOnlyInType(name);
List<SymScope> lst_right = tright.FindOverloadNamesOnlyInType(name);
if (lst.Count == 0 && !char.IsLetter(name[0]))
lst = tleft.FindOverloadNamesOnlyInType("operator" + name);
if (lst_right.Count == 0 && !char.IsLetter(name[0]))
lst_right = tright.FindOverloadNamesOnlyInType("operator" + name);
if (!char.IsLetter(name[0]))
name = "operator" + name;
else
name = "operator " + name;
List<ProcScope> meths = entry_scope.GetExtensionMethods(name, tleft);
foreach (ProcScope meth in meths)
lst.Add(meth);
lst.AddRange(lst_right);
meths = entry_scope.GetExtensionMethods(name, tright);
foreach (ProcScope meth in meths)
lst.Add(meth);
ProcScope ps = select_method(lst.ToArray(), tleft, tright, null, false, _bin_expr.left, _bin_expr.right);

View file

@ -0,0 +1,16 @@
type
t1=class
end;
t2=class
class function operator*(a:t1;b:t2):t2;
begin
end;
end;
begin
var a:t1;
var b:t2;
var c{@var c: t2;@} := a*b;
end.