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

Elide strings to empty instead of null #10190

Closed
scabug opened this issue Feb 14, 2017 · 2 comments
Closed

Elide strings to empty instead of null #10190

scabug opened this issue Feb 14, 2017 · 2 comments

Comments

@scabug
Copy link

scabug commented Feb 14, 2017

Go's default for string is empty and not null. Scala elides to the default value, but for strings, it would be more helpful to elide to the empty string. There's only upside.

Probably folks don't use elidable enough for this to be a major issue.

Certainly the compiler has an issue where debug strings are expensive to compute. How handy if you could elide them and still have nothing crash with NPE.

This suggestion came from the SO question linked to ticket #9207.

@scabug
Copy link
Author

scabug commented Feb 14, 2017

Imported From: https://issues.scala-lang.org/browse/SI-10190?orig=1
Reporter: @som-snytt
Affected Versions: 2.12.1
See #9207

@scabug
Copy link
Author

scabug commented Feb 15, 2017

@som-snytt said:
scala/scala#5704

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