summaryrefslogtreecommitdiff
path: root/Test/dafny0/TypeParameters.dfy
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2012-11-20 18:10:13 -0800
committerGravatar Rustan Leino <leino@microsoft.com>2012-11-20 18:10:13 -0800
commit7dac574b0d40e018fbae38207d0b0eabaa352494 (patch)
tree036e6aabd28ad1342702172073344b748279f593 /Test/dafny0/TypeParameters.dfy
parentd9211c0347ca9dafab45016da55606ce1de23257 (diff)
Diffstat (limited to 'Test/dafny0/TypeParameters.dfy')
-rw-r--r--Test/dafny0/TypeParameters.dfy28
1 files changed, 28 insertions, 0 deletions
diff --git a/Test/dafny0/TypeParameters.dfy b/Test/dafny0/TypeParameters.dfy
index cb9b5660..278c4c6f 100644
--- a/Test/dafny0/TypeParameters.dfy
+++ b/Test/dafny0/TypeParameters.dfy
@@ -189,3 +189,31 @@ method TyKn_Main(k0: TyKn_K) {
assert k2 != null ==> k2.F() == 176; // the canCall mechanism does the trick here, but so does the encoding
// via k2's where clause
}
+
+// ------------------- there was once a bug in the handling of the following example
+
+module OneLayer
+{
+ datatype wrap<V> = Wrap(V);
+}
+
+module TwoLayers
+{
+ import OneLayer;
+ datatype wrap2<T> = Wrap2(get: OneLayer.wrap<T>);
+
+ function F<U>(w: wrap2<U>) : OneLayer.wrap<U>
+ {
+ match w
+ case Wrap2(a) => a
+ }
+ function G<U>(w: wrap2<U>) : OneLayer.wrap<U>
+ {
+ match w
+ case Wrap2(a) => w.get
+ }
+ function H<U>(w: wrap2<U>) : OneLayer.wrap<U>
+ {
+ w.get
+ }
+}