C
Christopher Crooker
We had a function with the signature:
Function(Object *, DateTime, DateTime, EnumType)
and then changed the class some and there was a 4 parameter function with
the signature:
Function(Object *, DateTime, DateTime, DateTime)
The previous code had not been changed and to our surprise the function
compiled without error. I did a little testing and found any Int32 value
would be accepted as a DateTime parameter. Why is this not a compiler
error?
This definitely would have led to bugs would we have not known about the
functions that needed to be changed. There isn't even a constructor that
takes an Int32 specifically (though there is one for Int64), so the result
of this conversion is less than obvious. Is this documented somewhere or a
bug?
Christopher Crooker
Acquist Incorporated
Function(Object *, DateTime, DateTime, EnumType)
and then changed the class some and there was a 4 parameter function with
the signature:
Function(Object *, DateTime, DateTime, DateTime)
The previous code had not been changed and to our surprise the function
compiled without error. I did a little testing and found any Int32 value
would be accepted as a DateTime parameter. Why is this not a compiler
error?
This definitely would have led to bugs would we have not known about the
functions that needed to be changed. There isn't even a constructor that
takes an Int32 specifically (though there is one for Int64), so the result
of this conversion is less than obvious. Is this documented somewhere or a
bug?
Christopher Crooker
Acquist Incorporated