summaryrefslogtreecommitdiff
path: root/Source/Dafny/Printer.cs
diff options
context:
space:
mode:
authorGravatar leino <unknown>2014-08-20 20:21:47 -0700
committerGravatar leino <unknown>2014-08-20 20:21:47 -0700
commit61d55705cdf6a710f1a21ddb2ae2caaa314ca7f6 (patch)
treeeb71616351742e3e1e5b56b334065df860a904af /Source/Dafny/Printer.cs
parent3b51d9251d78bd3de763c951102677eecd764984 (diff)
Start of derived types (aka "new types")
Fixed bug in type checking for integer division.
Diffstat (limited to 'Source/Dafny/Printer.cs')
-rw-r--r--Source/Dafny/Printer.cs8
1 files changed, 8 insertions, 0 deletions
diff --git a/Source/Dafny/Printer.cs b/Source/Dafny/Printer.cs
index bfbc9644..459cbcef 100644
--- a/Source/Dafny/Printer.cs
+++ b/Source/Dafny/Printer.cs
@@ -140,6 +140,14 @@ namespace Microsoft.Dafny {
PrintClassMethodHelper("type", at.Attributes, at.Name, new List<TypeParameter>());
wr.Write(EqualitySupportSuffix(at.EqualitySupport));
wr.WriteLine();
+ } else if (d is DerivedTypeDecl) {
+ var dd = (DerivedTypeDecl)d;
+ if (i++ != 0) { wr.WriteLine(); }
+ Indent(indent);
+ PrintClassMethodHelper("type", dd.Attributes, dd.Name, new List<TypeParameter>());
+ wr.Write(" = new ");
+ PrintType(dd.BaseType);
+ wr.WriteLine();
} else if (d is TypeSynonymDecl) {
var syn = (TypeSynonymDecl)d;
if (i++ != 0) { wr.WriteLine(); }