Skip to content

Is there a good way to extend collection type conversion logic? #507

Discussion options

You must be logged in to vote

So my assumption is that ClearScript knows what T is (or should be) at this point.

Unfortunately, no.

Method binding in .NET is a rather complicated affair – so much so that ClearScript makes no attempt to duplicate the algorithm. Instead, it delegates the task to portions of the C# compiler that are accessible at runtime. It's the compiler that throws that exception.

To put it another way, ClearScript provides a call signature that the C# compiler binds to a method – one that it may have selected from a list of overloads according to a complex ruleset, constructed from a generic method definition, etc.

Because we don't have the method when we're building the call signature, we have no …

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@handerss-spotfire
Comment options

@ClearScriptLib
Comment options

@handerss-spotfire
Comment options

@ClearScriptLib
Comment options

Answer selected by handerss-spotfire
@handerss-spotfire
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants