Note that all of this was discovered using the web editor. Consider the following example:
dialect "staticTypes"
var x:String := {
print "hi"
}
This is using the incomplete version of the staticTypes dialect, but I don't think that affects this problem. Clearly, x should be a String but is given a Block, so we raise a TypeError. However, what prints is this:
Def TypeError: the expression `{
in "typechecktest" (line 47, column 2)
The error message gets cut off after the first {. The code that raises this exception is here:
...
DefError.raiseWith("the expression `{value.toGrace(0)}` of type " ++
"'{vType}' does not satisfy the type of {defd.kind} " ++
"annotation '{defType}'", value)
...
The problem seems to be that the strings returned by the toGrace method for astNodes often include new line characters (\n). The error message gets cut off right at the first new line character.
This was originally reported as minigrace issue 116
Note that all of this was discovered using the web editor. Consider the following example:
This is using the incomplete version of the staticTypes dialect, but I don't think that affects this problem. Clearly,
x
should be a String but is given a Block, so we raise a TypeError. However, what prints is this:The error message gets cut off after the first {. The code that raises this exception is here:
The problem seems to be that the strings returned by the
toGrace
method forastNode
s often include new line characters (\n
). The error message gets cut off right at the first new line character.