Inherited I



Inherited I
Smart pascal source code
type TBase = class Field1: Integer; property Prop: Integer read Field1; end; type TChild = class(TBase) Field2: Integer; property Prop: Integer read Field2; function GetBase: Integer; begin result := inherited Prop; end; function GetChild: Integer; begin result := Prop; end; end; var o := TChild.Create; o.Field1 := 1; o.Field2 := 2; WriteLn(o.GetBase); WriteLn(o.GetChild); {<<< RESULT - CONSOLE LOG >>> ----------------------------- Errors >>>> Hint: "result" does not match case of declaration ("Result") [line: 10, column: 41] Hint: "result" does not match case of declaration ("Result") [line: 11, column: 42] Result >>>> 1 2 ----------------------------- {<<<<<<<<< THE END >>>>>>>>>}