dafny-lang / libraries

Libraries useful for Dafny programs
Other
43 stars 25 forks source link

JSON regression test fails #145

Open markrtuttle opened 1 year ago

markrtuttle commented 1 year ago

I'm unable to run the JSON regression test in Tests.dfy with dafny 4.2.0 from Homebrew on MacOS.

Tests.dfy begins with

// RUN: %run "%s" --unicode-char:false --input ../Unicode/UnicodeStringsWithoutUnicodeChar.dfy
// RUN: %run "%s" --unicode-char:true --input ../Unicode/UnicodeStringsWithUnicodeChar.dfy

So I try

git clone https://github.com/dafny-lang/libraries
cd libraries/src/JSON
dafny run --target cs --unicode-char:false --input ../Unicode/UnicodeStringsWithoutUnicodeChar.dfy  Tests.dfy 
dafny run --target js --unicode-char:false --input ../Unicode/UnicodeStringsWithoutUnicodeChar.dfy  Tests.dfy 
dafny run --target java --unicode-char:false --input ../Unicode/UnicodeStringsWithoutUnicodeChar.dfy  Tests.dfy 

My results are

markrtuttle commented 1 year ago

Tests.dfy includes API.dfy which includes Serializer.dfy which includes ../Math.dfy which defines Abs. So verification works but compilation fails.

markrtuttle commented 1 year ago

I think the compiler is picking up the standard Math class and not the Math class defined in this library. Renaming Math to DMath in this library solves the problem for Java, and I think also for C# and JavaScript.