Open pauljoo28 opened 4 years ago
Ah, fortunately, this is not an error but a feature! We now require in Gator that canonical functions map between two geometric objects. To fix this code, simply change the function to act on reference frames a
and b
rather than the raw types a
and b
.
For example, we might write:
canon cart3<b>.point _ab(cart3<a>.point v) {
return (v + [1., 1.]) as! cart3<b>.point;
}
And we get the original intended behavior!
However, I will leave this issue open, since clearly the current error message is not helpful for debugging. Also, I should update the documentation to illustrate this updated behavior.
Canonical functions are currently not being supported at all. Currently in
/test-u/basics.lgl
the following code results in the error:Fatal error: exception Gatorl.CheckUtil.TypeException("Line: 7 -- Invalid canonical function canon b _ab(a v)")
.In fact if we change the code to the following,
we still get the same error indicating the the problem is not only in the casting
as!
.