tests for bug List<T> IndexOf
This commit is contained in:
parent
449563bc1b
commit
59e1bfc8bc
|
|
@ -15,7 +15,7 @@ internal static class RevisionClass
|
|||
public const string Major = "3";
|
||||
public const string Minor = "3";
|
||||
public const string Build = "5";
|
||||
public const string Revision = "1662";
|
||||
public const string Revision = "1663";
|
||||
|
||||
public const string MainVersion = Major + "." + Minor;
|
||||
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
%MINOR%=3
|
||||
%REVISION%=1662
|
||||
%COREVERSION%=5
|
||||
%REVISION%=1663
|
||||
%MINOR%=3
|
||||
%MAJOR%=3
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
!define VERSION '3.3.5.1662'
|
||||
!define VERSION '3.3.5.1663'
|
||||
|
|
|
|||
12
TestSuite/inheritanceFromListInt.pas
Normal file
12
TestSuite/inheritanceFromListInt.pas
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
type
|
||||
MyList<T> = class(List<T>)
|
||||
public
|
||||
end;
|
||||
|
||||
begin
|
||||
var l := new MyList<integer>;
|
||||
l.Add(3);
|
||||
l.Add(3);
|
||||
l.Add(7);
|
||||
Assert(l.IndexOf(7)=2);
|
||||
end.
|
||||
13
TestSuite/inheritanceFromListStudent.pas
Normal file
13
TestSuite/inheritanceFromListStudent.pas
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
type
|
||||
Student = class
|
||||
name: string;
|
||||
end;
|
||||
MyList<T> = class(List<T>)
|
||||
public
|
||||
end;
|
||||
|
||||
begin
|
||||
var l := new MyList<Student>;
|
||||
l.Add(new Student);
|
||||
Assert(l.IndexOf(l[0])=0);
|
||||
end.
|
||||
|
|
@ -1684,11 +1684,13 @@ namespace PascalABCCompiler.TreeRealization
|
|||
|
||||
MethodInfo mi = instmeths[num];*/
|
||||
|
||||
// SSM 2018.05.05 bug fix #664
|
||||
var mdtok = cfn.method_info.MetadataToken;
|
||||
MethodInfo[] instmeths = ((compiled_type_node)inst_type)._compiled_type.GetMethods(BindingFlags.Public | BindingFlags.NonPublic |
|
||||
BindingFlags.Static | BindingFlags.Instance);
|
||||
|
||||
MethodInfo mi = System.Array.Find(instmeths, m => m.MetadataToken == mdtok);
|
||||
// SSM 2018.05.05 end bug fix #664
|
||||
|
||||
return compiled_function_node.get_compiled_method(mi);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1943,8 +1943,8 @@ namespace PascalABCCompiler.TreeRealization
|
|||
{
|
||||
List<SymbolInfo> sil = Scope.FindOnlyInType(name, CurrentScope);//:=,create,x
|
||||
|
||||
// SSM test!!!
|
||||
if (base_type is compiled_generic_instance_type_node /*&& name == "IndexOf"*/)
|
||||
// SSM 2018.04.05
|
||||
if (base_type is compiled_generic_instance_type_node)
|
||||
{
|
||||
//sil = (base_type as compiled_generic_instance_type_node).original_generic.find_in_type(name, CurrentScope);
|
||||
return sil;
|
||||
|
|
|
|||
Loading…
Reference in a new issue