Reported by Vladimir Merzliakov; checked by Reinier Sterkenburg
再現方法:
任意のプロジェクトに以下のユニットを追加してコンパイルしてください。
unit uTest504;
interface
type
TClass1 = object
protected
function Func1: integer;
property Prop1: integer read Func1;
end;
TClass2 = object(TClass1)
public
property Prop1;
end;
TClass3 = object(TClass1)
public
property Prop1: integer read Func1;
end;
function Main: integer;
implementation
function TClass1.Func1;
begin
Result := 1;
end;
function Main: integer;
var
C2: TClass2;
C3: TClass3;
begin
Result := C3.Prop1; // 問題なし
Result := C2.Prop1; // Internal error SY2149 によりコンパイル停止
end;
end.
特徴:
- 古いタイプのオブジェクト(TClass1)が protected のプロパティ(Prop1)を持ち
- Prop1 が read メソッドを持ち
- Tlass1 のサブクラス(TClass2)が Prop1 の可視性を public に変更し
- 変数(C2)の型が TClass2 の場合
式 C2.Prop1 のところで、コンパイラはエラーメッセージ "Internal error SY2149" を発生させます。
|