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: division for newtypes in JS and PY #4234

Merged
merged 2 commits into from
Jun 30, 2023

Conversation

RustanLeino
Copy link
Collaborator

Fixes #4233

This PR corrects the type tests that the JS and PY compilers had done on newtypes.

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Copy link
Collaborator

@fabiomadge fabiomadge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! I was under the impression that real-based newtypes are a recent addition, which is probably why I made the mistake in the first place.

Comment on lines +633 to +638
var s0: bv3 := 6 + 3; // 1
var s1: bv3 := -1; // 7
var s2: bv3 := 4 + 5 - 2; // 7
var s3: bv7 := 126 + 3; // 1
var s4: bv7 := -1; // 127
var s5: bv7 := 64 + 65 - 2; // 127
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
var s0: bv3 := 6 + 3; // 1
var s1: bv3 := -1; // 7
var s2: bv3 := 4 + 5 - 2; // 7
var s3: bv7 := 126 + 3; // 1
var s4: bv7 := -1; // 127
var s5: bv7 := 64 + 65 - 2; // 127
var s0: bv3 := 6 + 3;
var s1: bv3 := -1;
var s2: bv3 := 4 + 5 - 2;
var s3: bv7 := 126 + 3;
var s4: bv7 := -1;
var s5: bv7 := 64 + 65 - 2;

Skipping them would be consistent with the other methods.

@@ -0,0 +1 @@
Select proper division for newtype reals
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Select proper division for newtype reals
Select proper division for real-based newtypes

@RustanLeino RustanLeino merged commit 6fc02b3 into dafny-lang:master Jun 30, 2023
19 checks passed
@RustanLeino
Copy link
Collaborator Author

RustanLeino commented Jun 30, 2023

Thanks for the quick review, and for the comments. I'm afraid the web page showed me your comments only after I merged. I'll include them in my next PR (#4235).

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.

JS/Py select incorrect division for newtype real
2 participants