Skip to content

Commit

Permalink
Merge branch 'pascalabcnet:master' into test
Browse files Browse the repository at this point in the history
  • Loading branch information
spectatorBH authored Jan 16, 2024
2 parents 721bcb8 + be92ef2 commit cd53ec3
Show file tree
Hide file tree
Showing 13 changed files with 56 additions and 1 deletion.
Binary file modified Localization/DefaultLang.resources
Binary file not shown.
6 changes: 6 additions & 0 deletions TestSuite/errors/err0535.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
//!Имя библиотеки не может быть пустым
procedure p1; external '';

begin

end.
Binary file added TestSuite/l2.dll
Binary file not shown.
9 changes: 9 additions & 0 deletions TestSuite/lambdas22.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
begin
var i := 0;
var p: Action0 := ()->begin i := 1 end;
var l := Lst&<Action0>();
l.Add(()->begin i := 2 end);
var l2 := l.ConvertAll(a->p);
l2[0]();
assert(i = 1);
end.
20 changes: 20 additions & 0 deletions TestSuite/libs/l2.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
library l2;

type

t1 = class

public function m1 := 0;

end;

t2 = class(t1)
public static i: integer;
public static procedure m1;
begin
i := 1;
end;

end;

end.
6 changes: 6 additions & 0 deletions TestSuite/overloads11.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{$reference l2.dll}

begin
l2.t2.m1;
assert(l2.t2.i = 1);
end.
Original file line number Diff line number Diff line change
Expand Up @@ -2233,7 +2233,13 @@ cfn0.comperehensive_type is compiled_type_node ctn0 &&
}
continue;
}
set_of_possible_functions.Add(fn);
else if ((func = find_eq_method_in_list(fn, set_of_possible_functions)) != null)
{
if (!(fn is compiled_function_node cfn && func is compiled_function_node cfn2 && (cfn.polymorphic_state == polymorphic_state.ps_static || cfn2.polymorphic_state == polymorphic_state.ps_static)))
set_of_possible_functions.Add(fn);
}
else
set_of_possible_functions.Add(fn);
}
}
if (parameters.Count > fn.parameters.Count)
Expand Down
2 changes: 2 additions & 0 deletions TreeConverter/TreeConversion/syntax_tree_visitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -18297,6 +18297,8 @@ public override void visit(SyntaxTree.external_directive _external_directive)
}
else
AddError(get_location(_external_directive.modulename), "STRING_CONSTANT_OR_IDENTIFIER_EXPECTED");
if (string.IsNullOrEmpty(module_name))
AddError(get_location(_external_directive.modulename), "DLLNAME_CANNOT_BE_EMPTY");
if (_external_directive.name == null)
{
name = context.converted_func_stack.top().name;
Expand Down
2 changes: 2 additions & 0 deletions TreeConverter/TreeRealization/generics.cs
Original file line number Diff line number Diff line change
Expand Up @@ -589,6 +589,8 @@ public static type_node determine_type(type_node tn, List<type_node> param_types

private static bool CheckIfTypeDependsOnUndeducedGenericParameters(type_node formalType, type_node[] deduced) //lroman
{
if (formalType == null)
return false;
if (formalType.generic_function_container != null)
{
var par_num = formalType.generic_param_index;
Expand Down
1 change: 1 addition & 0 deletions bin/Lng/Eng/SemanticErrors_ib.dat
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ EXTENSION_CONSTRUCTOR_NOT_ALLOWED=Cannot declare extensions-constructors
CLASS_MEMBER_{0}_EXPECTED='{0}' must be method or constructor
DESTRUCTOR_MUST_HAVE_NAME=Destructor must have name
STRING_CONSTANT_EXPECTED=String constant expected
DLLNAME_CANNOT_BE_EMPTY=Library name cannot be empty
STRING_CONSTANT_OR_IDENTIFIER_EXPECTED=String constant or identifier expected
FUNCTION_MUST_HAVE_DLLIMPORT_ATTRIBUTE=DllImport attribute expected
EXPECTED_ATTRIBUTE_INITIALIZER=Attribute initializer expected
Expand Down
1 change: 1 addition & 0 deletions bin/Lng/Rus/SemanticErrors_ib.dat
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ EXTENSION_CONSTRUCTOR_NOT_ALLOWED=Определение extensions-констр
CLASS_MEMBER_{0}_EXPECTED={0} должен быть методом или конструктором
DESTRUCTOR_MUST_HAVE_NAME=Деструктор должен иметь имя
STRING_CONSTANT_EXPECTED=Ожидалась строковая константа
DLLNAME_CANNOT_BE_EMPTY=Имя библиотеки не может быть пустым
STRING_CONSTANT_OR_IDENTIFIER_EXPECTED=Ожидались строковая константа или идентификатор
FUNCTION_MUST_HAVE_DLLIMPORT_ATTRIBUTE=Подпрограмма должна иметь атрибут DllImport
EXPECTED_ATTRIBUTE_INITIALIZER=Ожидался инициализатор атрибута
Expand Down
1 change: 1 addition & 0 deletions bin/Lng/Ukr/SemanticErrors_ib.dat
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ NON_PUBLIC_RECORD_CONSTRUCTORS_NOT_ALLOWED=Записи могут иметь т
EXIT_BREAK_CONTINUE_IN_FINALLY_BLOCK=Использование exit, break и continue в блоке finally недопустимо
ANONYMOUS_DELEGATES_WITH_GENERIC_PARAMS_NOT_ALLOWED=Нельзя вывести тип анонимного делегата с генерик-параметрами. Укажите тип переменной явно.
CANNOT_IMPLEMENT_METHODS_IN_OTHER_MODULE=Нельзя реализовывать метод из другого модуля
DLLNAME_CANNOT_BE_EMPTY=Имя библиотеки не может быть пустым
%PREFIX%=COMPILATIONERROR_
UNIT_MODULE_EXPECTED_LIBRARY_FOUND=Очікувався модуль, а зустріли бібліотеку
ASSEMBLY_{0}_READING_ERROR=Помилка при читанні збірки '{0}'
Expand Down
1 change: 1 addition & 0 deletions bin/Lng/zh_CN/SemanticErrors_ib.dat
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,7 @@ NON_PUBLIC_RECORD_CONSTRUCTORS_NOT_ALLOWED=记录不能有非公共的默认构
EXIT_BREAK_CONTINUE_IN_FINALLY_BLOCK=finally 中不允许退出、中断和继续
ANONYMOUS_DELEGATES_WITH_GENERIC_PARAMS_NOT_ALLOWED=无法推断具有泛型参数的匿名委托的类型。 显式声明变量类型。
CANNOT_IMPLEMENT_METHODS_IN_OTHER_MODULE=Can not implement methods in other module
DLLNAME_CANNOT_BE_EMPTY=Library name cannot be empty
%PREFIX%=COMPILATIONERROR_
UNIT_MODULE_EXPECTED_LIBRARY_FOUND=需要单元,找到库
ASSEMBLY_{0}_READING_ERROR=读取程序集 '{0}' 时出错
Expand Down

0 comments on commit cd53ec3

Please sign in to comment.