fixed fix #974
This commit is contained in:
parent
aa614f6e56
commit
0435ec3f5a
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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.
|
||||
Loading…
Reference in a new issue