summaryrefslogtreecommitdiff
path: root/Source/Dafny
diff options
context:
space:
mode:
authorGravatar Rustan Leino <leino@microsoft.com>2012-01-09 10:29:11 -0800
committerGravatar Rustan Leino <leino@microsoft.com>2012-01-09 10:29:11 -0800
commite29ca07f28a9c54c46f4c45a3d77c3cf7254d07f (patch)
treea86285ab9ac3ec54971971ed080524ccc5eff1ee /Source/Dafny
parente146b555150d30ef9afe07b7d0291870b4c59143 (diff)
Dafny: disallow changes of datatypes in refinements
Diffstat (limited to 'Source/Dafny')
-rw-r--r--Source/Dafny/RefinementTransformer.cs11
1 files changed, 1 insertions, 10 deletions
diff --git a/Source/Dafny/RefinementTransformer.cs b/Source/Dafny/RefinementTransformer.cs
index a25d1eb8..adf99859 100644
--- a/Source/Dafny/RefinementTransformer.cs
+++ b/Source/Dafny/RefinementTransformer.cs
@@ -104,11 +104,7 @@ namespace Microsoft.Dafny {
} else if (nw is ArbitraryTypeDecl) {
reporter.Error(nw, "an arbitrary type declaration ({0}) in a refining module cannot replace a more specific type declaration in the refinement base", nw.Name);
} else if (nw is DatatypeDecl) {
- if (d is ClassDecl) {
- reporter.Error(nw, "a datatype declaration ({0}) in a refining module cannot replace a class declaration in the refinement base", nw.Name);
- } else {
- m.TopLevelDecls[index] = MergeDatatype((DatatypeDecl)nw, (DatatypeDecl)d);
- }
+ reporter.Error(nw, "a datatype declaration ({0}) in a refinement module can only replace an arbitrary-type declaration", nw.Name);
} else {
Contract.Assert(nw is ClassDecl);
if (d is DatatypeDecl) {
@@ -502,11 +498,6 @@ namespace Microsoft.Dafny {
// -------------------------------------------------- Merging ---------------------------------------------------------------
- DatatypeDecl MergeDatatype(DatatypeDecl nw, DatatypeDecl prev) {
- // TODO
- return nw;
- }
-
ClassDecl MergeClass(ClassDecl nw, ClassDecl prev) {
// TODO
return nw;