summaryrefslogtreecommitdiff
path: root/Source/Dafny/Compiler.cs
diff options
context:
space:
mode:
authorGravatar Reza Ahmadi <reza.ahmadi@uta.fi>2014-12-03 12:44:41 +0200
committerGravatar Reza Ahmadi <reza.ahmadi@uta.fi>2014-12-03 12:44:41 +0200
commitc5d7c43605d832cc64e16c66a2c830a880a3d3a2 (patch)
tree2a11e88fa879a224cadd9f488ffbd78b4c35b5d2 /Source/Dafny/Compiler.cs
parentfc43d9d56bdf3cae68bb15871f074149d1381c6a (diff)
added multiple trait inheritance.
- a class can now extend more than one traits
Diffstat (limited to 'Source/Dafny/Compiler.cs')
-rw-r--r--Source/Dafny/Compiler.cs12
1 files changed, 6 insertions, 6 deletions
diff --git a/Source/Dafny/Compiler.cs b/Source/Dafny/Compiler.cs
index 547b48d6..60b8f143 100644
--- a/Source/Dafny/Compiler.cs
+++ b/Source/Dafny/Compiler.cs
@@ -247,9 +247,9 @@ namespace Microsoft.Dafny {
else if (d is ClassDecl) {
var cl = (ClassDecl)d;
Indent(indent);
- if (cl.TraitObj != null && cl.TraitObj is TraitDecl)
+ if (cl.TraitsObj != null)
{
- wr.WriteLine("public class @{0} : @{1}", cl.CompileName, cl.TraitObj.Name);
+ wr.WriteLine("public class @{0} : @{1}", cl.CompileName, cl.TraitsStr);
}
else
wr.Write("public class @{0}", cl.CompileName);
@@ -766,14 +766,14 @@ namespace Microsoft.Dafny {
if (f.Inherited)
{
Indent(indent);
- wr.WriteLine("public {0} @{1};", TypeName(f.Type), f.CompileName);
- wr.Write("{0} @{1}.@{2}", TypeName(f.Type), c.TraitObj.CompileName, f.CompileName);
+ wr.WriteLine("public {0} @_{1};", TypeName(f.Type), f.CompileName);
+ wr.Write("public {0} @{1}", TypeName(f.Type), f.CompileName);
wr.WriteLine(" {");
wr.WriteLine(" get { ");
- wr.Write("return this.@{0};", f.CompileName);
+ wr.Write("return this.@_{0};", f.CompileName);
wr.WriteLine("}");
wr.WriteLine(" set { ");
- wr.WriteLine("this.@{0} = value;", f.CompileName);
+ wr.WriteLine("this.@_{0} = value;", f.CompileName);
wr.WriteLine("}");
wr.WriteLine("}");
}