summaryrefslogtreecommitdiff
path: root/Test/dafny0/ResolutionErrors.dfy
diff options
context:
space:
mode:
authorGravatar leino <unknown>2014-10-28 17:44:39 -0700
committerGravatar leino <unknown>2014-10-28 17:44:39 -0700
commit655b8311917e38cc2b359bad46def21de7852508 (patch)
tree8c7881bac939013d25a28e82e9860c456f034ea0 /Test/dafny0/ResolutionErrors.dfy
parent6c9a50e81dbdb791c558ac0a3463f01ee6a7f580 (diff)
Disallow automatic completion of type arguments to the LHS of datatype declarations
Diffstat (limited to 'Test/dafny0/ResolutionErrors.dfy')
-rw-r--r--Test/dafny0/ResolutionErrors.dfy19
1 files changed, 19 insertions, 0 deletions
diff --git a/Test/dafny0/ResolutionErrors.dfy b/Test/dafny0/ResolutionErrors.dfy
index 79e7ac57..e324393d 100644
--- a/Test/dafny0/ResolutionErrors.dfy
+++ b/Test/dafny0/ResolutionErrors.dfy
@@ -1240,3 +1240,22 @@ module NonInferredTypeVariables {
*/
}
}
+
+// -------------- signature completion ------------------
+
+module SignatureCompletion {
+ // datatype signatures do not allow auto-declared type parameters on the LHS
+ datatype Dt = Ctor(X -> Dt) // error: X is not a declared type
+ datatype Et<Y> = Ctor(X -> Et, Y) // error: X is not a declared type
+
+ // For methods and functions, signatures can auto-declare type parameters
+ method My0(s: set, x: A -> B)
+ method My1(x: A -> B, s: set)
+ method My2<A,B>(s: set, x: A -> B)
+ method My3<A,B>(x: A -> B, s: set)
+
+ function F0(s: set, x: A -> B): int
+ function F1(x: A -> B, s: set): int
+ function F2<A,B>(s: set, x: A -> B): int
+ function F3<A,B>(x: A -> B, s: set): int
+}