Skip to content

Identify more statically resolved (effectively final) methods #51

Open
@lrytz

Description

@lrytz
trait TravLike { def map = ... }
sealed trait List extends TravLike { ... } // map is not overridden
final case class ::
final case object Nil
(l: List).map // can be inlined

we need to know that

  • the recevier is sealed
  • what are the children of the receiver
  • all children are final
  • none of the children overrides map

https://github.com/scala/scala/blob/2.12.x/src/compiler/scala/tools/nsc/backend/jvm/opt/CallGraph.scala#L293

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions