Hello Chris:
I am aware of this behavior. If I recall correctly, generic instantiation can
resolve more than one argument at a time, but does not necessarily resolve all
generic arguments at one go. I have not discovered the cause for when generic
arguments are resolved in multiple batches. It appears that once all generic
arguments are resolved, we make one more pass through resolution.
I suspect that this is intended to catch cases where generic arguments are
resolved ambiguously. However, in practice I think we quit from generic
instantiation as soon as we have instantiated any non-generic version. If
those impressions are correct, we could probably collapse out the last
recursive call to gatherCandidates and obtain the same behavior overall.
It's probably relatively easy for me to add precision to my claims above; if
you need that information right away, let me know and I will fill in the gaps.
Tom Hildebrandt
________________________________
From: Chris Wailes [[email protected]]
Sent: Wednesday, December 11, 2013 1:18 PM
To: [email protected]
Subject: [Chapel-developers] The instantiate Function and Generics with Query
Types
If a generic function with a query type is passed to the instantiate() function
another generic function will be returned. It ends up taking several round
trips between addCandidate() and instantiate() to produce a non-generic
function. This seems like both odd and expensive behavior. Unfortunately I
don't have the time to puzzle this one out so I wanted to alert the developer
community in the hopes that someone else might be able to fix this.
- Chris
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Chapel-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/chapel-developers