다음을 통해 공유


'<derivedtypename>'은(는) '<internaltypename>' 형식의 액세스를 어셈블리 외부로 확장하므로 <type> '<constructedbasetypename>'에서 상속할 수 없습니다.

업데이트: 2007년 11월

'<derivedtypename>' cannot inherit from <type> '<constructedbasetypename>' because it expands the access of type '<internaltypename>' outside the assembly

파생된 클래스나 파생 인터페이스가 제한된 형식을 기본 클래스나 기본 인터페이스에 대한 형식 인수로 사용하여 제한된 형식의 액세스 수준을 확장하려고 합니다.

다음 코드를 실행하면 이 오류가 발생할 수 있습니다.

Public Class baseClass(Of t)
End Class
Public Class derivedClass
    Inherits baseClass(Of restrictedStructure)
End Class
Friend Structure restrictedStructure
    Dim firstMember As Integer
End Structure

어셈블리 외부의 코드는 restrictedStructure에 액세스할 수 없습니다. 그러나 derivedClass는 이를 참조할 수 있는 모든 코드에서 액세스할 수 있습니다. 따라서 derivedClass는 restrictedStructure를 형식 인수로 사용하는 경우 어셈블리 코드에 restrictedStructure를 노출할 수 있기 때문에 baseClass를 상속할 수 없습니다.

오류 ID: BC30922

이 오류를 해결하려면

  • 파생 형식이 제한된 형식의 액세스 수준을 확장하지 않도록 클래스나 인터페이스의 액세스 수준을 조정합니다.

    -또는-

  • 액세스 수준을 조정할 수 없는 경우 기본 클래스나 기본 인터페이스를 생성할 때 제한된 형식을 형식 인수로 사용하지 마십시오.

참고 항목

개념

상속 기본 사항

Visual Basic의 액세스 수준

Visual Basic의 제네릭 형식

참조

Inherits 문

형식 목록