|
@@ -782,6 +782,7 @@ type
|
|
Procedure TestRTTI_DefaultValueRangeType;
|
|
Procedure TestRTTI_DefaultValueRangeType;
|
|
Procedure TestRTTI_DefaultValueInherit;
|
|
Procedure TestRTTI_DefaultValueInherit;
|
|
Procedure TestRTTI_OverrideMethod;
|
|
Procedure TestRTTI_OverrideMethod;
|
|
|
|
+ Procedure TestRTTI_ReintroduceMethod;
|
|
Procedure TestRTTI_OverloadProperty;
|
|
Procedure TestRTTI_OverloadProperty;
|
|
// ToDo: array argument
|
|
// ToDo: array argument
|
|
Procedure TestRTTI_ClassForward;
|
|
Procedure TestRTTI_ClassForward;
|
|
@@ -26745,8 +26746,8 @@ begin
|
|
Add(' procedure Proc(Sender: tobject); virtual; abstract;');
|
|
Add(' procedure Proc(Sender: tobject); virtual; abstract;');
|
|
Add(' end;');
|
|
Add(' end;');
|
|
Add('begin');
|
|
Add('begin');
|
|
- SetExpectedPasResolverError('Duplicate identifier "Proc" at test1.pp(6,19)',
|
|
|
|
- nDuplicateIdentifier);
|
|
|
|
|
|
+ SetExpectedPasResolverError('Duplicate published method "Proc" at test1.pp(6,19)',
|
|
|
|
+ nDuplicatePublishedMethodXAtY);
|
|
ConvertProgram;
|
|
ConvertProgram;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -27629,6 +27630,51 @@ begin
|
|
'']));
|
|
'']));
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+procedure TTestModule.TestRTTI_ReintroduceMethod;
|
|
|
|
+begin
|
|
|
|
+ Converter.Options:=Converter.Options-[coNoTypeInfo];
|
|
|
|
+ StartProgram(false);
|
|
|
|
+ Add([
|
|
|
|
+ 'type',
|
|
|
|
+ ' TObject = class',
|
|
|
|
+ ' published',
|
|
|
|
+ ' procedure DoIt;',
|
|
|
|
+ ' end;',
|
|
|
|
+ ' TSky = class',
|
|
|
|
+ ' published',
|
|
|
|
+ ' procedure DoIt; reintroduce;',
|
|
|
|
+ ' end;',
|
|
|
|
+ 'procedure TObject.DoIt; begin end;',
|
|
|
|
+ 'procedure TSky.DoIt;',
|
|
|
|
+ 'begin',
|
|
|
|
+ ' inherited DoIt;',
|
|
|
|
+ 'end;',
|
|
|
|
+ 'begin']);
|
|
|
|
+ ConvertProgram;
|
|
|
|
+ CheckSource('TestRTTI_ReintroduceMethod',
|
|
|
|
+ LinesToStr([ // statements
|
|
|
|
+ 'rtl.createClass($mod, "TObject", null, function () {',
|
|
|
|
+ ' this.$init = function () {',
|
|
|
|
+ ' };',
|
|
|
|
+ ' this.$final = function () {',
|
|
|
|
+ ' };',
|
|
|
|
+ ' this.DoIt = function () {',
|
|
|
|
+ ' };',
|
|
|
|
+ ' var $r = this.$rtti;',
|
|
|
|
+ ' $r.addMethod("DoIt", 0, null);',
|
|
|
|
+ '});',
|
|
|
|
+ 'rtl.createClass($mod, "TSky", $mod.TObject, function () {',
|
|
|
|
+ ' this.DoIt = function () {',
|
|
|
|
+ ' $mod.TObject.DoIt.call(this);',
|
|
|
|
+ ' };',
|
|
|
|
+ ' var $r = this.$rtti;',
|
|
|
|
+ ' $r.addMethod("DoIt", 0, null);',
|
|
|
|
+ '});',
|
|
|
|
+ '']),
|
|
|
|
+ LinesToStr([ // $mod.$main
|
|
|
|
+ '']));
|
|
|
|
+end;
|
|
|
|
+
|
|
procedure TTestModule.TestRTTI_OverloadProperty;
|
|
procedure TTestModule.TestRTTI_OverloadProperty;
|
|
begin
|
|
begin
|
|
Converter.Options:=Converter.Options-[coNoTypeInfo];
|
|
Converter.Options:=Converter.Options-[coNoTypeInfo];
|