Skip to content

Instantly share code, notes, and snippets.

@Altai-man
Last active October 13, 2021 19:02
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 Altai-man/f2e7816a71b32320017fe5d5e72f283c to your computer and use it in GitHub Desktop.
Save Altai-man/f2e7816a71b32320017fe5d5e72f283c to your computer and use it in GitHub Desktop.
class ASNType {
has $.type is rw; # NO BUG IF REMOVE `is rw`
}
my $new-type = Metamodel::ClassHOW.new_type(name => 'LDAPMessage');
my $attribute-type = ASNType.new(type => Int);
my $attr = Attribute.new(name => '$!protocol-op', type => $attribute-type.type, package => $new-type, :has_accessor); # NO BUG IF REMOVE `has_accessor`
$new-type.^add_attribute($attr);
$new-type.^compose;
say $new-type.new; # expected -> type, real:
# Invocant of method 'raku' must be an object instance of type 'Mu', not
# a type object of type 'ProtocolOp'. Did you forget a '.new'?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment