Skip to content

-coverage-out fails to compile formatted string interpolation #15487

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
arixmkii opened this issue Jun 20, 2022 · 1 comment · Fixed by #15530
Closed

-coverage-out fails to compile formatted string interpolation #15487

arixmkii opened this issue Jun 20, 2022 · 1 comment · Fixed by #15530
Assignees
Labels
area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html itype:bug
Milestone

Comments

@arixmkii
Copy link
Contributor

Compiler version

3.2.0-RC1 with "-coverage-out:."

Minimized code

@main def main: Unit =
  println(hexMe(127))

def hexMe(i: Int): String =
  f"0x$i%016x"

Output

[error] 5 |  f"0x$i%016x"
[error]   |  ^^^^^^^^^^^^
[error]   |  Expected statically known StringContext
[error] one error found

Expectation

Code compiles

@arixmkii arixmkii added itype:bug stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 20, 2022
@arixmkii arixmkii changed the title -coverage-out fails to compile string format interpolation -coverage-out fails to compile formatted string interpolation Jun 20, 2022
@TheElectronWill TheElectronWill added area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Jun 20, 2022
@nicolasstucki
Copy link
Contributor

When instrumenting, we should not lift StringContext.f as this code is an intrinsic macro that will be replaced in StringInterpolatorOpt.

TheElectronWill added a commit to TheElectronWill/dotty that referenced this issue Jun 25, 2022
TheElectronWill added a commit to TheElectronWill/dotty that referenced this issue Jun 25, 2022
TheElectronWill added a commit to TheElectronWill/dotty that referenced this issue Jul 2, 2022
TheElectronWill added a commit to TheElectronWill/dotty that referenced this issue Jul 2, 2022
bishabosha pushed a commit to dotty-staging/dotty that referenced this issue Oct 18, 2022
@Kordyjan Kordyjan added this to the 3.2.1 milestone Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:coverage Code coverage, see https://dotty.epfl.ch/docs/internals/coverage.html itype:bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants