#!/usr/bin/perl

package Perl6::Declare::Meta::Trait::crazy;
use Moose::Role;

use Scalar::Util qw(refaddr);

Hash::Util::FieldHash::Compat::idhashes \( our ( %metas, %munged ) );

use Perl6::Declare::Util ();

sub BUILD {
    my $self = shift;
    $metas{$self} = $self;
}

around prelude_do_binding => sub {
    my ( $next, $self, $sig_exp, $binding_exp ) = @_;

    return (
            "Perl6::Declare::Util::update_for_caller($sig_exp)",
            $self->$next( $sig_exp, $binding_exp ),
    );
};

__PACKAGE__
