Skip to content

Failing to resolve to correct StringContext #4732

@allanrenucci

Description

@allanrenucci
object StringContext {
  s"Hello"
}

fails to compile with Dotty and Scalac:

-- [E050] Reference Error: tests/allan/Test.scala:49:3 -------------------------
49 |  s"Hello"
   |   ^
   |   object StringContext does not take parameters

This is because the code snippet desugars to

StringContext("Hello").s()

Is this on purpose? An easy fix would be to desugar to scala.StringContext("Hello").s()

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:desugarDesugaring happens after parsing but before typing, see desugar.scalahelp wanteditype:bug

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions