[runtime] Fix class visibility check for protected nested classes. (#7907)
commit254013b0fdf59bada951b1265ad2636fda1d7467
authorRodrigo Kumpera <kumpera@users.noreply.github.com>
Sat, 31 Mar 2018 15:04:00 +0000 (31 11:04 -0400)
committerAleksey Kliger (λgeek) <akliger@gmail.com>
Sat, 31 Mar 2018 15:04:00 +0000 (31 11:04 -0400)
tree73220a997c3607ff5e9e6dc74057d03fe13fb48d
parentebef3ec4b18cee98c0be15064bb68af08f427bf9
[runtime] Fix class visibility check for protected nested classes. (#7907)

* [runtime] Fix class visibility check for protected nested classes. Fixes #7657.

A nested class that has protected access must be checked using the same inheritance based rules as members.
The existing code ignores that and does a plain visibility check that is only amendable for public/internal nested types.

* [runtime] Add regression test for nested famility visibility.
mono/metadata/class.c
mono/tests/Makefile.am
mono/tests/nested_type_visibility.cs [new file with mode: 0644]