Skip to content

[SUPERSEDED] Deprecate lower case long literal like you mean it#7388

Closed
som-snytt wants to merge 3 commits intoscala:2.13.xfrom
som-snytt:issue/lower-ell
Closed

[SUPERSEDED] Deprecate lower case long literal like you mean it#7388
som-snytt wants to merge 3 commits intoscala:2.13.xfrom
som-snytt:issue/lower-ell

Conversation

@som-snytt
Copy link
Copy Markdown
Contributor

Rebased from #6989

@scala-jenkins scala-jenkins added this to the 2.13.0-RC1 milestone Nov 4, 2018
@SethTisue
Copy link
Copy Markdown
Member

SethTisue commented Nov 6, 2018

half of me wants to say "awesome, cool, thanks!", but the other half wants to say this would probably better be handled by an external linting tool. @som-snytt wdyt? is there an argument to be made that it belongs in this codebase?

@som-snytt
Copy link
Copy Markdown
Contributor Author

The argument for xlinting 1l is that it's scalac's fault. The JLS says don't do that, we've always known it was bad, and scala had a chance to do something about it and didn't. Propensive suggested deprecating outright. And why have two ways of doing the same thing? as the tiresome refrain goes. This is the next best thing. Note that lower el makes more sense when you call it a long instead of a Long.

The argument to mitigate the error on leading zero is that octal syntax is no longer a thing. Unwinding the error is a scalac change; whether to retain any warning for purposes of migration is a coin toss, as its purpose is to alert people who use octal syntax and need to be warned that they mistakenly used it intentionally in scala. Arguably the onus is on scala for ever supporting it.

@SethTisue
Copy link
Copy Markdown
Member

Propensive suggested deprecating outright

that sounds appealing

@som-snytt
Copy link
Copy Markdown
Contributor Author

Try it, you'll like it.

The new warning-filtering reporting system will make it easy to ignore, in case you are using your favorite password in code: 01l, like oil and water.

Don't put the `1l` warning behind a flag.

Deprecation is already somewhat behind a flag,
and the new warning-filtering reporter will
make it easy to suppress it, and the new scalafix
will make it easy to correct it.
@som-snytt
Copy link
Copy Markdown
Contributor Author

som-snytt commented Nov 9, 2018

@SethTisue there were tricky Lukas tests with 42l in strings that fail if they compile with warnings. But there was also the Serial...StabilityTest which I scratched my head about then remembered there is a restarring that hasn't happened? Isn't that easy enough to pull a lever for?

@som-snytt som-snytt changed the title Deprecate lower case long literal under xlint Deprecate lower case long literal like you mean it Nov 11, 2018
@som-snytt
Copy link
Copy Markdown
Contributor Author

som-snytt commented Dec 4, 2018

On the other numeric literal PR, I was like, I thought leading zero didn't error anymore. Well, it's hung up in this PR, which ought to be an easy win. Go team! Win! Win! Win!

Edit: oh right, I split this off from the other PR, figuring that half of a no-brainer should be twice as easy.

@adriaanm adriaanm self-assigned this Dec 20, 2018
@som-snytt som-snytt closed this Jan 20, 2019
@som-snytt som-snytt deleted the issue/lower-ell branch January 20, 2019 14:42
@SethTisue SethTisue removed this from the 2.13.0-RC1 milestone Feb 22, 2019
@som-snytt som-snytt changed the title Deprecate lower case long literal like you mean it [SUPERSEDED] Deprecate lower case long literal like you mean it Nov 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants