Ticket #3 (new defect)
Distinct IContinuation types/parameter names
Reported by: | smagi | Owned by: | smagi |
---|---|---|---|
Priority: | major | Component: | clavis |
Version: | Keywords: | ||
Cc: |
Description (last modified by smagi) (diff)
Need to add runtime checks to ensure that the type parameters to IContinuation are:
- all distinct types, and
- not T at one arg, and IEnumerable<T> at another arg
It would be nice if at least 1 could be enforced statically, but I don't see a way to do it. IContinuationX could implement a basic IParam<T> interface, but if you try to implement it for multiple type parameters, you get an error:
// error: 'IContinuation<T0,T1>' cannot implement both 'IParam<T0>' and 'IParam<T1>' because they may unify // for some type parameter substitutions public interface IContinuation<T0, T1> : IParam<T0>, IParam<T1> { }
Basically, this is only an error when defined for the same type parameters at the *use* site, not at the *declaration* site, but C# doesn't defer this check as I think it should.
This still wouldn't help for case 2 though, so we need a runtime check regardless. Fortunately, this can be checked once when the type is first loaded as a continuation.