why not c1 or c2 not inherit from type 'b(Of a)'.

×

דני

Public Class Form1
Public Class a

End Class
Public Class a1
Inherits a
End Class
Public Class a2
Inherits a
Private dsfs As d(Of c2) 'err Error 1 Type argument 'c2' does
not inherit from or implement the constraint type 'b(Of a)'.

End Class
Public Class b(Of T As a)

End Class

Public Class c
Inherits b(Of a)

End Class
Public Class c1
Inherits b(Of a)

End Class
Public Class c2
Inherits b(Of a1)

End Class
Public Class c3
Inherits b(Of a2)

End Class
Public Class d(Of T As b(Of a))

End Class
Dim r As New d(Of c3) 'err Error 1 Type argument 'c2' does not
inherit from or implement the constraint type 'b(Of a)'.

Dim r1 As New d(Of c) 'ok

End Class
 
F

Family Tree Mike

דני said:
Public Class Form1
Public Class a

End Class
Public Class a1
Inherits a
End Class
Public Class a2
Inherits a
Private dsfs As d(Of c2) 'err Error 1 Type argument 'c2' does
not inherit from or implement the constraint type 'b(Of a)'.

End Class
Public Class b(Of T As a)

End Class

Public Class c
Inherits b(Of a)

End Class
Public Class c1
Inherits b(Of a)

End Class
Public Class c2
Inherits b(Of a1)

End Class
Public Class c3
Inherits b(Of a2)

End Class
Public Class d(Of T As b(Of a))

End Class
Dim r As New d(Of c3) 'err Error 1 Type argument 'c2' does not
inherit from or implement the constraint type 'b(Of a)'.

Dim r1 As New d(Of c) 'ok

End Class


I think this is the same as your other question, but I haven't tried that
hard to compare. See if my previous answer helps.
 
F

Family Tree Mike

דני said:
Public Class Form1
Public Class a

End Class
Public Class a1
Inherits a
End Class
Public Class a2
Inherits a
Private dsfs As d(Of c2) 'err Error 1 Type argument 'c2' does
not inherit from or implement the constraint type 'b(Of a)'.

End Class
Public Class b(Of T As a)

End Class

Public Class c
Inherits b(Of a)

End Class
Public Class c1
Inherits b(Of a)

End Class
Public Class c2
Inherits b(Of a1)

End Class
Public Class c3
Inherits b(Of a2)

End Class
Public Class d(Of T As b(Of a))

End Class
Dim r As New d(Of c3) 'err Error 1 Type argument 'c2' does not
inherit from or implement the constraint type 'b(Of a)'.

Dim r1 As New d(Of c) 'ok

End Class


I think this is the same as your other question, but I haven't tried that
hard to compare. See if my previous answer helps.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top