Are there properties that differ in parameters and return type?

后端 未结 2 1592
后悔当初
后悔当初 2021-01-25 20:02

I have a class call CalcArray that has an array of doubles called Amounts(), and two ints, StartPeriod and EndPeriod

2条回答
  •  春和景丽
    2021-01-25 20:13

    You may be bumping into the limitation that a function or property cannot vary by only the return type. In general if the signature has changed, the output type can change also on an overload. Look out also for the limitation for using default properties requires an argument. In some cases class inheritance is the issue, properties and functions being shadowed may explicitly be required to nominate Shadows, Overloads, Overrides etc. or the shadowing will be disallowed by the language.

    If these don't cover the cases you've seen, try to catch an example of the problem and study all locations of the same named property in your solution, reporting the results here.

提交回复
热议问题