我知道我应该更广泛地使用它,但是我们的代码只有少数几个接口,所以我对它们有点菜鸟。这是我的问题。在文件一中,我有这个:
Friend Interface IDateRow
Property Name() As String
...
End Interface
Friend Interface IAmountRow
Property StartDate() As IDateRow
Property EndDate() As IDateRow
...
End Interface
在文件 2 中,我有这个:
Friend Class DateRow
Inherits DtaRow
Implements IDateRow
Friend Property Name() As String Implements IDateRow.Name
...
End Class
到目前为止,一切都很好。现在...
Friend Class AmountRow
Inherits DtaRow
Implements IAmountRow
Friend Property StartDate() As DateRow Implements IAmountRow.StartDate
这不起作用 - 它说:
'StartDate' cannot implement 'StartDate' because there is no matching property on interface 'IAmountRow'.
我是否认为这是因为它返回的是 DateRow 而不是 IDateRow?DateRow 实现了 IDateRow,所以看起来应该是合法的。
我知道我在这里遗漏了一些愚蠢的东西......