Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
ibond84 committed Jan 5, 2024
1 parent 9b3cc5c commit 2dbe47c
Show file tree
Hide file tree
Showing 13 changed files with 51 additions and 13 deletions.
16 changes: 8 additions & 8 deletions CodeCompletion/SymTable.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1580,7 +1580,7 @@ public virtual bool IsReintroduce

public void MakeDescription()
{
si.description = CodeCompletionController.CurrentParser.LanguageInformation.GetDescription(this);
si.description = CodeCompletionController.CurrentParser?.LanguageInformation.GetDescription(this);
if (!string.IsNullOrEmpty(documentation))
si.description += Environment.NewLine + documentation;
}
Expand Down Expand Up @@ -1686,7 +1686,7 @@ public override bool IsEqual(SymScope ts)

public override string ToString()
{
return CodeCompletionController.CurrentParser.LanguageInformation.GetSimpleDescription(this);
return CodeCompletionController.CurrentParser?.LanguageInformation.GetSimpleDescription(this);
}
}

Expand Down Expand Up @@ -2151,7 +2151,7 @@ public override bool IsEqual(SymScope ts)

public override string ToString()
{
return CodeCompletionController.CurrentParser.LanguageInformation.GetDescription(this);
return CodeCompletionController.CurrentParser?.LanguageInformation.GetDescription(this);
}
}

Expand Down Expand Up @@ -2486,15 +2486,15 @@ public virtual bool IsConstructor()
public override void MakeSynonimDescription()
{
//aliased = true;
si.description = CodeCompletionController.CurrentParser.LanguageInformation.GetSynonimDescription(this);
si.description = CodeCompletionController.CurrentParser?.LanguageInformation.GetSynonimDescription(this);
}

//zavershenie opisanija, vyzyvaetsja kogda parametry razobrany
public void Complete()
{
if (documentation != null && documentation.Length > 0 && documentation[0] == '-') return;
this.si.description = this.ToString();
this.si.addit_name = CodeCompletionController.CurrentParser.LanguageInformation.GetShortName(this);
this.si.addit_name = CodeCompletionController.CurrentParser?.LanguageInformation.GetShortName(this);
if (documentation != null) this.si.description += "\n" + this.documentation;
}

Expand Down Expand Up @@ -2720,8 +2720,8 @@ public override string GetDescriptionWithoutDoc()

public override string ToString()
{
simp_descr = CodeCompletionController.CurrentParser.LanguageInformation.GetSimpleDescription(this);
return CodeCompletionController.CurrentParser.LanguageInformation.GetDescription(this);
simp_descr = CodeCompletionController.CurrentParser?.LanguageInformation.GetSimpleDescription(this);
return CodeCompletionController.CurrentParser?.LanguageInformation.GetDescription(this);
}
}

Expand Down Expand Up @@ -3775,7 +3775,7 @@ public override TypeScope GetElementType()

public override string ToString()
{
return CodeCompletionController.CurrentParser.LanguageInformation.GetDescription(this);
return CodeCompletionController.CurrentParser?.LanguageInformation.GetDescription(this);
}
}

Expand Down
2 changes: 1 addition & 1 deletion Configuration/GlobalAssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ internal static class RevisionClass
public const string Major = "3";
public const string Minor = "9";
public const string Build = "0";
public const string Revision = "3411";
public const string Revision = "3412";

public const string MainVersion = Major + "." + Minor;
public const string FullVersion = Major + "." + Minor + "." + Build + "." + Revision;
Expand Down
4 changes: 2 additions & 2 deletions Configuration/Version.defs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
%MINOR%=9
%REVISION%=3411
%COREVERSION%=0
%REVISION%=3412
%MINOR%=9
%MAJOR%=3
Binary file modified Localization/DefaultLang.resources
Binary file not shown.
2 changes: 1 addition & 1 deletion Release/pabcversion.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
3.9.0.3411
3.9.0.3412
2 changes: 1 addition & 1 deletion ReleaseGenerators/PascalABCNET_version.nsh
Original file line number Diff line number Diff line change
@@ -1 +1 @@
!define VERSION '3.9.0.3411'
!define VERSION '3.9.0.3412'
14 changes: 14 additions & 0 deletions TestSuite/errors/err0533.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
//exclude
unit err0533;
{$savepcu false}
interface

type
t1 = class
static function f1: integer;
end;

implementation

static function t1.f1 := 1;
end.
15 changes: 15 additions & 0 deletions TestSuite/errors/err0534.pas
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//!Нельзя реализовывать метод из другого модуля
unit err0534;
interface

uses err0533;

function f0: integer;

implementation

static function t1.f1 := 2;

function f0 := t1.f1;

end.
5 changes: 5 additions & 0 deletions TreeConverter/TreeConversion/syntax_tree_visitor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10584,6 +10584,11 @@ private void visit_method_name(SyntaxTree.method_name _method_name)
{
common_extension_meth = true;
common_type_node ctn = def_temp as common_type_node;
if (sil != null && this._compiled_unit.namespaces.IndexOf(tp.comprehensive_namespace) == -1)//static methods cannot be extension methods
{
if (current_function_header.class_keyword)
AddError(get_location(_method_name), "CANNOT_IMPLEMENT_METHODS_IN_OTHER_MODULE");
}
if (ctn.type_special_kind == PascalABCCompiler.SemanticTree.type_special_kind.array_wrapper ||
ctn.type_special_kind == PascalABCCompiler.SemanticTree.type_special_kind.set_type ||
ctn.type_special_kind == PascalABCCompiler.SemanticTree.type_special_kind.base_set_type ||
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 @@ -177,6 +177,7 @@ EXPECTED_PROPERTY=Property expected
NON_PUBLIC_RECORD_CONSTRUCTORS_NOT_ALLOWED=Records can not have non-public default constructor
EXIT_BREAK_CONTINUE_IN_FINALLY_BLOCK=exit, break and continue are not allowed in finally
ANONYMOUS_DELEGATES_WITH_GENERIC_PARAMS_NOT_ALLOWED=Cannot deduce type of anonymous delegates with generic parameters. Declare the variable type explicitly.
CANNOT_IMPLEMENT_METHODS_IN_OTHER_MODULE=Can not implement methods in other module
%PREFIX%=COMPILATIONERROR_
UNIT_MODULE_EXPECTED_LIBRARY_FOUND=Unit expected, library found
ASSEMBLY_{0}_READING_ERROR=Error by reading assembly '{0}'
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 @@ -172,6 +172,7 @@ EXPECTED_PROPERTY=Ожидалось свойство
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=Нельзя реализовывать метод из другого модуля
%PREFIX%=COMPILATIONERROR_
UNIT_MODULE_EXPECTED_LIBRARY_FOUND=Ожидался модуль, а встречена библиотека
ASSEMBLY_{0}_READING_ERROR=Ошибка при чтении сборки '{0}'
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 @@ -169,6 +169,7 @@ EXPECTED_PROPERTY=Ожидалось свойство
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=Нельзя реализовывать метод из другого модуля
%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 @@ -177,6 +177,7 @@ EXPECTED_PROPERTY=预期的属性
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
%PREFIX%=COMPILATIONERROR_
UNIT_MODULE_EXPECTED_LIBRARY_FOUND=需要单元,找到库
ASSEMBLY_{0}_READING_ERROR=读取程序集 '{0}' 时出错
Expand Down

0 comments on commit 2dbe47c

Please sign in to comment.