Skip to content

Commit

Permalink
More accurate compiler error comments
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-aws committed Mar 5, 2020
1 parent 8d66c02 commit 2a97770
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions Test/dafny0/RuntimeTypeTests0.dfy
Original file line number Diff line number Diff line change
Expand Up @@ -42,37 +42,37 @@ datatype Dt<+A> = Atom(get: A)
method H() {
var c := new Class0;
var a: Dt<Class0> := Atom(c);
var b: Dt<object>;
b := a; // compilation error: this would be hard to compile to C#
var b: Dt<object>; // compilation error: compilation does not support trait types as a type parameter; consider introducing a ghost
b := a;
print a, " and ", b, "\n";
}

method I()
{
var c := new Class0;
var a: Dt<Class0> := Atom(c);
var b: Dt<object>;
b := a; // compilation error: this would be hard to compile to C#
var b: Dt<object>; // compilation error: compilation does not support trait types as a type parameter; consider introducing a ghost
b := a;
print a, " and ", b, "\n";
}

method J()
{
var c0 := new Class0;
var c1 := new Class1;
var s: set<Tr> := {c0, c1};
var s: set<Tr> := {c0, c1}; // compilation error: compilation of set<TRAIT> is not supported; consider introducing a ghost
var t: set<Class0> := {c0};
s := t; // compilation error: this would be hard to compile to C#
s := t;
print s, " and ", t, "\n";
}

method K()
{
var c0 := new Class0;
var c1 := new Class1;
var s: seq<Tr> := [c0, c1];
var s: seq<Tr> := [c0, c1]; // no error, this is supported
var t: seq<Class0> := [c0];
s := t; // no error, this is supported
s := t;
print s, " and ", t, "\n";
}

Expand Down

0 comments on commit 2a97770

Please sign in to comment.