[nem-en] Type inference in completion
Kamil Skalski
kamil.skalski at gmail.com
Thu May 3 01:27:39 CEST 2007
The problem is that you jump into typing process too early. The type
of x is known only after the DelyedTyping is finished, but your
Complete method is called during the first run of typer. I'm not sure
how it could be fixed, but I guess there must be a change in the model
of completion here... you should somehow hook into the delayed typing
and intercept the moment, when x's type becomes known and compiler is
trying to re-run typing of Member (obj, HalfId) node. This however
requires for example proper handling of such nodes in original typer
methods (like TypeMember).
Maybe Michal could give you some more hints.
2007/4/26, vc <vc at rsdn.ru>:
> Hi.
>
> We have some problem during type inference. For example if try to get member
> list from 'x' (cursor position mark by '|'):
> def lst = ["1", "2", "3", "52"];
> WriteLine(lst.Map(x => x.|));
> we will see System.Object members.
>
> I surmise it's result of braking of type inference process. See:
> line 273 of
> http://nemerle.org/svn/vs-plugin/trunk/Nemerle.Compiler.Utils/Nemerle.Comple
> tion2/Engine/Engine.Completion.n
> and line 1170 of http://nemerle.org/svn/nemerle/trunk/ncc/typing/Typer.n
>
> What we should to do for infer real type of 'x'?
>
> Vlad.
>
>
> _______________________________________________
> https://nemerle.org/mailman/listinfo/devel-en
>
--
Kamil Skalski
http://nazgul.omega.pl
More information about the devel-en
mailing list