Accessing the inferred type in AbstractEquationStatement

I would like to customize the error string of a check-only equation in the typesystem, but I find that when typeof(...) is used in the error string expression, the result is the variable that represents the type of the argument, but not the concrete inferred type. So the error string looks like "expected type f", where f is the name of the type variable.

 

There is https://mps-support.jetbrains.com/hc/en-us/community/posts/360000374120/comments/360000075180 , but the node in this case does not have a field named type. Of course, since this is in the typesystem itself, j.m.l.typesystem is already in scope.

 

How would I access the concrete inferred type there?

 

Thanks in advance.

0
4 comments

You should wait for the type to be calculated with "when concrete".

Vaclav

 

1

Thanks. I saw the use of when concrete in the typesystem of the base language, but unfortunately it seems to be unavailable for an error string:

 

0

It should be used differently:

1

Oh okay, I am rather new to this. Thank you!

0

Please sign in to leave a comment.