Skip to content

Implicit conversion does not trigger for private extension methods in the body of the owning class #12802

Open
@noresttherein

Description

@noresttherein

Reproduction steps

Scala version: 2.13.10

	implicit class Extension(private val self :Int) {
		private def squared :Int = self * self
		def avg(other :Int) :Int = math.sqrt(squared * other.squared).toInt
	}

Problem

value squared is not a member of Int
		def avg(other :Int) :Int = math.sqrt(squared * other.squared).toInt

Would be nice if implicit conversions triggered for all methods accessible in a given scope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementfixed in Scala 3This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions