You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
auto myview = registry.view!( Includes!(), Excludes!() )();
How to guess what type it's gonna use?
The function declaration has auto as return type, we could:
Scan the FunctionDeclaration, and list all the possible returns
BasicView and MultiView
Create a new DSymbol and merge all the parts together
Seems like a simple solution yet very effective!
Could do something like i did for the Templates PR and create a FunctionAutoReturnContext, so the type could be build properly in second.d in case it is a template
Now what about alias parameters?
We could scan all call references and do the same thing, build a DSymbol and merge all the parts
I got the idea from: https://github.com/zigtools/ zls/pull/1067 (url split on purpose to avoid useless noise on their PR)
The text was updated successfully, but these errors were encountered:
I think this is a good idea, in the typescript compiler it's similarly done with union types, e.g. return type would be BasicView | MultiView, but resolving this later takes enormous work in a solver / resolving algorithm, especially when cases get more complex. I think we should first optimize the current data structures we have, since currently we are starting to get RAM leaks and much longer request times again.
For the case of auto as return:
Let's take this example from my project:
Let's pretend i call it this way:
How to guess what type it's gonna use?
The function declaration has
auto
as return type, we could:returns
BasicView
andMultiView
Seems like a simple solution yet very effective!
Could do something like i did for the Templates PR and create a FunctionAutoReturnContext, so the type could be build properly in second.d in case it is a template
Now what about
alias
parameters?We could scan all call references and do the same thing, build a DSymbol and merge all the parts
I got the idea from: https://github.com/zigtools/ zls/pull/1067 (url split on purpose to avoid useless noise on their PR)
The text was updated successfully, but these errors were encountered: