Skip to content

Instantly share code, notes, and snippets.

@prakashk
Created August 1, 2013 21:06
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 prakashk/6135321 to your computer and use it in GitHub Desktop.
Save prakashk/6135321 to your computer and use it in GitHub Desktop.
Creating an instance of a class extended from another in the same package fails.
#!perl
use strict;
use warnings;
use Test::More;
{
package Foo;
use strict;
use warnings;
use mop;
class Bar {
has $baz;
}
class Baz extends Bar {
has $baz2;
}
}
my $foo = Foo::Bar->new;
ok( $foo->isa( 'Foo::Bar' ), '... the object is from class Foo::Bar' );
my $foo_baz = Foo::Baz->new;
ok( $foo_baz->isa( 'Foo::Baz' ), '... the object is from class Foo::Baz' );
done_testing;
@prakashk
Copy link
Author

prakashk commented Aug 1, 2013

Fails with the error:

Could not find new in Foo::Baz at /home/prakash/git/perl/p5-mop-redux/blib/lib/mop/internals/mro.pm line 137.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment