Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (12 sloc) 441 Bytes
use v6;
use Test;
plan 2;
=begin pod
A class can only derive already declared classes.
=end pod
# L<S12/Classes/"bare class names must be predeclared">
# need eval-lives-ok here because class declarations happen at compile time
eval-lives-ok ' class A {}; class B is A {}; ', "base before derived: lives";
throws-like ' class D is C {}; class C {}; ', X::Inheritance::UnknownParent,
"derived before base: dies";
# vim: ft=perl6
Jump to Line
Something went wrong with that request. Please try again.