Skip to content

String identifiers yield compilation errors when converted withDottyCompat #3100

Closed
@magnusart

Description

@magnusart

I have gotten an unexpected compilation error when setting up a template project to try out dotty and following the Akka documentation at http://doc.akka.io/docs/akka-http/current/scala/http/introduction.html#using-akka-http

I set up the dependencies described and added withDottyCompat to my library dependencies in my build.sbt and also made sure to define crossScalaVersions as per the Dotty example project.

I then get an compilation error for the following line of code:

complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>Say hello to akka-http</h1>"))

The error I get is

[error] -- [E008] Member Not Found Error: /Users/ ... /TestService.scala:27:43
[error] 27 |          complete(HttpEntity(ContentTypes.`text/html(UTF-8)`, "<h1>Say hello to akka-http</h1>"))
[error]    |                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
[error]    |value `text$u002Fhtml(UTF-8)` is not a member of akka.http.scaladsl.model.ContentTypes

If I change the signature (via content assist) to

complete(HttpEntity(ContentTypes.text$divhtml$u0028UTF$minus8$u0029, "<h1>Say hello to akka-http</h1>"))

Dotty can now compile the project just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions