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

Conversion for types with several predicates does not work #613

Open
x0ji0d opened this issue Feb 3, 2019 · 0 comments
Open

Conversion for types with several predicates does not work #613

x0ji0d opened this issue Feb 3, 2019 · 0 comments

Comments

@x0ji0d
Copy link

x0ji0d commented Feb 3, 2019

type PositiveInt = Int Refined Positive
type PositiveAndLessTenInt = Int Refined (Positive And Less[W.`10`.T])

var foo: PositiveInt = 1
val bar: PositiveAndLessTenInt = 5

foo = bar

This produces error:

type mismatch;
 found   : Playground.this.PositiveAndLessTenInt
    (which expands to)  eu.timepit.refined.api.Refined[Int,eu.timepit.refined.boolean.And[eu.timepit.refined.numeric.Greater[shapeless._0],eu.timepit.refined.numeric.Less[Int(10)]]]
 required: Playground.this.PositiveInt
    (which expands to)  eu.timepit.refined.api.Refined[Int,eu.timepit.refined.numeric.Greater[shapeless._0]]
@x0ji0d x0ji0d changed the title Numeric conversion for types with several predicates does not work Conversion for types with several predicates does not work Feb 3, 2019
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