Last active
July 23, 2020 13:59
-
-
Save Altreus/f0a2170378f31562779379692de8de8b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> my %image-formats = JPEG => '.jpeg', PNG => '.png', WebP => '.webp', GIF => '.gif'; | |
{GIF => .gif, JPEG => .jpeg, PNG => .png, WebP => .webp} | |
> subset ImageFormat of Str where * ~~ %image-formats; | |
(ImageFormat) | |
> sub f(ImageFormat :$format = "PNG") { say $format } | |
&f | |
> f() | |
Constraint type check failed in binding to parameter '$format'; expected ImageFormat but got Str ("PNG") | |
in sub f at <unknown file> line 1 | |
in block <unit> at <unknown file> line 1 | |
> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment