=cut
-{
- package My::2::A;
- use metaclass;
- our @ISA = ('My::2::C');
+# 5.9.5+ dies at the moment of
+# recursive @ISA definition, not later when
+# you try to use the @ISAs.
+eval {
+ {
+ package My::2::A;
+ use metaclass;
+ our @ISA = ('My::2::C');
- package My::2::B;
- our @ISA = ('My::2::A');
+ package My::2::B;
+ our @ISA = ('My::2::A');
- package My::2::C;
- our @ISA = ('My::2::B');
-}
+ package My::2::C;
+ our @ISA = ('My::2::B');
+ }
-eval { My::2::B->meta->class_precedence_list };
+ My::2::B->meta->class_precedence_list
+};
ok($@, '... recursive inheritance breaks correctly :)');
=pod
ok(Diamond_A->meta->has_method('hello'), '... A has a method hello');
ok(!Diamond_B->meta->has_method('hello'), '... B does not have a method hello');
-ok(defined &Diamond_B::hello, '... B does have an alias to the method hello');
ok(Diamond_C->meta->has_method('hello'), '... C has a method hello');
ok(!Diamond_D->meta->has_method('hello'), '... D does not have a method hello');
-ok(defined &Diamond_D::hello, '... D does have an alias to the method hello');
+
+SKIP: {
+ skip "C3 does not make aliases on 5.9.5+", 2 if $] > 5.009_004;
+ ok(defined &Diamond_B::hello, '... B does have an alias to the method hello');
+ ok(defined &Diamond_D::hello, '... D does have an alias to the method hello');
+}