File Coverage

blib/lib/Devel/TypeCheck/Type/Upsilon.pm
Criterion Covered Total %
statement 21 24 87.5
branch n/a
condition n/a
subroutine 7 9 77.7
pod 2 2 100.0
total 30 35 85.7


line stmt bran cond sub pod time code
1             package Devel::TypeCheck::Type::Upsilon;
2              
3 1     1   4509 use strict;
  1         3  
  1         41  
4 1     1   7 use Carp;
  1         2  
  1         74  
5              
6 1     1   8 use Devel::TypeCheck::Type;
  1         2  
  1         56  
7 1     1   7 use Devel::TypeCheck::Type::TSub;
  1         1  
  1         28  
8 1     1   7 use Devel::TypeCheck::Type::TVar;
  1         3  
  1         41  
9 1     1   6 use Devel::TypeCheck::Util;
  1         3  
  1         214  
10              
11             =head1 NAME
12              
13             Devel::TypeCheck::Type::Upsilon - Type representing printable values.
14              
15             =head1 SYNOPSIS
16              
17             use Devel::TypeCheck::Type::Upsilon;
18              
19             =head1 DESCRIPTION
20              
21             Upsilon represents printable values. A "printable value" is a string
22             or an integer. This serves to represent scalar values where a human
23             readable type is desired, or where information about references are
24             lost (for instance, as a key in a hash). Underlying subtypes can be
25             numbers (Nu), strings (PV), or type variables to represent ambiguity.
26              
27             Inherits from Devel::TypeCheck::Type::TSub and Devel::TypeCheck::Type::TVar.
28              
29             =cut
30             our @ISA = qw(Devel::TypeCheck::Type::TSub Devel::TypeCheck::Type::TVar);
31              
32             # **** CLASS ****
33              
34             our @SUBTYPES;
35             our @subtypes;
36              
37             BEGIN {
38 1     1   10 @SUBTYPES = (Devel::TypeCheck::Type::N(), Devel::TypeCheck::Type::PV(), Devel::TypeCheck::Type::VAR());
39              
40 1         3 for my $i (@SUBTYPES) {
41 3         119 $subtypes[$i] = 1;
42             }
43             }
44              
45             sub hasSubtype {
46 0     0 1   my ($this, $index) = @_;
47 0           return ($subtypes[$index]);
48             }
49              
50             sub type {
51 0     0 1   return Devel::TypeCheck::Type::Y();
52             }
53              
54             TRUE;
55              
56             =head1 AUTHOR
57              
58             Gary Jackson, C<< >>
59              
60             =head1 BUGS
61              
62             This version is specific to Perl 5.8.1. It may work with other
63             versions that have the same opcode list and structure, but this is
64             entirely untested. It definitely will not work if those parameters
65             change.
66              
67             Please report any bugs or feature requests to
68             C, or through the web interface at
69             L.
70             I will be notified, and then you'll automatically be notified of progress on
71             your bug as I make changes.
72              
73             =head1 COPYRIGHT & LICENSE
74              
75             Copyright 2005 Gary Jackson, all rights reserved.
76              
77             This program is free software; you can redistribute it and/or modify it
78             under the same terms as Perl itself.
79              
80             =cut