The current Erg does not work with Self pointing to its own type. This should be replaced with the current scope type.
I have a few ideas for implementing this. One would be to replace the name in the desugaring process.
Another is that when the type checker finds the type Self, it looks for its own type in the current Context.
I think the former is better, since Self needs to be replaced before the code-generating process. Some desugaring methods have already been implemented, so it would not be so difficult to implement if we refer to them.
The current Erg does not work with
Self
pointing to its own type. This should be replaced with the current scope type.I have a few ideas for implementing this. One would be to replace the name in the desugaring process. Another is that when the type checker finds the type
Self
, it looks for its own type in the current Context.I think the former is better, since
Self
needs to be replaced before the code-generating process. Some desugaring methods have already been implemented, so it would not be so difficult to implement if we refer to them.