Walter Bright <> changed:

           What    |Removed                     |Added
             Status|NEW                         |RESOLVED
         Resolution|                            |FIXED

--- Comment #4 from Walter Bright <>  2009-07-03 
01:09:32 PDT ---
The actual rule for matching a delegate against a type is that the delegate is
covariant with the type. The return type is checked for covariance, and things
like a pure function is considered covariant with an impure one. This works
exactly the same as overriding a virtual function with a covariant one.

What you're asking for with the const parameters is contravariance.
Contravariant parameters are a good idea until overloading is considered. If
you have two functions, one with a const parameter and the other mutable, which
one overrides the base virtual function? You could say overriding is based on a
'best match', but things are complex enough without throwing that into the mix.

So, it is by design that the parameter lists must match exactly for covariant
functions. I also think it is not a good idea to have one covariant matching
rule for overriding, and another for implicit conversions. Better to have one
covariant rule.

Configure issuemail:
------- You are receiving this mail because: -------

Reply via email to