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

Lift the "only literals" constraint when the predicate is constant #26

Closed
fthomas opened this issue Jul 12, 2015 · 2 comments
Closed

Lift the "only literals" constraint when the predicate is constant #26

fthomas opened this issue Jul 12, 2015 · 2 comments

Comments

@fthomas
Copy link
Owner

fthomas commented Jul 12, 2015

scala> val x: List[Int] @@ True = List(1, 2, 3)
<console>:40: error: refineLit only supports literals
       val x: List[Int] @@ True = List(1, 2, 3)
                                      ^

The rhs is not required for evaluation of the predicate (because it is constant), so this refinement should be possible at compile-time. The same is true for val x: List[Int] @@ Not[False] = List(1, 2, 3).

@fthomas
Copy link
Owner Author

fthomas commented Jul 18, 2015

Fixed by a1859ee.

@fthomas fthomas closed this as completed Jul 18, 2015
fthomas added a commit that referenced this issue Apr 5, 2016
This removes the notion of "constant" `Validate` instances
that allowed to refine non-literal values at compile-time.
This feature hasn't proven to be useful after all.

See #26 for the original issue that introduced constant
predicates.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant