Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

how to avoid loading class you want to coerce to? #150

Open
XSven opened this issue Nov 27, 2023 · 0 comments
Open

how to avoid loading class you want to coerce to? #150

XSven opened this issue Nov 27, 2023 · 0 comments

Comments

@XSven
Copy link

XSven commented Nov 27, 2023

Although not explicitly stated in Type::Tiny::Manual::Coercions Type::Tiny based coercion requires that the class you want to coerce to is previously loaded, otherwise you get a exception like

Can't locate object method "parse" via package "Foo" (perhaps you forgot to load "Foo"?) at compiled coercion 'to_Name' line 1.

Params::Coerce has a different philosophy Loading-Classes.

How to tell Type::Tiny to load the class you want to coerce to at run-time?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant