Skip to content

Scala 3.2: Comparing NonNegInt with Int gives a compile error #1130

@longliveenduro

Description

@longliveenduro

If I make an equal comparison on a NonNegInt with Int I get a compile error:

  def mapSignalStrengthUmts(rcspLev: NonNegInt): Option[Int] =
    if rcspLev < 1 then Some(-116) // same as if rcspLev == 0 but this gives a Refined compile error

gives:

Values of types eu.timepit.refined.types.numeric.NonNegInt and Int cannot be compared with == or !=

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions