summaryrefslogtreecommitdiff
path: root/Source/Dafny/Compiler.cs
diff options
context:
space:
mode:
authorGravatar Rustan Leino <unknown>2015-08-20 17:24:58 -0700
committerGravatar Rustan Leino <unknown>2015-08-20 17:24:58 -0700
commitb8d7d6d785a29fd948e9a9740fb96ed270ac19d8 (patch)
tree85f5ccc9758ab327392f2a7eff09335699f25bbc /Source/Dafny/Compiler.cs
parent566fdf1676e0d7d6060767febbfa7a0378300e99 (diff)
Minor refactoring
Diffstat (limited to 'Source/Dafny/Compiler.cs')
-rw-r--r--Source/Dafny/Compiler.cs9
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/Dafny/Compiler.cs b/Source/Dafny/Compiler.cs
index 8bfa5fa9..477acabf 100644
--- a/Source/Dafny/Compiler.cs
+++ b/Source/Dafny/Compiler.cs
@@ -687,14 +687,11 @@ namespace Microsoft.Dafny {
return formal.HasName ? formal.CompileName : "_a" + i;
}
- string DtName(DatatypeDecl decl) {
- return decl.FullCompileName;
- }
string DtCtorName(DatatypeCtor ctor) {
Contract.Requires(ctor != null);
Contract.Ensures(Contract.Result<string>() != null);
- return DtName(ctor.EnclosingDatatype) + "_" + ctor.CompileName;
+ return ctor.EnclosingDatatype.FullCompileName + "_" + ctor.CompileName;
}
string DtCtorDeclartionName(DatatypeCtor ctor) {
Contract.Requires(ctor != null);
@@ -2390,7 +2387,7 @@ namespace Microsoft.Dafny {
Contract.Assert(dtv.Ctor != null); // since dtv has been successfully resolved
var typeParams = dtv.InferredTypeArgs.Count == 0 ? "" : string.Format("<{0}>", TypeNames(dtv.InferredTypeArgs));
- wr.Write("new {0}{1}(", DtName(dtv.Ctor.EnclosingDatatype), typeParams);
+ wr.Write("new {0}{1}(", dtv.Ctor.EnclosingDatatype.FullCompileName, typeParams);
if (!dtv.IsCoCall) {
// For an ordinary constructor (that is, one that does not guard any co-recursive calls), generate:
// new Dt_Cons<T>( args )
@@ -2860,7 +2857,7 @@ namespace Microsoft.Dafny {
var b = (ComprehensionExpr.DatatypeBoundedPool)bound;
wr.Write("Dafny.Helpers.QuantDatatype(");
- wr.Write("{0}.AllSingletonConstructors, ", DtName(b.Decl));
+ wr.Write("{0}.AllSingletonConstructors, ", b.Decl.FullCompileName);
} else {
Contract.Assert(false); throw new cce.UnreachableException(); // unexpected BoundedPool type
}