Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

String interpolation followed by a dot is missing string literals #15514

Closed
@tgodzik

Description

@tgodzik

Compiler version

3.2.0-RC1

Minimized code

objectMain {s"Hello$Main.toStr!"}

Output

This is the tree representing the string interpolation:

Select(    qualifier=Apply(      fun=Select(        qualifier=Apply(          fun=Select(            qualifier=Select(              qualifier=Select(qualifier=Ident(name= _root_), name= scala),              name=StringContext            ),            name= apply          ),          args=List(Typed(              expr=SeqLiteral(                elems=List(Literal(const= (="Hello"))),                elemtpt= ...              ),              tpt= ...            )          )        ),        name= s      ),      args=List(        ...      )    ),    name= <error>  ),

Notice it only contains"Hello " literal.

Expectation

Select(    qualifier=Apply(      fun=Select(        qualifier=Apply(          fun=Select(            qualifier=Select(              qualifier=Select(qualifier=Ident(name= _root_), name= scala),              name=StringContext            ),            name= apply          ),          args=List(Typed(              expr=SeqLiteral(                 elems=List(Literal(const= (="Hello")),Literal(const= (=".toStr!")))                elemtpt= ...              ),              tpt= ...            )          )        ),        name= s      ),      args=List(        ...      )    ),    name= <error>  ),

The main part is elems = List(Literal(const = ( = "Hello ")), Literal(const = ( = ".toStr!")))

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp