Skip to content

Usage of implicit method attributeKey defined in object JavaMapping, which is not accessible here #1056

Closed

Description

@xuwei-k

Steps

build.sbt

scalaVersion := "3.8.4"

val pekkoVersion = "2.0.0-M3"

libraryDependencies ++= Seq(
  "org.apache.pekko" %% "pekko-actor-typed" % pekkoVersion,
  "org.apache.pekko" %% "pekko-stream" % pekkoVersion,
  "org.apache.pekko" %% "pekko-http" % "2.0.0-M1"
)

scalacOptions += "-deprecation"

project/build.properties

sbt.version=1.12.11

A.scala

import org.apache.pekko.http.scaladsl.model.HttpRequest
import org.apache.pekko.http.scaladsl.model.AttributeKeys

class A {
  def b(request: HttpRequest) = request.attribute(AttributeKeys.remoteAddress)
}

Problem

[warn] 5 |  def b(request: HttpRequest) = request.attribute(AttributeKeys.remoteAddress)
[warn]   |                                                                              ^
[warn]   |Usage of implicit method attributeKey defined in object JavaMapping, which is not accessible here. In Scala 3.10, this implicit will no longer be found.

Note

Activity

  1. maxcom commented on Jun 23, 2026

    @maxcom

    Use

    request.attributes.get(AttributeKeys.remoteAddress)
  2. added this to the 2.0.0-M3 milestone on Oct 10, 2026
  3. added a commit that references this issue on Oct 13, 2026
    d81fa58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions