diff options
author | Unknown <leino@LEINO6.redmond.corp.microsoft.com> | 2012-06-11 16:45:21 -0700 |
---|---|---|
committer | Unknown <leino@LEINO6.redmond.corp.microsoft.com> | 2012-06-11 16:45:21 -0700 |
commit | a63e68b3fe5d2245ad86767fde5f12717fb57f79 (patch) | |
tree | 0ada06fbf027b68a0d7244b2e4d3f92f6045ca4a /Test/dafny0/Modules1.dfy | |
parent | cb5f93c71b97a878e76c1dacb0933783a3738235 (diff) |
Dafny: allow types to be qualified with the name of the module that declares them (for now, this is supported only in type expressions and "new" allocations, not in places where the type name is used to qualify some other type member)
Diffstat (limited to 'Test/dafny0/Modules1.dfy')
-rw-r--r-- | Test/dafny0/Modules1.dfy | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/Test/dafny0/Modules1.dfy b/Test/dafny0/Modules1.dfy index 5e2d0fff..e8a88749 100644 --- a/Test/dafny0/Modules1.dfy +++ b/Test/dafny0/Modules1.dfy @@ -89,3 +89,23 @@ module B_Visibility imports A_Visibility { }
}
}
+
+// ------ qualified type names ----------------------------------
+
+module Q_Imp {
+ class Node { }
+ class Klassy {
+ method Init()
+ }
+}
+
+module Q_M imports Q_Imp {
+ method MyMethod(root: Q_Imp.Node, S: set<Q_Imp.Node>)
+ requires root in S;
+ {
+ var i := new Q_Imp.Node;
+ var j := new Node;
+ assert i != j; // fine
+ var q := new Q_Imp.Klassy.Init();
+ }
+}
|