---
name: "Parse::Method::Signatures::TypeConstraint"
section: "3pm"
platform: "linux"
package: "libparse-method-signatures-perl"
version: "1.003019-2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Parse::Method::Signatures::TypeConstraint"
---

# Parse::Method::Signatures::TypeConstraint(3pm)

turn parsed TC data into Moose TC object

## NAME

Parse::Method::Signatures::TypeConstraint - turn parsed TC data into Moose TC object

## DESCRIPTION

Class used to turn PPI elements into Moose::Meta::TypeConstraint objects.

## ATTRIBUTES

### tc

**Lazy Build.**

The Moose::Meta::TypeConstraint object for this type constraint, built when requested. "tc\_callback" will be called for each individual component type in turn.

### tc\_callback

**Type:** CodeRef

**Default:** "find\_registered\_constraint"

Callback used to turn type names into type objects. See "type\_constraint\_callback" in Parse::Method::Signatures for more details and an example.

### from\_namespace

**Type:** ClassName

If provided, then the default `"tc_callback"` will search for MooseX::Types in this package.

## METHODS

### find\_registered\_constraint

Will search for an imported MooseX::Types in "from\_namespace" (if provided). Failing that it will ask the Moose::Meta::TypeConstraint::Registry for a type with the given name.

If all else fails, it will simple return the type as a string, so that Moose's auto-vivification of classnames to type will work.

### to\_string

String representation of the type constraint, approximately as parsed.

## SEE ALSO

Parse::Method::Signatures, MooseX::Types, MooseX::Types::Util.

## AUTHORS

Florian Ragwitz \<rafl@debian.org\>.

Ash Berlin \<ash@cpan.org\>.

## LICENSE

Licensed under the same terms as Perl itself.
