This commit is contained in:
Бондарев Иван 2018-07-18 20:57:58 +02:00
parent aa614f6e56
commit 0435ec3f5a
3 changed files with 22 additions and 16 deletions

View file

@ -4881,11 +4881,10 @@ namespace CodeCompletion
}
public override void visit(ident_with_templateparams node)
{
bool tmp_search_all = search_all;
node.name.visit(this);
if ((search_all || returned_scope == null) && returned_scopes.Count > 0)
if ((tmp_search_all || returned_scope == null) && returned_scopes.Count > 0)
{
ProcScope ps = returned_scopes[0] as ProcScope;
TypeScope ts = returned_scopes[0] as TypeScope;
List<TypeScope> template_params = new List<TypeScope>();
foreach (type_definition td in node.template_params.params_list)
{
@ -4897,10 +4896,17 @@ namespace CodeCompletion
return;
}
}
if (ps != null)
returned_scopes[0] = ps.GetInstance(template_params);
else
returned_scopes[0] = ts.GetInstance(template_params);
for (int i = 0; i < returned_scopes.Count; i++)
{
ProcScope ps = returned_scopes[i] as ProcScope;
TypeScope ts = returned_scopes[i] as TypeScope;
if (ps != null)
returned_scopes[i] = ps.GetInstance(template_params);
else
returned_scopes[i] = ts.GetInstance(template_params);
}
}
else if (returned_scope is ProcScope)
{

View file

@ -6853,9 +6853,9 @@ namespace PascalABCCompiler.NETGenerator
il.EmitCall(OpCodes.Call, mi, null);
if (tmp_dot)
{
if (mi.ReturnType.IsValueType && !NETGeneratorTools.IsPointer(mi.ReturnType))
if (value.type.is_value_type && !NETGeneratorTools.IsPointer(mi.ReturnType))
{
LocalBuilder lb = il.DeclareLocal(mi.ReturnType);
LocalBuilder lb = il.DeclareLocal(helper.GetTypeReference(value.type).tp);
il.Emit(OpCodes.Stloc, lb);
il.Emit(OpCodes.Ldloca, lb);
}

View file

@ -1,14 +1,14 @@
function Deconstruct<K, V>(d: Dictionary<K, V>): (K, V);
begin
//var kk := d.First.Key;
//var vv := d.First.Value;
//Result := (kk, vv);
var kk := d.First.Key;
var vv := d.First.Value;
Result := (kk, vv);
end;
begin
var d := new Dictionary<integer,integer>;
//d[1] := 2;
//var t := Deconstruct(d);
//assert(t.Item1 = 1);
//assert(t.Item2 = 2);
d[1] := 2;
var t := Deconstruct(d);
assert(t.Item1 = 1);
assert(t.Item2 = 2);
end.