Created
August 1, 2013 21:06
-
-
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.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!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; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Fails with the error: