[nem-en] Typing a expression in context of method
vc
vc at rsdn.ru
Sat May 12 18:59:33 CEST 2007
> I'm not really sure what you want to achieve. To type an expression
> you should use TypeExpr method of Typer. I've made a simple
> refactoring to allow separate creation of Typer and running the actual
> typing process, maybe it will help.
I move parameters initialization from RunTyper() to constructors.
For my task it's more than enough.
> I guess the main difference of TypeExpr and fully typing process is
> that TypeExpr does not do any delyed typing and any stages > 1. I'm
> not sure if this is really a problem, since if TypeExpr cannot type
> expression without going with delayed typing, then it means that the
> wider context is needed to type this expression and this requires
> usually a whole method to be typed.
> On the other hand typing
> { def f (x) { x.Foo } f (Bar()) }
> , which can be fully typed locally, probably also needs the delayed
> stage...
>
> To make typing fully independent of the processed MethodBuilder, we
> would need to refactor RunTyping, Typer2, 3, 4, RunSecondPass, etc.
In my option it's good idea.
> I'm not sure if that makes sense. Maybe a better way would be to add
> some richer logic for typing single expression. But first we would
> need to agree on what we actually want to achieve this way.
In macros we neen simple way to recognize type of some expressins.
All which simplify this is good.
Vlad
More information about the devel-en
mailing list