Skip to content
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

String interpolation with f"" causes compilation failure #8091

Closed
scabug opened this issue Dec 18, 2013 · 5 comments
Closed

String interpolation with f"" causes compilation failure #8091

scabug opened this issue Dec 18, 2013 · 5 comments
Assignees
Milestone

Comments

@scabug
Copy link

scabug commented Dec 18, 2013

Doing this in the REPL. Worked Monday 16/12, stopped working Tuesday 17/12.
{code}
scala> "börk börk" flatMap (ch ⇒ if (ch > 127) f"&#x${ch}%04x;" else "" + ch)
:8: error: type mismatch;
found : Comparable[String]
required: scala.collection.GenTraversableOnce[?]
"börk börk" flatMap (ch ⇒ if (ch > 127) f"&#x${ch}%04x;" else "" + ch)
{code} ^

@scabug
Copy link
Author

scabug commented Dec 18, 2013

Imported From: https://issues.scala-lang.org/browse/SI-8091?orig=1
Reporter: Björn Antonsson (bjorn.antonsson)
Affected Versions: 2.11.0-M7

@scabug
Copy link
Author

scabug commented Dec 18, 2013

@paulp said:
ca2dbe55eb

"In this formulation, it becomes apparent that the first typecheck is redundant. If something is ascribed with some type, then typechecking the ascription against that type does nothing useful."

...except maybe induce an implicit conversion, as in from String => StringOps.

@scabug
Copy link
Author

scabug commented Dec 18, 2013

@xeno-by said:
It's actually scala/scala@a3b3341. The whitebox change is at fault here, because fast track macros are considered whitebox by default.

@scabug
Copy link
Author

scabug commented Dec 18, 2013

@xeno-by said:
scala/scala#3288

@scabug
Copy link
Author

scabug commented Dec 19, 2013

@paulp said:
Man, I thought I could shoot from the hip this one time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants