Skip to content

Ambiguous implicits for min/max #629

@frozenspider

Description

@frozenspider

Scala 2.11, spire 0.13.0

import spire.implicits._

object SpireTest {
  1 max 2 // Error
}

Error is as follows:
type mismatch; found : Int(1) required: ?{def max(x$1: ? >: Int(2)): ?} Note that implicit conversions are not applicable because they are ambiguous: both method intWrapper in class LowPriorityImplicits of type (x: Int)scala.runtime.RichInt and method literalIntOrderOps in trait OrderSyntax of type (lhs: Int)spire.syntax.LiteralIntOrderOps are possible conversion functions from Int(1) to ?{def max(x$1: ? >: Int(2)): ?}

Is this expected? If so, how should implicits be used?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions