Infer types for inferred jvm model [message #902481] |
Fri, 17 August 2012 17:05  |
Eclipse User |
|
|
|
Hi,
My DSL is a flow language where nodes are connected through typed ports.
A node may contain an XExpression and a Java operation is inferred and
generated with suitable parameter and return types.
Now I want as much as possible of the type information to be optional,
i.e. inferred, too, like Xbase does already. Ideally, I would like to
infer types through the whole graph, but I start with the return types
since they only require local information. When the inferrer infers a
method and lacks the return type, I call an injected ITypeProvider's
getType method on the body expression. However, it seems this is done
too early before the expressions are properly linked, because
getType(exprs) always returns null and in the debugger I see lots of
proxies.
So the question is: At what point in the infer/link process can I infer
and add the missing type information, e.g. return and parameter types,
but possibly also other types in the inferred jvm model?
Regards,
Hallvard
BTW, the use of the inferrer seems much improved in 2.3, thank you!
|
|
|
|
Re: Infer types for inferred jvm model [message #902490 is a reply to message #902484] |
Fri, 17 August 2012 17:50  |
Eclipse User |
|
|
|
On 17.08.12 14.11, Christian Dietrich wrote:
> Hi,
>
> do you call initializeLater in your inferrer
>
>
> acceptor.accept(
> entity.toClass( entity.fullyQualifiedName )
> ).initializeLater [
> ...
> ]
Yes, it's the same whether it's called in the toClass init-procedure or
initializeLater's.
I see that it works for a String literal, so I think it's type
information e.g. when using extension methods that's the problem.
Note that I in general would like to traverse the whole model and infer
all missing types in a certain order under my control, so I need to be
able to run the inference at an appropriate point.
Hallvard
|
|
|
Powered by
FUDForum. Page generated in 0.04029 seconds