File Coverage

blib/lib/Devel/TypeCheck/Type/Mu.pm
Criterion Covered Total %
statement 18 21 85.7
branch n/a
condition n/a
subroutine 6 8 75.0
pod 2 2 100.0
total 26 31 83.8


line stmt bran cond sub pod time code
1             package Devel::TypeCheck::Type::Mu;
2              
3 1     1   10 use strict;
  1         2  
  1         61  
4 1     1   7 use Carp;
  1         3  
  1         94  
5              
6 1     1   8 use Devel::TypeCheck::Type;
  1         2  
  1         40  
7 1     1   716 use Devel::TypeCheck::Type::TSub;
  1         3  
  1         32  
8 1     1   7 use Devel::TypeCheck::Util;
  1         2  
  1         238  
9              
10             =head1 NAME
11              
12             Devel::TypeCheck::Type::Mu - Type representing all values.
13              
14             =head1 SYNOPSIS
15              
16             use Devel::TypeCheck::Type::Mu;
17              
18             =head1 DESCRIPTION
19              
20             Mu rpresents all values. The underlying subtype can be a CV or IO
21             terminal type, or an Eta (Glob), Kappa (Scalar), Omicron (Array), or
22             Chi (Hash). No type variables are allowed directly below Mu.
23              
24             Inherits from Devel::TypeCheck::Type::TSub and Devel::TypeCheck::Type.
25              
26             =cut
27             our @ISA = qw(Devel::TypeCheck::Type::TSub Devel::TypeCheck::Type);
28              
29             # **** CLASS ****
30              
31             our @SUBTYPES;
32             our @subtypes;
33              
34             BEGIN {
35 1     1   43 @SUBTYPES = (Devel::TypeCheck::Type::H(), Devel::TypeCheck::Type::K(), Devel::TypeCheck::Type::O(), Devel::TypeCheck::Type::X(), Devel::TypeCheck::Type::Z(), Devel::TypeCheck::Type::IO());
36              
37 1         3 for my $i (@SUBTYPES) {
38 6         123 $subtypes[$i] = 1;
39             }
40             }
41              
42             sub hasSubtype {
43 0     0 1   my ($this, $index) = @_;
44 0           return ($subtypes[$index]);
45             }
46              
47             sub type {
48 0     0 1   return Devel::TypeCheck::Type::M();
49             }
50              
51             TRUE;
52              
53             =head1 AUTHOR
54              
55             Gary Jackson, C<< >>
56              
57             =head1 BUGS
58              
59             This version is specific to Perl 5.8.1. It may work with other
60             versions that have the same opcode list and structure, but this is
61             entirely untested. It definitely will not work if those parameters
62             change.
63              
64             Please report any bugs or feature requests to
65             C, or through the web interface at
66             L.
67             I will be notified, and then you'll automatically be notified of progress on
68             your bug as I make changes.
69              
70             =head1 COPYRIGHT & LICENSE
71              
72             Copyright 2005 Gary Jackson, all rights reserved.
73              
74             This program is free software; you can redistribute it and/or modify it
75             under the same terms as Perl itself.
76              
77             =cut