summaryrefslogtreecommitdiff
path: root/Dafny/DafnyAst.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Dafny/DafnyAst.cs')
-rw-r--r--Dafny/DafnyAst.cs11
1 files changed, 10 insertions, 1 deletions
diff --git a/Dafny/DafnyAst.cs b/Dafny/DafnyAst.cs
index dd190b6c..012619ee 100644
--- a/Dafny/DafnyAst.cs
+++ b/Dafny/DafnyAst.cs
@@ -744,7 +744,7 @@ namespace Microsoft.Dafny {
public IToken BodyEndTok = Token.NoToken;
public readonly string/*!*/ Name;
string compileName;
- public string CompileName {
+ public virtual string CompileName {
get {
if (compileName == null) {
compileName = NonglobalVariable.CompilerizeName(Name);
@@ -1253,6 +1253,15 @@ namespace Microsoft.Dafny {
return EnclosingClass.FullNameInContext(context) + "." + Name;
}
+ public override string CompileName {
+ get {
+ var nm = base.CompileName;
+ if (this.Name == EnclosingClass.Name) {
+ nm = "_" + nm;
+ }
+ return nm;
+ }
+ }
public string FullCompileName {
get {
Contract.Requires(EnclosingClass != null);