Add dynamic<T> to the DLR
Extend the DLR with a dynamic<T> type. This would let you specify the type that members would be, but leave what members exist as dynamic. It would allow compile time checks on everything except member names and would be very useful if you had something like a Dictionary<string,Guid> as you're member names would match against the string, but the compiler would know you were returning a Guid.
2 comments
-
Qwertie
commented
Yeah, this is an extraordinarily random suggestion. It would make more sense to suggest that "dynamic<T> x" means that (x is T) so that some calls can be early-bound (if they exist in T), but other calls (that don't exist in T) will be late-bound.
-
Timwi Terby commented
This suggestion makes no sense. Would you provide an example to describe what you mean?