adding IReadOnlyList<T> interface to ones implemented by array (#3277)
This commit is contained in:
parent
8d27ec3788
commit
d49a41a025
|
|
@ -60,6 +60,7 @@ namespace PascalABCCompiler.SystemLibrary
|
|||
private static compiled_type_node _ilist1_interface;
|
||||
private static compiled_type_node _icollection1_interface;
|
||||
private static compiled_type_node _ireadonlycollection_interface;
|
||||
private static compiled_type_node _ireadonlylist_interface;
|
||||
private static compiled_type_node _ienumerable1_interface;
|
||||
|
||||
private static compiled_function_node _delegate_combine_method;
|
||||
|
|
@ -1178,9 +1179,15 @@ namespace PascalABCCompiler.SystemLibrary
|
|||
_icollection_interface = compiled_type_node.get_type_node(typeof(ICollection));
|
||||
_ienumerable_interface = compiled_type_node.get_type_node(typeof(IEnumerable));
|
||||
_ilist1_interface = compiled_type_node.get_type_node(typeof(IList<>));
|
||||
|
||||
var t = Type.GetType("System.Collections.Generic.IReadOnlyCollection`1");
|
||||
if (t != null)
|
||||
_ireadonlycollection_interface = compiled_type_node.get_type_node(t);
|
||||
|
||||
t = Type.GetType("System.Collections.Generic.IReadOnlyList`1");
|
||||
if (t != null)
|
||||
_ireadonlylist_interface = compiled_type_node.get_type_node(t);
|
||||
|
||||
_icollection1_interface = compiled_type_node.get_type_node(typeof(ICollection<>));
|
||||
_ienumerable1_interface = compiled_type_node.get_type_node(typeof(IEnumerable<>));
|
||||
_assert_method = compiled_function_node.get_compiled_method(typeof(System.Diagnostics.Debug).GetMethod("Assert",new Type[1]{typeof(bool)}));
|
||||
|
|
@ -5272,6 +5279,14 @@ namespace PascalABCCompiler.SystemLibrary
|
|||
}
|
||||
}
|
||||
|
||||
public static compiled_type_node ireadonlylist_interface
|
||||
{
|
||||
get
|
||||
{
|
||||
return _ireadonlylist_interface;
|
||||
}
|
||||
}
|
||||
|
||||
public static compiled_function_node assert_method
|
||||
{
|
||||
get
|
||||
|
|
|
|||
|
|
@ -125,6 +125,9 @@ namespace PascalABCCompiler.TreeConverter
|
|||
comtn.ImplementingInterfaces.Add(SystemLibrary.SystemLibrary.ienumerable1_interface.get_instance(type_params));
|
||||
if (SystemLibrary.SystemLibrary.ireadonlycollection_interface != null)
|
||||
comtn.ImplementingInterfaces.Add(SystemLibrary.SystemLibrary.ireadonlycollection_interface.get_instance(type_params));
|
||||
|
||||
if (SystemLibrary.SystemLibrary.ireadonlylist_interface != null)
|
||||
comtn.ImplementingInterfaces.Add(SystemLibrary.SystemLibrary.ireadonlylist_interface.get_instance(type_params));
|
||||
}
|
||||
//SystemLibrary.SystemLibrary.ic
|
||||
//(ssyy) Убрал 18.05.08
|
||||
|
|
|
|||
Loading…
Reference in a new issue