Skip to content

Instantly share code, notes, and snippets.

@raph-amiard
Created June 18, 2018 14:10
Show Gist options
  • Save raph-amiard/0f9439181c2da555db5e372e77ff371b to your computer and use it in GitHub Desktop.
Save raph-amiard/0f9439181c2da555db5e372e77ff371b to your computer and use it in GitHub Desktop.
procedure Teststpr is
type Kind is (A, B, C, D);
Lol : constant := 12;
subtype Subkind is Kind
with Static_Predicate => Subkind = A or else (Lol > 20 and then Subkind = D);
-- WHAT THE ACTUAL FUCK
type Rec (K : Kind) is record
case K is
when Subkind => O : Integer;
when others => null;
end case;
end record;
R : Rec := (K => D, O => 12);
-- Invalid because O is not a component of Rec
begin
null;
end Teststpr;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment