You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to make the constructor of Refinedprivate[refined] to ensure that any Refined[T, P] values only contains Ts that satisfy P. But doing so currently fails a tut example:
[tut] *** Error reported at type_aliases.md:18
<console>:28: error: constructor Refined in class Refined cannot be accessed in object $iw
Square('a', 1)
^
The reason for this is that the autoRefineV macro replaces 'a' with Refined('a') in this example and thus calling the constructor outside of the refined package. Can this be done without more black magic?
The text was updated successfully, but these errors were encountered:
One option is to add a (properly documented) public delegate for the private constructor with an ugly or scary name (e.g. unsafeApply) and use that in the macro implementation. This should ensure that nobody circumvents refineV and refineMV accidentally.
I'd like to make the constructor of
Refined
private[refined]
to ensure that anyRefined[T, P]
values only containsT
s that satisfyP
. But doing so currently fails a tut example:The reason for this is that the
autoRefineV
macro replaces'a'
withRefined('a')
in this example and thus calling the constructor outside of therefined
package. Can this be done without more black magic?The text was updated successfully, but these errors were encountered: