-
I want to be able to share complex regex groupings with multiple typealiases, like this: hidden ipv6_pattern #"..."#
typealias IPv6Address = String(matches(Regex(#"^\#(ipv6_pattern)$"#))) This typealias will work perfectly fine within the module it is defined in. However, when I import the module containing this line in another pkl file, I get an error about
This error can be fixed by prefixing Is there a better way of achieving this? Is this intentional behavior? This is not specific to matching IP addresses. If pkl has a builtin that provides an IPAddress typealias then that's nice, however I do have other places where I would like to reuse regex snippets too :) |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
This is a bug that will be fixed in 0.26 (fix in #144). For now, the workaround is to qualify the reference like you mentioned. Also, there are some helpful typealiases that you can use in pkl.experimental.net, including IPAddressString |
Beta Was this translation helpful? Give feedback.
This is a bug that will be fixed in 0.26 (fix in #144).
For now, the workaround is to qualify the reference like you mentioned.
Also, there are some helpful typealiases that you can use in pkl.experimental.net, including IPAddressString