From dccde94e624a997ddeabddbf2cf2e2fc52362f1b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=91=D0=BE=D0=BD=D0=B4=D0=B0=D1=80=D0=B5=D0=B2=20=D0=98?= =?UTF-8?q?=D0=B2=D0=B0=D0=BD?= Date: Wed, 9 Aug 2017 19:36:41 +0200 Subject: [PATCH] bug fix #447 --- Compiler/PCU/PCUWriter.cs | 6 ++++++ TestSuite/CompilationSamples/PABCSystem.pas | 2 +- TestSuite/overloads7.pas | 11 +++++++++++ bin/Lib/PABCExtensions.pas | 1 - bin/Lib/PABCSystem.pas | 2 +- 5 files changed, 19 insertions(+), 3 deletions(-) create mode 100644 TestSuite/overloads7.pas diff --git a/Compiler/PCU/PCUWriter.cs b/Compiler/PCU/PCUWriter.cs index c3121151a..7d24de866 100644 --- a/Compiler/PCU/PCUWriter.cs +++ b/Compiler/PCU/PCUWriter.cs @@ -824,7 +824,13 @@ namespace PascalABCCompiler.PCU { name_array[i] = new NameRef(cur_cnn.functions[i - j].name, i); if (cur_cnn.functions[i - j].ConnectedToType != null) + { name_array[i].special_scope = 1; + if (cur_cnn.functions[i - j].return_value_type != null) + name_array[i].symbol_kind = symbol_kind.sk_overload_function; + else + name_array[i].symbol_kind = symbol_kind.sk_overload_procedure; + } pools[cur_cnn.functions[i - j]] = name_array[i]; } j = i; diff --git a/TestSuite/CompilationSamples/PABCSystem.pas b/TestSuite/CompilationSamples/PABCSystem.pas index de9f72235..30fb3ad6f 100644 --- a/TestSuite/CompilationSamples/PABCSystem.pas +++ b/TestSuite/CompilationSamples/PABCSystem.pas @@ -5,7 +5,7 @@ /// !! System unit unit PABCSystem; - {$define PascalABC} +{$define PascalABC} {$gendoc true} diff --git a/TestSuite/overloads7.pas b/TestSuite/overloads7.pas new file mode 100644 index 000000000..9f5ba0b13 --- /dev/null +++ b/TestSuite/overloads7.pas @@ -0,0 +1,11 @@ +var i: integer; +procedure p := Inc(i); + +begin + var q := 3*p; + var q1 := p*3; + q; + assert(i=3); + q1; + assert(i=6); +end. \ No newline at end of file diff --git a/bin/Lib/PABCExtensions.pas b/bin/Lib/PABCExtensions.pas index ccd96078e..cde65de8c 100644 --- a/bin/Lib/PABCExtensions.pas +++ b/bin/Lib/PABCExtensions.pas @@ -107,7 +107,6 @@ var __initialized: boolean; procedure __InitModule; begin - end; procedure __InitModule__; diff --git a/bin/Lib/PABCSystem.pas b/bin/Lib/PABCSystem.pas index de9f72235..30fb3ad6f 100644 --- a/bin/Lib/PABCSystem.pas +++ b/bin/Lib/PABCSystem.pas @@ -5,7 +5,7 @@ /// !! System unit unit PABCSystem; - {$define PascalABC} +{$define PascalABC} {$gendoc true}