代码如下(vb.net)
//Piece是我自定义的一个很简单的类。
//这代码是在另外一个类里面
Private m_Pieces As List(Of Piece)
Public Property Pieces() As List(Of Piece)
Get
Return m_Pieces
End Get
Set(ByVal value As List(Of Piece))
m_Pieces = value
End Set
End Property
编译错误:
Public Property Pieces As System.Collections.Generic.List(Of Piece)”和“Public Property Pieces As System.Collections.Generic.List(Of Procedure)”的差异仅在于返回类型,因此它们无法重载对方。
英文版错误:
You have attempted to overload a method with another method that differs from the first only in its return type. In overloading, you must differentiate any two versions of a method by their argument lists; you cannot use anything other than argument lists to differentiate the methods.
侃侃无极
相关分类