[nem-en] Typing a expression in context of method

vc vc at rsdn.ru
Sat May 12 02:17:31 CEST 2007


> Maybe just replace mb.Body with FunBody.Abstract(), call Typer(mb) and
> replace it back again?
> 
> I agree it's kind of ugly, but is easy and should do the trick.

This trick doe not work. If I try:
...
mb.GetHeader().body = FunBody.Abstract();
def typer = Typer(mb);
...
compiler throw exception in Typer3.Run().

I think we need do refactoring of Typer.
1. Move work from constructors to mehods.
2. Exclude from typer work with MethodBuilder (and specially modifying of
MethodBuilder.Body).

In my option Typer should get all deeded information throw parametrs and
always return TExpr (maybe optin[always]).

But I not completely understand it logic (seemingly not only I). Will be
nice if you add some comments in Typer. It's realy difficult to understand
compiler part.

Vlad




More information about the devel-en mailing list