Skip to content

value + is not a member of Int #23167

Open
@scarf005

Description

@scarf005

Compiler version

3.7.0

Minimized example

(1, 2).map([Int] => (x: Int) => x + 1)

Output Error/Warning message

scala> (1, 2).map([Int] => (x: Int) => x + 1)
-- [E008] Not Found Error: --------------------------------------------------------------------------------------
1 |(1, 2).map([Int] => (x: Int) => x + 1)
  |                                ^^^
  |                        value + is not a member of Int, but could be made available as an extension method.
  |
  |                        One of the following imports might make progress towards fixing the problem:
  |
  |                          import scala.math.Fractional.Implicits.infixFractionalOps
  |                          import scala.math.Integral.Implicits.infixIntegralOps
  |                          import scala.math.Numeric.Implicits.infixNumericOps
  |
1 error found

Why this Error/Warning was not helpful

the error message value + is not a member of Int is very confusing because 1 + 1 = 2

Suggested improvement

probably same as #10082

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:reportingError reporting including formatting, implicit suggestions, etcbetter-errorsIssues concerned with improving confusing/unhelpful diagnostic messagesitype:enhancement

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions