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

Fix type of Long.MIN_VALUE and Long.MAX_VALUE #3100

Merged

Conversation

ChristianHein
Copy link
Contributor

Long.MIN_VALUE and Long.MAX_VALUE should be of type long like it is in the JDK sources.

This change shouldn't impact any previously working proofs since these values get translated to the correct numbers in JavaDL as sort int regardless.

Theoretically this change could introduce new type issues when parsing previously working Java code, but this seems unlikely since the int types would probably have been widened to long before anyway.

`Long.MIN_VALUE` and `Long.MAX_VALUE` should be of type `long` like it
is in the JDK sources.

This change shouldn't impact any previously working proofs since these
values get translated to the correct numbers in JavaDL as sort `int`
regardless.

Theoretically this change could introduce new type issues when parsing
previously working Java code, but this seems unlikely since the `int`
types would probably have been widened to `long` before anyway.
@jwiesler jwiesler self-requested a review April 3, 2023 18:39
@jwiesler jwiesler added this pull request to the merge queue Apr 3, 2023
@mattulbrich
Copy link
Member

Nice catch, should not even have been accepted in the first place. Recoder does not seem to make all necessary type checks.

@jwiesler
Copy link
Contributor

jwiesler commented Apr 3, 2023

I wonder why this compiled in the first place: assigning a long literal to an int requires a narrowing conversion which must not be implicit.

Merged via the queue into KeYProject:main with commit 1be463d Apr 3, 2023
12 of 13 checks passed
@ChristianHein ChristianHein deleted the hein/fixLongMinMaxValueType branch April 3, 2023 20:33
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.

None yet

3 participants