From 9b2dea60e57be8ddb39b36ed8a282e3826cd4092 Mon Sep 17 00:00:00 2001 From: qunyanm Date: Wed, 18 Nov 2015 11:05:48 -0800 Subject: Fix issue 108. Use idGenerator to create a new collection name for each occurrence of Set/MapComprehension when translating it to c#. --- Test/dafny4/Bug108.dfy | 11 +++++++++++ Test/dafny4/Bug108.dfy.expect | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 Test/dafny4/Bug108.dfy create mode 100644 Test/dafny4/Bug108.dfy.expect (limited to 'Test/dafny4') diff --git a/Test/dafny4/Bug108.dfy b/Test/dafny4/Bug108.dfy new file mode 100644 index 00000000..17cb9f12 --- /dev/null +++ b/Test/dafny4/Bug108.dfy @@ -0,0 +1,11 @@ +// RUN: %dafny /compile:3 "%s" > "%t" +// RUN: %diff "%s.expect" "%t" + +method Main() { + var A := map[0 := 1]; + var B := map x | x in (set y | y in A) :: A[x]; + print A, "\n"; + print B, "\n"; +} + + diff --git a/Test/dafny4/Bug108.dfy.expect b/Test/dafny4/Bug108.dfy.expect new file mode 100644 index 00000000..94e65ba2 --- /dev/null +++ b/Test/dafny4/Bug108.dfy.expect @@ -0,0 +1,7 @@ + +Dafny program verifier finished with 2 verified, 0 errors +Program compiled successfully +Running... + +map[0 := 1] +map[0 := 1] -- cgit v1.2.3