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

Allow cardinality to be treated as long in Java #4484

Merged
merged 6 commits into from
Aug 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Source/DafnyCore/Compilers/Java/Compiler-java.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1083,6 +1083,7 @@ private string CastIfSmallNativeType(NativeType nt) {
switch (AsJavaNativeType(nt)) {
case JavaNativeType.Byte: return "(byte) ";
case JavaNativeType.Short: return "(short) ";
case JavaNativeType.Long: return "(long) ";
default: return "";
}
}
Expand Down
9 changes: 9 additions & 0 deletions Test/git-issues/github-issue-4483.dfy
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// RUN: %testDafnyForEachCompiler "%s"
const TWO_TO_THE_64: int := 0x1_00000000_00000000
newtype uint64 = x: int | 0 <= x < TWO_TO_THE_64

method Foo() returns (tuple: (uint64, uint64)) {
var s := [1,2,3];
var (foo, length) := (0, |s| as uint64);
return (foo, length);
}
Empty file.
Loading