diff options
author | Rustan Leino <leino@microsoft.com> | 2012-11-20 18:10:13 -0800 |
---|---|---|
committer | Rustan Leino <leino@microsoft.com> | 2012-11-20 18:10:13 -0800 |
commit | 7dac574b0d40e018fbae38207d0b0eabaa352494 (patch) | |
tree | 036e6aabd28ad1342702172073344b748279f593 /Test/dafny0/TypeParameters.dfy | |
parent | d9211c0347ca9dafab45016da55606ce1de23257 (diff) |
fixed type resolution bug (http://boogie.codeplex.com/discussions/403801)
Diffstat (limited to 'Test/dafny0/TypeParameters.dfy')
-rw-r--r-- | Test/dafny0/TypeParameters.dfy | 28 |
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
+ }
+}
|