parent
0805946983
commit
17f7bf3d6a
|
|
@ -4,7 +4,7 @@ uses
|
|||
DrawManField, Events, FilesOperations, GraphABC,
|
||||
GraphABCHelper, IniFile, PointerTools, PointRect, PT4, Robot, RobotField,
|
||||
RobotTaskMaker, RobotZadan, Sockets, Utils, VCL, Timers, PT4Exam, PT4TaskMakerNET, RBDMUtils,
|
||||
Collections, Arrays, Core, FormsABC, MPI, ClientServer;
|
||||
Collections, Arrays, Core, FormsABC, MPI, ClientServer, OpenGL;
|
||||
|
||||
begin
|
||||
writeln(cos(pi));
|
||||
|
|
|
|||
|
|
@ -99,6 +99,7 @@
|
|||
File ..\bin\Lib\Core.pcu
|
||||
File ..\bin\Lib\MPI.pcu
|
||||
File ..\bin\Lib\ClientServer.pcu
|
||||
File ..\bin\Lib\OpenGL.pcu
|
||||
File ..\bin\Lib\PABCRtl.dll
|
||||
File ..\bin\Lib\PABCRtl32.dll
|
||||
|
||||
|
|
@ -143,6 +144,7 @@
|
|||
${AddFile} "Core.pcu"
|
||||
${AddFile} "MPI.pcu"
|
||||
${AddFile} "ClientServer.pcu"
|
||||
${AddFile} "OpenGL.pcu"
|
||||
${AddFile} "PABCRtl.dll"
|
||||
${AddFile} "PABCRtl.pdb"
|
||||
Push "Lib\PABCRtl.dll"
|
||||
|
|
@ -188,6 +190,7 @@
|
|||
File ..\bin\Lib\Core.pas
|
||||
File ..\bin\Lib\MPI.pas
|
||||
File ..\bin\Lib\ClientServer.pas
|
||||
File ..\bin\Lib\OpenGL.pas
|
||||
File ..\bin\Lib\__RedirectIOMode.vb
|
||||
File ..\bin\Lib\VBSystem.vb
|
||||
|
||||
|
|
@ -231,6 +234,7 @@
|
|||
${AddFile} "Core.pas"
|
||||
${AddFile} "MPI.pas"
|
||||
${AddFile} "ClientServer.pas"
|
||||
${AddFile} "OpenGL.pas"
|
||||
${AddFile} "__RedirectIOMode.vb"
|
||||
${AddFile} "VBSystem.vb"
|
||||
|
||||
|
|
|
|||
15
TestSuite/generics9.pas
Normal file
15
TestSuite/generics9.pas
Normal file
|
|
@ -0,0 +1,15 @@
|
|||
function f<T>(t1: T): array of T;
|
||||
where T: System.IComparable<T>; forward;
|
||||
|
||||
function f<T>(t1: T): array of T;
|
||||
begin
|
||||
var t2: T;
|
||||
t2 := t1;
|
||||
Result := new T[1];
|
||||
Result[0] := t1;
|
||||
end;
|
||||
|
||||
begin
|
||||
var arr := f(2);
|
||||
assert(arr[0] = 2);
|
||||
end.
|
||||
|
|
@ -3169,18 +3169,21 @@ namespace PascalABCCompiler.TreeConverter
|
|||
{
|
||||
for (int i = 0; i < fn.generic_params.Count; ++i)
|
||||
{
|
||||
fn.generic_params[i] = compar.generic_params[i] as common_type_node;
|
||||
common_type_node t_fn = fn.generic_params[i] as common_type_node;
|
||||
common_type_node t_compar = compar.generic_params[i] as common_type_node;
|
||||
t_fn.is_class = t_compar.is_class;
|
||||
/*t_fn.is_class = t_compar.is_class;
|
||||
t_fn.internal_is_value = t_compar.internal_is_value;
|
||||
t_fn.SetImplementingInterfaces(t_compar.ImplementingInterfaces);
|
||||
(t_fn.Scope as SymbolTable.IInterfaceScope).TopInterfaceScopeArray =
|
||||
(t_compar.Scope as SymbolTable.IInterfaceScope).TopInterfaceScopeArray;
|
||||
t_fn.SetBaseType(t_compar.base_type);
|
||||
t_fn.SetBaseType(t_compar.base_type);*/
|
||||
if (t_compar.has_default_constructor)
|
||||
{
|
||||
generic_parameter_eliminations.add_default_ctor(t_fn);
|
||||
}
|
||||
SymbolInfo par_sim_info = fn.scope.FindOnlyInScope(fn.generic_params[i].name);
|
||||
par_sim_info.sym_info = fn.generic_params[i] as common_type_node;
|
||||
//t_fn.generic_function_container = compar;
|
||||
}
|
||||
//конверитируем параметры предописания в параметры описания.
|
||||
|
|
@ -3196,6 +3199,10 @@ namespace PascalABCCompiler.TreeConverter
|
|||
{
|
||||
compar.return_variable.type = compar.return_value_type;
|
||||
}
|
||||
}
|
||||
foreach (generic_parameter_eliminations gpe in compar.parameters_eliminations)
|
||||
{
|
||||
|
||||
}
|
||||
compar.generic_params = fn.generic_params;
|
||||
foreach (common_type_node tn in compar.generic_params)
|
||||
|
|
|
|||
|
|
@ -13420,7 +13420,8 @@ namespace PascalABCCompiler.TreeConverter
|
|||
context.CurrentScope.Find((_ref_type.pointed_to as SyntaxTree.named_type_reference).names[0].name) == null)
|
||||
{
|
||||
//это указатель на тип который еще не описан
|
||||
if (!is_direct_type_decl) AddError(new UndefinedNameReference((_ref_type.pointed_to as SyntaxTree.named_type_reference).names[0].name,get_location(_ref_type.pointed_to)));
|
||||
if (!is_direct_type_decl)
|
||||
AddError(new UndefinedNameReference((_ref_type.pointed_to as SyntaxTree.named_type_reference).names[0].name,get_location(_ref_type.pointed_to)));
|
||||
return_value(GetWaitedRefType((_ref_type.pointed_to as SyntaxTree.named_type_reference).names[0].name, get_location(_ref_type.pointed_to)));
|
||||
}
|
||||
else
|
||||
|
|
@ -17725,6 +17726,7 @@ namespace PascalABCCompiler.TreeConverter
|
|||
foreach (ref_type_node rtn in WaitedRefTypes.Values)
|
||||
CheckForCircularityInPointers(rtn, rtn.pointed_type,rtn.loc);
|
||||
ProcessRefTypesForCheckPointersTypeForDotNetFramework();
|
||||
WaitedRefTypes.Clear();
|
||||
}
|
||||
|
||||
internal void ProcessCheckPointersInRecord()
|
||||
|
|
|
|||
3680
bin/Lib/OpenGL.pas
Normal file
3680
bin/Lib/OpenGL.pas
Normal file
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue