Skip to content

Instantly share code, notes, and snippets.

@patrickbkr
Last active June 15, 2022 09:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save patrickbkr/52c482d25fa0eb074efe2a8101949695 to your computer and use it in GitHub Desktop.
Save patrickbkr/52c482d25fa0eb074efe2a8101949695 to your computer and use it in GitHub Desktop.
use Red;
enum E <E1>;
model M {
has E $.e is column is rw;
}
my M $m1 .= new: e => E1;
my M $m2 .= new: e => $m1.e;
dd $m2;
use Red;
enum E <E1>;
model M {
has E $.e is column is rw;
}
my M $m1 .= new: e => E1;
my $c = $m1.^columns[0];
dd $c.type;
say $m1.e ~~ $c.type; # False
say $m1.e ~~ E; # True
say E1 ~~ $c.type; # True
say E1 ~~ E; # True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment