次のコードがあり、最初の2つのケースだけで共通のプロパティを共有したいと思います。ただし、次の"id" conflicts with the declaration at line 11
構文を使用しようとするとエラーが発生します。
type Shape (Which : Shape_Type := SQUARE) is
record
case Which is
when Square =>
id : Natural; -- Line 11
when Turnout =>
id : Natural; -- Line that causes error to be thrown
when Invalid =>
null;
end case;
end record;