This commit is contained in:
Ivan Bondarev 2020-12-31 13:53:18 +01:00
parent 2fce3fcd34
commit 8ceadf6943
2 changed files with 41 additions and 2 deletions

View file

@ -4358,8 +4358,25 @@ namespace CodeCompletion
ts.loc = this.loc;
for (int i = 0; i < gen_args.Count; i++)
{
ts.AddGenericInstanceParameter(gen_args[i].si.name);
ts.AddGenericInstanciation(gen_args[i]);
TypeScope gen_arg = gen_args[i];
if (gen_arg.instances != null && gen_arg.original_type != null)
{
if (gen_arg.original_type.generic_params != null && this.generic_params != null)
for (int j = 0; j < gen_arg.original_type.generic_params.Count; j++)
{
if (string.Compare(gen_arg.original_type.generic_params[j], this.generic_params[j], true) == 0)
{
ts.AddGenericInstanceParameter(gen_arg.instances[j].si.name);
ts.AddGenericInstanciation(gen_arg.instances[j]);
}
}
}
else
{
ts.AddGenericInstanceParameter(gen_args[i].si.name);
ts.AddGenericInstanciation(gen_args[i]);
}
}
ts.si.name = this.si.name;
ts.documentation = this.documentation;
@ -5590,6 +5607,11 @@ namespace CodeCompletion
}
}
protected override TypeScope simpleGetInstance(List<TypeScope> gen_args)
{
return this.GetInstance(gen_args);
}
public override TypeScope GetInstance(List<TypeScope> gen_args, bool exact = false)
{
Type t = this.ctn;

View file

@ -0,0 +1,17 @@
type
t0<T> = class
l: List<(T, byte)>;
end;
t1 = class(t0<word>)
public procedure p1;
begin
l{@var t0<>.l: List<Tuple<word, byte>>;@} := l;
end;
end;
begin end.