Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Pun configuration needs to be per-run.
  • Loading branch information
jnthn committed Feb 28, 2012
1 parent 5d20c5a commit f5f15e5
Showing 1 changed file with 21 additions and 21 deletions.
42 changes: 21 additions & 21 deletions src/Perl6/Metamodel/BOOTSTRAP.pm
Expand Up @@ -820,27 +820,6 @@ BEGIN {
nqp::bindattr_i($true, Bool, '$!value', 1);
(Bool.WHO)<True> := $true;

# Roles pretend to be narrower than certain types for the purpose
# of type checking. Also, they pun to classes.
Perl6::Metamodel::ParametricRoleGroupHOW.pretend_to_be([Cool, Any, Mu]);
Perl6::Metamodel::ParametricRoleGroupHOW.configure_punning(
Perl6::Metamodel::ClassHOW,
hash( ACCEPTS => Mu ));
Perl6::Metamodel::ParametricRoleHOW.pretend_to_be([Cool, Any, Mu]);
Perl6::Metamodel::ParametricRoleHOW.configure_punning(
Perl6::Metamodel::ClassHOW,
hash( ACCEPTS => Mu ));
Perl6::Metamodel::CurriedRoleHOW.pretend_to_be([Cool, Any, Mu]);
Perl6::Metamodel::CurriedRoleHOW.configure_punning(
Perl6::Metamodel::ClassHOW,
hash( ACCEPTS => Mu ));

# Similar for packages and modules, but just has methods from Any.
Perl6::Metamodel::PackageHOW.pretend_to_be([Any, Mu]);
Perl6::Metamodel::PackageHOW.delegate_methods_to(Any);
Perl6::Metamodel::ModuleHOW.pretend_to_be([Any, Mu]);
Perl6::Metamodel::ModuleHOW.delegate_methods_to(Any);

# Setup some regexy/grammary bits.
Perl6::Metamodel::ClassHOW.add_stash(Grammar);

Expand Down Expand Up @@ -950,6 +929,27 @@ Perl6::Metamodel::ParametricRoleGroupHOW.set_selector_creator({
$sel
});

# Roles pretend to be narrower than certain types for the purpose
# of type checking. Also, they pun to classes.
Perl6::Metamodel::ParametricRoleGroupHOW.pretend_to_be([Cool, Any, Mu]);
Perl6::Metamodel::ParametricRoleGroupHOW.configure_punning(
Perl6::Metamodel::ClassHOW,
hash( ACCEPTS => Mu ));
Perl6::Metamodel::ParametricRoleHOW.pretend_to_be([Cool, Any, Mu]);
Perl6::Metamodel::ParametricRoleHOW.configure_punning(
Perl6::Metamodel::ClassHOW,
hash( ACCEPTS => Mu ));
Perl6::Metamodel::CurriedRoleHOW.pretend_to_be([Cool, Any, Mu]);
Perl6::Metamodel::CurriedRoleHOW.configure_punning(
Perl6::Metamodel::ClassHOW,
hash( ACCEPTS => Mu ));

# Similar for packages and modules, but just has methods from Any.
Perl6::Metamodel::PackageHOW.pretend_to_be([Any, Mu]);
Perl6::Metamodel::PackageHOW.delegate_methods_to(Any);
Perl6::Metamodel::ModuleHOW.pretend_to_be([Any, Mu]);
Perl6::Metamodel::ModuleHOW.delegate_methods_to(Any);

# Set this Stash type for the various types of package (not persisted as it ends
# up in a lexical...)
Perl6::Metamodel::PackageHOW.set_stash_type(Stash, EnumMap);
Expand Down

0 comments on commit f5f15e5

Please sign in to comment.